|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ClickOnce Button?Hi,
I have an ASP.NET 2.0 application with Master Pages and I would to make a WebContols.Button to be disabled on the client side when the user pressed on it so he will not be able to mistakably press it again before the server has done processing his request. How can it be done? Regards, Asaf > Hi, like this maybe?> > I have an ASP.NET 2.0 application with Master Pages and I would to make a > WebContols.Button to be disabled on the client side when the user pressed on > it so he will not be able to mistakably press it again before the server has > done processing his request. > > How can it be done? > > Regards, > Asaf http://www.metabuilders.com/Tools/OneClick.aspx Hans Kesting Hello Hans,
Thanks for your reply but I am looking just to Disabled the button when the user pressed it. Regards, Asaf Show quoteHide quote "Hans Kesting" wrote: > > Hi, > > > > I have an ASP.NET 2.0 application with Master Pages and I would to make a > > WebContols.Button to be disabled on the client side when the user pressed on > > it so he will not be able to mistakably press it again before the server has > > done processing his request. > > > > How can it be done? > > > > Regards, > > Asaf > > like this maybe? > http://www.metabuilders.com/Tools/OneClick.aspx > > Hans Kesting > > > Hi,
I understand that your webform takes long time to complete the postback and you want the button caused the postback gets disabled after clicked, right? I think you can use following code as an example: ----8<---- web form ---- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <script type="text/javascript" language="javascript"> function mypostback() { form1.button1.disabled = true; form1.submit(); } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="button1" runat="server" OnClientClick="mypostback();" Text="Submit" /> </div> </form> </body> </html> ----8<---- code behind ----- using System; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (IsPostBack) { System.Threading.Thread.Sleep(3000); } } } I hope this helps. Please feel free to post here if anything is unclear. Sincerely, Walter Wang (waw***@online.microsoft.com, remove 'online.') Microsoft Online Community Support ================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications. Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx. ================================================== This posting is provided "AS IS" with no warranties, and confers no rights. Hello Walter,
Thanks for your help. Regards, Asaf Show quoteHide quote "Walter Wang [MSFT]" wrote: > Hi, > > I understand that your webform takes long time to complete the postback and > you want the button caused the postback gets disabled after clicked, right? > > I think you can use following code as an example: > > ----8<---- web form ---- > > <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" > Inherits="_Default" %> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > <html xmlns="http://www.w3.org/1999/xhtml" > > <head runat="server"> > <title>Untitled Page</title> > <script type="text/javascript" language="javascript"> > function mypostback() > { > form1.button1.disabled = true; > form1.submit(); > } > </script> > </head> > <body> > <form id="form1" runat="server"> > <div> > <asp:Button ID="button1" runat="server" > OnClientClick="mypostback();" Text="Submit" /> > </div> > </form> > </body> > </html> > > ----8<---- code behind ----- > > using System; > using System.Web.UI; > using System.Web.UI.WebControls; > using System.Web.UI.HtmlControls; > > public partial class _Default : System.Web.UI.Page > { > protected void Page_Load(object sender, EventArgs e) > { > if (IsPostBack) > { > System.Threading.Thread.Sleep(3000); > } > } > } > > I hope this helps. Please feel free to post here if anything is unclear. > > Sincerely, > Walter Wang (waw***@online.microsoft.com, remove 'online.') > Microsoft Online Community Support > > ================================================== > Get notification to my posts through email? Please refer to > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif > ications. > > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues > where an initial response from the community or a Microsoft Support > Engineer within 1 business day is acceptable. Please note that each follow > up response may take approximately 2 business days as the support > professional working with you may need further investigation to reach the > most efficient resolution. The offering is not appropriate for situations > that require urgent, real-time or phone-based interactions or complex > project analysis and dump analysis issues. Issues of this nature are best > handled working with a dedicated Microsoft Support Engineer by contacting > Microsoft Customer Support Services (CSS) at > http://msdn.microsoft.com/subscriptions/support/default.aspx. > ================================================== > > This posting is provided "AS IS" with no warranties, and confers no rights. > >
Other interesting topics
Response.AddHeader("Content-Disposition"....
WSDL Generated Proxy Classes? Problem with .aspx file types Modal dialog in web application Good diagram showing asp.net events? ActiveX control to enable in Toolbox in ASP.Net DIV runat=server vs PANEL POST open *.pdf in another drive Make a value the default in a databound dropdown |
|||||||||||||||||||||||