Solved

Turn off validation on Return

Posted on 2003-12-08
2
222 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

707 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