Solved

Server side validation in vb.NET page

Posted on 2013-11-03
2
338 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

749 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