Solved

Server side validation in vb.NET page

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
daypilot scheduler 3 30
write xml in vb.net 2 24
ASP.NET MVC -Add authentication 2 21
MailAddress in vb 4 16
Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
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 …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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