Click here to Skip to main content
15,895,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi.
I m using master page file to implement my project where click at the links, the page will be displayed in the content holder.
Now i want to create new link where it will redirect to online web site.
Lets say,i linked it to codeproject.com,i want the code project page to be displayed inside the content holder.

Any ideas guys?
Posted

The content holder needs to be an iframe, then you can do this.
 
Share this answer
 
Comments
pwtc222 24-Aug-10 21:21pm    
Where do i find iframe?any tutorial suggestion?
Venkatesh Mookkan 24-Aug-10 22:51pm    
If he/she can place a IFrame why should we need a Content Holder in the first place?
pwtc222 25-Aug-10 0:11am    
i had been developing my project with content holder without knowing the exist of iframe function.
Ok,i got the iframe code here:
<iframe src="http://google.com"></iframe>

And the following back code:
C#
protected void Button1_Click(object sender, EventArgs e)
        {
            Response.Redirect("http://www.google.com/search?hl=en&q=" + TextBox1.Text.ToString() + "");  
        }

The back code runs as a new page in browser,where keyword entered in TextBox1 redirect to new google page to search for the keyword entered in TextBox1.

Now i want the back code function runs on the iframe,where the same function runs on the iframe.

Any ideas?
 
Share this answer
 
hello,

Try something like this

<iframe runat="server" id="iframe1" src=""></iframe>

.cs

C#
protected void Button1_Click(object sender, EventArgs e)
    {
        iframe1.Attributes.Add("src", "http://www.google.com/search?hl=en&q=" + TextBox1.Text + "");
    }
 
Share this answer
 
Comments
pwtc222 25-Aug-10 0:10am    
Hi Bryian,
It shows the following error when i use your code;
The name 'iframe1' does not exist in the current context

I even tried the code by opening in new page.
Bryian Tan 25-Aug-10 1:32am    
do you have <iframe runat="server" id="iframe1" src=""></iframe> on your .aspx page?
pwtc222 25-Aug-10 2:12am    
yes,i do have..i i tried placing the code at all part,inside/outside the
,,..but still the same..
am i missing some arguments?
or the i frame code should include asp tag?
Bryian Tan 25-Aug-10 19:45pm    
You don't need the asp tag. Try close the VS and re-open it again.
pwtc222 25-Aug-10 20:48pm    
Thanks dude..its working now.. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900