5

I want 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?

3 Answers 3

2

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

Sign up to request clarification or add additional context in comments.

Comments

1

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)

Comments

1

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.