joecool2005 Posted October 18, 2007 Share Posted October 18, 2007 Hi,On the following code, the button will be disabled after the user clicked by calling OnClientClick. But I have a problem. It does not execute Sub CommandBtn_Click. Plz help!Joe <script runat="server"> Sub CommandBtn_Click(sender As Object, e As CommandEventArgs) Message.Text = "this is a test" End Sub</script> <form id="form1" runat="server"> <asp:Button id="Button1" Text="Sort Ascending" CommandName="Sort" CommandArgument="Ascending" OnCommand="CommandBtn_Click" OnClientClick="var oDiv = document.getElementById('Button1');oDiv.disabled=true;" runat="server"/> <asp:Label id="Message" runat="server"/> </form> Link to comment Share on other sites More sharing options...
Reg Edit Posted October 19, 2007 Share Posted October 19, 2007 Hi,On the following code, the button will be disabled after the user clicked by calling OnClientClick. But I have a problem. It does not execute Sub CommandBtn_Click. Plz help!JoeDisabling the button in the client handler is preventing the server control click event from firing.Disable the button in Sub CommandBtn_Click instead:Button1.Enabled = False Link to comment Share on other sites More sharing options...
SpOrTsDuDe.Reese Posted October 22, 2007 Share Posted October 22, 2007 yes reqs thing is much simpler then what you put Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.