Include Files Dynamically

Q

Quentin

Hey there !

I made my own WebControl, that inherits from WebControls, and i added an
HtmlTable to it. I would like to include a file, dynamically, to one of its
cells... I've already searched, and found
HttpContext.Current.Server.Execute("mapage.aspx") but it executes the page
where i call it, and not in the cell... i also tried something like that :
MyTable.Rows(0).Cell(0).InnerHtml = Server.Execute("MaPage.aspx") but it
doesn't work... Could anybody help me ?

Merci d'avance :)

Ps : Scuse my english i'm french.
 
Q

Quentin

I've also red the sound advices from Kevin Spencer... But how can i treat a
page as an object as to add it in my cell ?

thanks again...
 
Q

Quentin

I would have liked to display a page in an other page... I know the <iframe>
but it's in html... If you know the object.NET to make an iframe it would be
great :) Cuz you're right it could a solution for my problem, make an iframe
in my cell, and just change dynamically the src property...

Thanks for your quick response :)
 
B

Bjoern Wolfgardt

Ahhh,

So you want to add it in the code behind.
So you can use the HtmlGenericControl . Its some kind of dummy control.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/ht
ml/cpconhtmlgenericcontrol.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfSystemWebUIHtmlControlsHtmlGenericControlClassTopic.asp

My Example:
System.Web.UI.HtmlControls.HtmlGenericControl iframe = new
HtmlGenericControl("iframe");
iframe.Attributes.Add("src", "./yourpage.aspx");
iframe.Attributes.Add("width", "240px");
iframe.Attributes.Add("height", "200px");
iframe.Attributes.Add("frameborder", "0");
this.FindControl("Form1").Controls.Add(iframe);

Hope this helps
Bjoern Wolfgardt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top