Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

viewState on Asp.net

Posted on 2011-09-27
5
Medium Priority
?
266 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 1000 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 1000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

885 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