Solved

Server side validation in vb.NET page

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

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

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 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

19 Experts available now in Live!

Get 1:1 Help Now