Disable webpage controls during postback round trip

Discussion in 'ASP .Net' started by Sehboo, Dec 13, 2006.

  1. Sehboo

    Sehboo Guest

    Ok, let me try it again.


    I am copying the header section from my page here - maybe I am missing
    something


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <HTML>
    <HEAD> <TITLE></TITLE>
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name="vs_defaultClientScript" content="JavaScript">
    <script language="JavaScript">history.forward();
    function ignoreinput()
    {return false;}
    function stop_input()
    {
    window.attachEvent("onkeydown", ignoreinput);
    window.attachEvent("onclick", ignoreinput);
    }
    </script>
    </HEAD>
    <BODY LEFTMARGIN=0 TOPMARGIN=0 BOTTOMMARGIN=0 RIGHTMARGIN=0
    onLoad='javascript:setDefaultButtonScript()'>
    <form name="_ctl16" method="post" action="MyPage.aspx"
    language="javascript" onsubmit="return stop_input();" id="_ctl16"
    runat="server">


    I have two buttons on this page, print and cancel. Print takes about
    10 seconds to print the report and cancel just take you back to the
    previous page. If I click on print and after two seconds, click on
    cancel then it takes me back to the previous page. What I want is that

    once user clicks on print, all the other controls should be disabled
    (or ignored).

    Why my above code doesn't work? I got this code from this group.

    thanks
     
    Sehboo, Dec 13, 2006
    #1
    1. Advertising

  2. the simplest thing to do is simply disable the buttons themselves. That's
    the most error-free method and most cross-platform. There's a script over at
    dynamicdrive that shows an example of exactly that.

    http://www.dynamicdrive.com/dynamicindex11/submitonce.htm


    --

    Hope this helps,
    Mark Fitzpatrick
    Former Microsoft FrontPage MVP 199?-2006



    "Sehboo" <> wrote in message
    news:...
    > Ok, let me try it again.
    >
    >
    > I am copying the header section from my page here - maybe I am missing
    > something
    >
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    > <HTML>
    > <HEAD> <TITLE></TITLE>
    > <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    > <meta name="CODE_LANGUAGE" Content="C#">
    > <meta name="vs_defaultClientScript" content="JavaScript">
    > <script language="JavaScript">history.forward();
    > function ignoreinput()
    > {return false;}
    > function stop_input()
    > {
    > window.attachEvent("onkeydown", ignoreinput);
    > window.attachEvent("onclick", ignoreinput);
    > }
    > </script>
    > </HEAD>
    > <BODY LEFTMARGIN=0 TOPMARGIN=0 BOTTOMMARGIN=0 RIGHTMARGIN=0
    > onLoad='javascript:setDefaultButtonScript()'>
    > <form name="_ctl16" method="post" action="MyPage.aspx"
    > language="javascript" onsubmit="return stop_input();" id="_ctl16"
    > runat="server">
    >
    >
    > I have two buttons on this page, print and cancel. Print takes about
    > 10 seconds to print the report and cancel just take you back to the
    > previous page. If I click on print and after two seconds, click on
    > cancel then it takes me back to the previous page. What I want is that
    >
    > once user clicks on print, all the other controls should be disabled
    > (or ignored).
    >
    > Why my above code doesn't work? I got this code from this group.
    >
    > thanks
    >
     
    Mark Fitzpatrick, Dec 13, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Peter Row
    Replies:
    1
    Views:
    695
    vMike
    Nov 26, 2003
  2. =?Utf-8?B?TGFycnk=?=

    Disable web page controls during postback round-trip

    =?Utf-8?B?TGFycnk=?=, Mar 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    6,215
    Adrian Parker
    Mar 9, 2006
  3. Sehboo
    Replies:
    2
    Views:
    452
    Sehboo
    Dec 12, 2006
  4. Tony Girgenti
    Replies:
    7
    Views:
    335
    Jasbird
    Apr 1, 2007
  5. moondaddy

    Prevent round trip of postback

    moondaddy, Sep 12, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    925
    moondaddy
    Oct 5, 2007
Loading...

Share This Page