Submit button stops working after postback in IE11 - asp.net

Problem:
Sometimes submit button stops working after postback in IE11. It's
clickable, but it doesn't trigger any event. There is no script or
server side errors. Even the right click menu doesn't show on button.
If clicked somewhere on page it starts to work normally.
Button is general ASP.NET button
Server side:
<asp:Button ID="btnSave" runat="server" Text="Save" SkinID="Button82" OnClick="btnSave_Click" />
Client side:
<input name="ctl00$cphMain$Substitution$btnSave" class="button82" id="cphMain_Substitution_btnSave" type="submit" value="Save">
Any solutions?

For now I solved it using this in postback:
ScriptManager.RegisterStartupScript(Page, this.GetType(), "Refocus", "RefocusIE11()", true);
It calls function after postback, that refocuses on next element. This makes button to work again.

Related

disabling asp button onclick prevents event from firing

I'm trying to disable an asp button when it is clicked on the client side.
<asp:Button runat="server" ID="btnSubmit" Text="Save" class="Button" OnClick="btnSubmit_Click" CausesValidation="false"></asp:Button>
<script type="text/javascript">
$("input[type=submit],button").click(function (){$(this).attr("disabled", "disabled");});
</script>
when the button is clicked it does post back to the page_load , but it won't go to the btnSubmit_Click method. If I remove the jquery that disables the button it makes it from the page_load to the btnSubmit_Click method.
It seems when the button is disabled from the jquery it is no longer able to wire up to its event. Anyone have any ideas how I can disable the button client side, and still make it to the specific onclick event method?
This is resolved (Yuriy answered), the issue was that I needed to put the disabled code within the form.submit client side code. If not the disabled button was not firing its click event, yet it was still posting back, just not going to the onclick method.
solution:
$('#Form1').submit(function(){ $("input[type=submit],button").click(function (){$(this).attr("disabled", "disabled");});

asp button and modal

So i have this button:
<asp:Button ID="Buttonid" runat="server" Text="View" BorderStyle="None" OnClick="Button_click_event" data-toggle="modal" data-target="#myModal"></asp:Button>
but then clicking the button will not toggle the OnClick Event, it will just show the modal.
But if i remove the data-toggle="modal" data-target="#myModal". The onclick event will work, but obviously the modal will not popup anymore.
Help please. Thanks
The script that is controlling your model more than likely stops the regular functions of the button so will stop it posting back which will stop the event handler from being fired.
To get both client side and server side to fire you'll have to post back and then display the model when the page reloads.

how to opacity the asp.net page on button click , till procees get complete

how to opacity the asp.net page on button click , till procees get complete of respective button.
Can anyone help me ?
If it's a regular postback, use client side javascript to disable the button before the actual postback happens.
<asp:Button runat="server" ID="myBtn" OnClick="YourServerSidePostBack"
OnClientClick="document.getElementById('<%= myBtn.ClientID %>').disabled = true;" />

Onclick not added until after Postback

I have the following:
<asp:Button id="SubmitButton" Text="Submit" runat="server" OnClientClick="Do();"
OnClick="SubmitButton_Click"/>
When the page is first rendered, I go to the view source in my browser and see that the onclick="Do();" is not added to my submit button tag. But when I do a post back, and do the view source again, the onclick is added to the submit.
Why would the onclick not be there on the first request?
At least on my machine, I can see OnClick event on both request.

asp.net and jquery dialog

does anyone know how to use jquery modal dialog in asp.net pages?
http://jqueryui.com/demos/dialog/
I've tried creating a simple aspx page, pasted code from the example (http://jqueryui.com/demos/dialog/), it almost works. The dialog briefly shows up and then disappears. It seems that the page is doing a postback. I'm not sure how to stop it, so that the modal dialog stays up.
I've been using jqModal for modal dialogs. I've set it up to use a standard HTML input button to trigger the dialog, and then you can put a regular asp.net button or other controls inside of the hidden div.
Hope this helps.
I assume you have something like:
<asp:Button ID="popupButton" OnClientClick="showModalPopup();" Text="Click me" runat="server" />
I would try adding "return false;" to the OnClientClick property of your Button:
<asp:Button ID="popupButton" OnClientClick="showModalPopup(); return false;" Text="Click me" runat="server" />
Or if you don't need to access the button in code-behind, simply use a standard HTML button and set it's onclick event attribute:
<button onclick="showModalPopup();">Click me</button>

Resources