Solved

viewState on Asp.net

Posted on 2011-09-27
5
243 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
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…

776 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