Link to home
Start Free TrialLog in
Avatar of Mortarello
MortarelloFlag for United Kingdom of Great Britain and Northern Ireland

asked on

viewState on Asp.net

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
Avatar of Paul MacDonald
Paul MacDonald
Flag of United States of America image

What is goTo?  Evidently the ViewState is part of that.
Avatar of Mortarello

ASKER

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
SOLUTION
Avatar of Ramkisan Jagtap
Ramkisan Jagtap
Flag of Finland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Guys..

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

:)