Solved

viewState on Asp.net

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

Expert Comment

by:paulmacd
Comment Utility
What is goTo?  Evidently the ViewState is part of that.
0
 

Author Comment

by:Mortarello
Comment Utility
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
Comment Utility
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
Comment Utility
You might be using get and not post.
Check this.
0
 

Author Comment

by:Mortarello
Comment Utility
Thanks Guys..

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

:)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

AJAX ModalPopupExtender has a required property "TargetControlID" which may seem to be very confusing to new users. It means the server control that will be extended by the ModalPopup, for instance, if when you click a button, a ModalPopup displays,…
This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now