Solved

Server side validation in vb.NET page

Posted on 2013-11-03
2
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

739 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