Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET IFrame
Hi,
 
I need to embed a web site url using Object tag. for this I need to use runat = 'server'.
It is throwing error to have a classid. How do I get the classid for a website url.
 
Is there any way that I can embed webside other than object. I tried with 'iframes' but the site inside iframes is always showing the homepage no matter what link I click in that page.
 
your help or ideas are welcome
Posted 17-Jan-13 10:14am
mechary130
Comments
Marcus Kramer at 17-Jan-13 17:01pm
   
Could you show us the code for the object tag in question? From your question the way it stands it is very difficult to make out what you really need.
mechary at 17-Jan-13 18:07pm
   
Marcus thanks for your reply, here is my code

<object id="myObj" type="text/html" data="http://www.xyz.com" style="height:800px;width:800px;" />

Now I need to change the value for DATA element at server side in c#.net. For this I'm trying to put runat="server" and getting error to have ProgId or ClassId. Not sure what would be the values for that. Any help/suggestion is appreciated. I dont want to use IFRAME for this.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Instead of setting object as a server side variable you can try as follows.
 
<object id="myObj" type="text/html" data="<%=url %>" style="height:800px;width:800px;" />
In here url is a server side variable.
 
some times you want to set the param fields also
<object id="myObj" type="text/html" data="<%=url %>" style="height:800px;width:800px;" 
                        width="900px" height="60">
                        <param name="movie" value="<%=url %>" />                        
                    </object>
 
for the iFrame also you can use the same way to set the src.
 
also, here are some alternative ways
http://forums.asp.net/t/1445587.aspx/1[^]
http://stackoverflow.com/questions/10907607/what-is-the-best-way-of-setting-the-src-of-an-iframe-from-a-codebehind-file-in-a[^]
  Permalink  
v2
Comments
mechary at 17-Jan-13 22:04pm
   
Thanks Tharaka, but when I'm using iframes, I'm not able to navigate
within iframes. Whatever the link I'm clicking in the webpage in URL,
it is always redirecting to home page. with OBJECT tag it is working
perfectly, so need to know how to use runat tag to access myObject
from codebehind? any idea? Thank you
Tharaka MTR at 17-Jan-13 22:16pm
   
just for the verification, instead of using runat tag, can't you use set the data variable from the server side as in my example?
mechary at 17-Jan-13 22:20pm
   
no actually I need to capture the url whatever the user navigating within the OBJECT.

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

  Print Answers RSS
0 OriginalGriff 318
1 Sergey Alexandrovich Kryukov 286
2 RyanDev 75
3 PhilLenoir 60
4 nv3 60
0 Sergey Alexandrovich Kryukov 6,691
1 OriginalGriff 6,119
2 CPallini 2,473
3 Richard MacCutchan 1,697
4 Abhinav S 1,560


Advertise | Privacy | Mobile
Web01 | 2.8.140821.2 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100