开发者

Calling a javascript function from a modal window in vb.net

开发者 https://www.devze.com 2023-03-29 21:04 出处:网络
I want开发者_如何学Go to calling a javascript function from a asp.net modal window using vb. The javascript function is to close the same modal window.

I want开发者_如何学Go to calling a javascript function from a asp.net modal window using vb. The javascript function is to close the same modal window.

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

I tried

Page.ClientScript.RegisterStartupScript  

but that does not work. How can I do that from vb.net code behind?


If you are looking to close a modal window, perhaps place a label on the aspx side, and then use a label with similar to:

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

HTH


You're actually on the exact right track.

You should find that you are able to call the described method by using something like this...

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


Maybe try using a web browser control and launching the page and function from that? Make the control not visible aswell.

0

精彩评论

暂无评论...
验证码 换一张
取 消