I have hidden div with ASP.NET server buttons. I show a content of that div as modal 开发者_JS百科window on the page via JavaScript by copying innerHTML, but buttons on that div don't fire server events. Who knows how to fix that?
ThanksA first guess would be that the innerHtml isn't a complete copy of the code needed to fire the events.
Maybe clone the node instead?
Make sure your hidden div is inside the <asp:Form></asp:Form>
tag block.
there is much code.
Example is:
<div id='divHidden' style='display:none'> <div id='divcontentToShow'>
<!-- here is asp.net button -->
<asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" />
</div> </div>
So, btnSubmit_Click event on the server doesn't fire when content of divcontentToShow copied to other div neither by appendChild nor innerHTML way.
精彩评论