Click here to Skip to main content
12,821,315 members (36,853 online)
Rate this:
Please Sign up or sign in to vote.
See more: ASP.NET IFrame

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 11:14am
Marcus Kramer 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 17-Jan-13 18:07pm
Marcus thanks for your reply, here is my code

<object id="myObj" type="text/html" data="" style="height:800px;width:800px;" />

Now I need to change the value for DATA element at server side in 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
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 %>" />                        

for the iFrame also you can use the same way to set the src.

also, here are some alternative ways[^][^]
mechary 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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2017
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