|
-
Apr 5th, 2005, 01:39 AM
#1
Thread Starter
Member
Redirecting a frame useing asp and/or javascript [Resolved]
I want to redirect an iframe (is called "main") in my page by useing a linkbutton in asp.net
When I click on the linkbutton the fuction test is called
Code:
private void test(object sender, System.EventArgs e)
{
Response.Write("<script>window.parent.main.location = 'http://google.be'</script>");
}
I also tryed
Response.Write("<script>_parent.location.replace('http://google.be')</script>");
Response.Write("<script>window.frames[“main”].location.replace('http://google.be')</script>");
Response.Write("<script>window.frames[“main”].location.href='http://google.be'</script>");
But non of the scripts seem to work
Last edited by Draven Chen Zhen; Apr 15th, 2005 at 01:27 AM.
-
Apr 5th, 2005, 01:50 AM
#2
Re: Redirecting a frame useing asp and/or javascript
Do it cilent-side.
Add the javascript
Code:
parent.framename.location.href='http://www.mendhak.com/';
Add it to the LinkButton's onclick event.
-
Apr 5th, 2005, 02:27 AM
#3
Thread Starter
Member
Re: Redirecting a frame useing asp and/or javascript
 Originally Posted by mendhak
Do it cilent-side.
Add the javascript
Code:
parent.framename.location.href='http://www.mendhak.com/';
Add it to the LinkButton's onclick event.
That would work, but I also need to make 2 sessions ... when I click the link
So I need to call on an event and redirect my Iframe
here is some code I've tried but also didn't work
Code:
string strRedirect;
strRedirect = "<script language='Javascript'>";
strRedirect += "parent.frames('main').location.href='http://google.be';";
strRedirect += "</script>";
Response.Write(strRedirect);
Response.Flush();
Response.Write("<script>window.main.location = 'http://google.be'</script>");
Response.Write("<script>window.open('../Plant/Plant.aspx','main');</script>");
-
Apr 5th, 2005, 04:18 AM
#4
Thread Starter
Member
Re: Redirecting a frame useing asp and/or javascript
nevermind I found a solution ... I call on a fuction in C# there I make my 2 sessions, next I redirect my page (index.aspx) back to index.aspx but I put a parameter in the url : index.aspx?Page=lala.aspx
And in my iframe the source becomes now src="<%= Request["Page"] %>"
E voila I redirect my Iframe
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|