Call javascript function from modal window in vb.net

I want to call a javascript function from an asp.net modal window using vb. The javascript function is to close the same modal window.

The function I want to call: function CloseModalWindow(winName)

I tried

Page.ClientScript.RegisterStartupScript  

but that will not work. How can I do this from vb.net code?

+5
source share
3 answers

You are actually on the right track.

You should find that you can call the method described using something like this ...

ClientScript.RegisterStartupScript(Me.GetType, Guid.NewGuid().ToString(), "window.parent.CloseModalWindow('WindowName');", True)
+1
source

If you want to close the modal window, perhaps put a shortcut on the aspx side and then use a label similar to:

<a href="javascript:CloseModalWindow('ThisWindow')"><asp:Label runat="server" Text="Close Me"></Label></a>  

NTN

+2
source

, - ? , .

+1

All Articles