I have a link here that works perfect for calling the postback close that I need to happen:
<a href="javascript:parent.__doPostBack('Close','')"><asp:Label ID="Label5" runat="server" Text="Close Me"></asp:Label></a>
However, I would like to be able to call the *javascript:parent.__doPostBack(‘Close’,”)* method from the code-behind file rather than the user clicking the link. I.e., when I have completed my tasks in the application code, call parent.doPostBack as my last function call, which closes the window in question.
Any ideas how to call this client-side javascript method from the server side?
I think you’re looking for how to generate script to link to event handlers on the server (page). See these methods of
this.Page.ClientScript:Also, explore other methods of the page’s
ClientScriptproperty. There are some interesting ones beginning with “Register”.