Solved

Turn off validation on Return

Posted on 2003-12-08
2
221 Views
Last Modified: 2010-04-16
I have a Return button that redirects if clicked but if the user hit the submit button and generated validator errors before that, the Return button just sits there.   I think I have to use unload, but don't know how.
0
Comment
Question by:dcass
[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 7

Expert Comment

by:TransBind
ID: 9900462
I think it has something to do with the way you structured your code. When a Button, LinkButton, or ImageButton Web server control is clicked, the current page is submitted to the server, where it is processed. The button always posts the page to the server. When you click your return button if its a server control button your validators will be checked/errored. Try to make that button a regular html button/javascript or experiment with this:

private void Page_Load(object sender, System.EventArgs e)
{
   if (!IsPostBack)
   {
      // Evals true first time browser hits the page.
   }
   else
   {
      // This is called if the form has been posted back, possibly
      // by a button click.
      this.Label1.Text = "You clicked a button.";
   }
}


0
 
LVL 18

Accepted Solution

by:
testn earned 125 total points
ID: 9903418
you can add a property to your control to avoid the client side validation....

<asp:button runat=server id=btnReturn text="Return" causesvalidation=false />
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

733 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