Solved

Server side validation in vb.NET page

Posted on 2013-11-03
2
337 Views
Last Modified: 2013-12-17
.aspx page markup
<form action="UserResponse.aspx" method="post" onsubmit="combineValuesUR();return formValidate();" name="userresponseform" id="useresponse">

code behind:
   Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  strValidated = Request("Validated")
 

            If strValidated = "false" Then

                Response.Redirect("MainPage.aspx")

            End If

The page has only client side validation.If the scripts are disabled on the browser, the form values are not validated before submitting to server.

Can I do the server side validation here

 If strValidated = "false" Then

                Response.Redirect("MainPage.aspx")
            else

               .server side validation

            End If

End Sub

Thanks
0
Comment
Question by:KavyaVS
2 Comments
 
LVL 14

Accepted Solution

by:
dejaanbu earned 500 total points
ID: 39620786
you can write your own server side validation code on the button_click event or what ever control that causes the form to submit. Don't do that in page_load event.

BTW, if you are using Asp.net validation controls..then  Check Page.IsValid to see if server-side validation isn't being performed.. you can also invoke it via Page.Validate().
0
 

Author Closing Comment

by:KavyaVS
ID: 39724702
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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