1

In my .aspx page I have a div element with the id of mainGameBattle.

In the .vb code behind, I need to check a variable and if the condition is met, I need to dynamically load another .aspx page into the div with jQuery like this:

.aspx

<div id="mainGameBattle" runat="server" style="border: none;"></div>

and code behind:

If String.IsNullOrEmpty(thisBattle.Group) Then

     //add dynamic jQuery load event to div element....
     //<script type='text/javascript'>
         //$('#mainGameBattle').load('http://mysamedomain.org/spaceArena.aspx?battleID=" & thisBattle.ID & "');"
     //</script> 

End If

Is there a way of doing this in vb.net?

thanks!

1 Answer 1

1

I think you need to use something like

ScriptManager.RegisterStartupScript(Me.Page, Me.Page.GetType(), New Guid().ToString(), "$('#mainGameBattle').load('http://example.com/spaceArena.aspx?battleID=" & thisBattle.ID & "');")

I may have used incorrect arguments though!

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

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.