473,325 Members | 2,792 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,325 software developers and data experts.

Disable AutoPostBack?????

I have a textbox with Autopostback = true.
I also have in JavaScript that checks the value before the postback occurs

OnBlur = "return CheckValue(myValue)"

Ive always gotton it to work with command buttons that if the return value
was false, then the Server-side method behind the button would not execute.

But how can I do the same for a textbox with AutoPostBack set to true? It
performs the postback regardless if the return value was true or false.

--
JP
..NET Software Developer
Mar 15 '07 #1
3 3951
Hello,

you should perhaps use a CustomValidadator here to check your own
constraints. It has a property called ClientValidationFunction, which is
called before post back.

Best regards,
Henning Krause

"JP" <JP@discussions.microsoft.comwrote in message
news:F7**********************************@microsof t.com...
>I have a textbox with Autopostback = true.
I also have in JavaScript that checks the value before the postback occurs

OnBlur = "return CheckValue(myValue)"

Ive always gotton it to work with command buttons that if the return value
was false, then the Server-side method behind the button would not
execute.

But how can I do the same for a textbox with AutoPostBack set to true? It
performs the postback regardless if the return value was true or false.

--
JP
.NET Software Developer
Mar 16 '07 #2
We have given up on using the .NET validators because of poor reliability and
scope which we need them defined. Even on PCs with the same OS and frame
work, it was a crapshoot if they would work as intended on one PC and not
another

Coding our on validation has proved more reliable

--
JP
..NET Software Developer
"Henning Krause [MVP - Exchange]" wrote:
Hello,

you should perhaps use a CustomValidadator here to check your own
constraints. It has a property called ClientValidationFunction, which is
called before post back.

Best regards,
Henning Krause

"JP" <JP@discussions.microsoft.comwrote in message
news:F7**********************************@microsof t.com...
I have a textbox with Autopostback = true.
I also have in JavaScript that checks the value before the postback occurs

OnBlur = "return CheckValue(myValue)"

Ive always gotton it to work with command buttons that if the return value
was false, then the Server-side method behind the button would not
execute.

But how can I do the same for a textbox with AutoPostBack set to true? It
performs the postback regardless if the return value was true or false.

--
JP
.NET Software Developer

Mar 16 '07 #3
JP wrote:
I have a textbox with Autopostback = true.
I also have in JavaScript that checks the value before the postback occurs

OnBlur = "return CheckValue(myValue)"

Ive always gotton it to work with command buttons that if the return value
was false, then the Server-side method behind the button would not execute.

But how can I do the same for a textbox with AutoPostBack set to true? It
performs the postback regardless if the return value was true or false.
Catch it at the submit event on the form. That event occurs and the
true/false behavior of its events works so you can have some state to
controls submittal.

Hope this helps.

P.S. I am with you with the validation capabilities of .net. We roll our
own much more efficient client and server validators.
Mar 18 '07 #4

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

Similar topics

1
by: Christopher D. Wiederspan | last post by:
I'm wondering if there's a way to use javascript to disable a ASP.NET web page before it starts to postback. Specifically, here's what I'm running into. I've got a webform that has an autopostback...
3
by: Stephen | last post by:
Hi, How do I disable the enter key for a "Form"? so that user has to click the "Submit" button. Is there a way of doing it other than using Java/VB script? Thanks, Stephen
6
by: M O J O | last post by:
Hi, I have a webform with a textbox and a button. When the textbox is empty (=""), I want the button to be disabled. When the user enters text in the textbox, the button must be enabled. Is...
9
by: junlia | last post by:
Does anyone how how can we disable the auto-postback feature in asp.net page? I have to use a server side control in the page, but the auto post back feature in it causes problems for me. Please...
8
by: rodchar | last post by:
hey all, can someone please tell me if you can disable the scroll button for a dropdownlist. For example, when you select an item in a dropdownlist and it still has focus and you accidently hit...
4
by: Arvind P Rangan | last post by:
Hi, Has anybody worked on disabling postback event of button event in webforms. As it does not have a property of autopostback how do we make it disable. I tried few article but they have...
4
by: enahar | last post by:
I have created RadioButtonList1 having 2 radio buttons in the list.How to make enable/disable only 1 radio button in the RadioButtonlist. Thanks for your help. Regards.
2
by: rn5a | last post by:
Assume that a user control has a TextBox (Page1.ascx) <asp:TextBox ID="txtName" runat="server"/> I am encapsulating the above user control in a ASPX page named Page1.aspx i.e. the ASPX page...
2
by: rockdale | last post by:
Hi, I have a treeview and in the page load event I populate the treeview completely. I do not have any server side event for the treeview. But still when the user click on a node, the treeview...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.