[RESOLVED] Response.Redirect() into IFRAME
I have a url string being built based on some dropdownlist values the user picks. When they pick the final dropdownlist value, I have it set to redirect to that url, however I want it to load the page in an IFRAME i have on the page. I know I need to tell it the TARGET, but I'm not sure how to do this without an href link. Here's my code thus far:
VB Code:
Private Sub ddlForm_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ddlForm.SelectedIndexChanged
Dim sSection As String = ddlSection.SelectedItem.Text
Dim sForm As String = ddlForm.SelectedItem.Text
Dim sRedirectPage As String = "Section" & sSection & "/" & sForm & ".aspx"
Response.Redirect(sRedirectPage)
End Sub
I'm kinda stuck after this. Thanks!! :wave:
Re: Response.Redirect() into IFRAME
Use Page.RegisterStartupScript to change the IFRAME's location...
The javascript you need is
frames['myiframename'].location.href = 'http://www.mendhak.com/';
Re: Response.Redirect() into IFRAME
ahhh i see. But I've searched for Page.RegisterStartupScript all over and cant' find what i'm looking for. Do I put Page.RegisterStartupScript in my page that CONTAINS the IFRAME, or the IFRAME itself?
Re: Response.Redirect() into IFRAME
Ahhhhh nevermind, i figured it out.
Thanks for the shove in the right direction Mendhak!