473,378 Members | 1,400 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,378 software developers and data experts.

Disable Postback event of Button

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 given example of disabling the button not
disabling postback event!!!

Thanks
Arvind
Nov 19 '05 #1
4 10978
ASP.NET Buttons will allways render as <INPUT Type="Submit" RunAt=Server>,
If you think about it, what would be the point of adding a server control
button which did not postback.

If you want button functionality which does not postback, then add an HTML
button which has the type button.

HTH Mr Newbie
"Arvind P Rangan" <ar******@hotmail.com> wrote in message
news:ex**************@TK2MSFTNGP14.phx.gbl...
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 given example of disabling the button
not disabling postback event!!!

Thanks
Arvind

Nov 19 '05 #2
remove the runat="server" attribute or

you can also add an onclick attribute to the button and return true i.e.
YourButton.Attributes.Add("onclick", "<script>return true</script>");

HTH,

"Arvind P Rangan" <ar******@hotmail.com> wrote in message
news:ex**************@TK2MSFTNGP14.phx.gbl...
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 given example of disabling the button
not disabling postback event!!!

Thanks
Arvind

Nov 19 '05 #3
Arvind,

Are you attempting to keep a form from being submitted more than once?

If that's the case I have a Javascript component available for free on my
website, www.aboutfortunate.com, which contains a method for disabling a
submit button after the first click. The component also contains some other
useful javascripts, but even if you don't want those you could still just
strip out the code for disabling the postback on the second click.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Arvind P Rangan" <ar******@hotmail.com> wrote in message
news:ex**************@TK2MSFTNGP14.phx.gbl...
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 given example of disabling the button
not disabling postback event!!!

Thanks
Arvind

Nov 19 '05 #4
thanks everyone,

We had worked on HTML control but has anyone as worked on asp:button on the
same.

ARvind
"Mr Newbie" <he**@now.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
ASP.NET Buttons will allways render as <INPUT Type="Submit" RunAt=Server>,
If you think about it, what would be the point of adding a server control
button which did not postback.

If you want button functionality which does not postback, then add an HTML
button which has the type button.

HTH Mr Newbie
"Arvind P Rangan" <ar******@hotmail.com> wrote in message
news:ex**************@TK2MSFTNGP14.phx.gbl...
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 given example of disabling the button
not disabling postback event!!!

Thanks
Arvind


Nov 19 '05 #5

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...
6
by: Al Cohen | last post by:
I'm using a LinkButton to call some code, then do a redirect. The code does some queries, sends some emails, and takes a few moments before the redirect is performed. I'd like to disable my...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
6
by: GD | last post by:
Hi, I wonder how to disable the "submit" behavior of a button. What I want is to assign values to dynamically added user controls without page postback. Problem: dynamically created control can...
2
by: Fluxray | last post by:
--Background: I have a webform including a datagrid. The datagrid is using template. Its ItemTemplate is used to display a look-up-table with labels. its EditItemTemplate is used to edit a row in...
2
by: Ghafran Abbas | last post by:
Call this function from the Page_OnLoad event of your asp.net page. This will prevent the user from doing multiple post backs or button clicks. This was designed to not disable the button, because...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
0
by: Robert Ladd | last post by:
Hi, I'm trying to disable the asp.net calendar control from a javascript function, but it doesn't disable the doPostBack. To simplify the situation, assume a page with 4 controls. A...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
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...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.