Solved

viewState on Asp.net

Posted on 2011-09-27
5
246 Views
Last Modified: 2012-05-12
Hello guys,

I'm trying to do one simple validation on my login page, When user enter with login and password wrong my URL on browser show my viewstate . Is this correct ?

I'm doing  a simple validation on codebehind .

   if (pwd.Equals("321") && login.Equals("michel"))
            {
                Response.Redirect(goTo);
            }

This only hapens if password or login is wrong, if he type right details the application do not show the viewstat on the url browser.

http://localhost:49326/Pages/login.aspx?__VIEWSTATE=%2FwEPDwULLTEyOTAxODc5MjdkZEPigUAStfitSrghbglrJ10NMyIrlSSZJLRGVC%2FE9BTI&__EVENTVALIDATION=%2FwEWBALApPi4AwLEhISACwKd%2B7q4BwKM54rGBlgX8nAYTnzXlfpiDqzhurqL3vEDdUp7adD%2BHf%2B9yUPl&txtname=michel&txtpwd=123&Button1=Confirm
0
Comment
Question by:Mortarello
5 Comments
 
LVL 34

Expert Comment

by:Paul MacDonald
ID: 36710721
What is goTo?  Evidently the ViewState is part of that.
0
 

Author Comment

by:Mortarello
ID: 36710757
Hi paukmacd,

This is my validation on my code behind.

           var pwd = txtpwd.Text;
            var login = txtname.Text;
            string goTo = "clientform.aspx";

            if (pwd.Equals("321") && login.Equals("michel"))
            {
                Response.Redirect(goTo);
            }

I just would like to know if it is normal or not..Because when user type the correct login and passord the viewState is not shown on url browser.

Tks
0
 
LVL 12

Assisted Solution

by:Ramkisan Jagtap
Ramkisan Jagtap earned 250 total points
ID: 36710775
handle this using else to ur if statement. Show error msg in that.
0
 
LVL 41

Accepted Solution

by:
guru_sami earned 250 total points
ID: 36710783
You might be using get and not post.
Check this.
0
 

Author Comment

by:Mortarello
ID: 36710855
Thanks Guys..

I did using else as Ramkisan said works..And i did using Post as Guru_sami said works too.

:)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question