473,383 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Custom Validators - OnServerValidate

Does anyone know if it is possible? If I have two buttons on a page and in
my OnServerValidate function can I figure out which button was pressed.

I need to know because I have validators on the page that I do not want to
enable when a specific button is pressed.

Thanks in advance.
Sep 14 '05 #1
2 1675
This is what you should do. Set the "causesvalidation" property for the
asp:button to false. This is will prevent any of the validators from firing.

<asp:button runat="server" id="btnSubmitNoValidation"
causesvalidation="False" .... />

"RichieRich" wrote:
Does anyone know if it is possible? If I have two buttons on a page and in
my OnServerValidate function can I figure out which button was pressed.

I need to know because I have validators on the page that I do not want to
enable when a specific button is pressed.

Thanks in advance.

Sep 14 '05 #2
I could do that, however I still need to do validation on the page with 2
buttons. For example, I want to validate some validation conbtrols when
Button1 is pressed and a different set of validators when Button2 is pressed.
And all validators are on the same page.

Any ideas?

"Naeem Sarfraz" wrote:
This is what you should do. Set the "causesvalidation" property for the
asp:button to false. This is will prevent any of the validators from firing.

<asp:button runat="server" id="btnSubmitNoValidation"
causesvalidation="False" .... />

"RichieRich" wrote:
Does anyone know if it is possible? If I have two buttons on a page and in
my OnServerValidate function can I figure out which button was pressed.

I need to know because I have validators on the page that I do not want to
enable when a specific button is pressed.

Thanks in advance.

Sep 14 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike P | last post by:
Is it possible to use custom validators when editing a datagrid? I'm asking this because I am trying to use a custom validator to validate a control which is in an <edititemtemplate> tag and when I...
2
by: Mike P | last post by:
Why do the validation server controls behave differently on my live site from on my local development machine? I have several text boxes that are validated by Required Validators and a couple of...
2
by: Mike P | last post by:
I have a Custom validator that has ControlToValidate set to a textbox that also has a Required and RegularExpression validator. When I run the webpage on my machine the custom validator...
1
by: Stephan Bour | last post by:
Hi, I need to validate a text box in a datagrid nested inside a datalist. All I need is to validate that any text is entered in the textbox. However, a requiredfieldvalidator would not do because...
10
by: Rigs | last post by:
Hi, I have a textbox with a Custom Validator that utilizes the OnServerValidate method for that textbox. This works fine, however the method only executes when data exists in that textbox after...
6
by: tshad | last post by:
I have the following on one of my Textboxes: <asp:RequiredFieldValidator ControlToValidate="email" Text="Email Required" runat="server" /> <asp:RegularExpressionValidator...
2
by: Alan Silver | last post by:
Hello, I have a custom validator on my page, and have the server-side code working fine. I want to add a client-side funtion as well, but am not sure how to wire it in so that it works with the...
2
by: RichieRich | last post by:
Does anyone know if it is possible? If I have two buttons on a page and in my OnServerValidate function can I figure out which button was pressed. I need to know because I have validators on the...
1
by: Steveaux | last post by:
Hi, I'm new to ASP.Net, so this may be something simple that I forgot. I have a form where a person can create a login. I'm doing the processing on this myself. The form has a plethora of...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.