ClickOnce Button?

Discussion in 'ASP .Net' started by Guest, Sep 7, 2006.

  1. Guest

    Guest Guest


    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?

    Guest, Sep 7, 2006
    1. Advertisements

  2. Guest

    Hans Kesting Guest

    like this maybe?

    Hans Kesting
    Hans Kesting, Sep 7, 2006
    1. Advertisements

  3. Guest

    Guest Guest

    Hello Hans,

    Thanks for your reply but I am looking just to Disabled the button when the
    user pressed it.

    Guest, Sep 7, 2006
  4. 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"

    <html xmlns="" >
    <head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript" language="javascript">
    function mypostback()
    form1.button1.disabled = true;
    <form id="form1" runat="server">
    <asp:Button ID="button1" runat="server"
    OnClientClick="mypostback();" Text="Submit" />

    ----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)

    I hope this helps. Please feel free to post here if anything is unclear.

    Walter Wang (, remove 'online.')
    Microsoft Online Community Support

    Get notification to my posts through email? Please refer to

    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

    This posting is provided "AS IS" with no warranties, and confers no rights.
    Walter Wang [MSFT], Sep 7, 2006
  5. Guest

    Guest Guest

    Hello Walter,

    Thanks for your help.

    Guest, Sep 7, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.