|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to create HTML controls a runtimeI have an ASPX page that has a form. It has a button that when it is pressed, the submit is sent to the same page. The form is placed inside a DIV control. After the form is posted and the same page is reloaded, I need to place an IFRAME below the form because I have to load a whole page (dynamically determined) into the frame (that page may has PDF content type, that's why I need to use other frame). If I use Response.Write("<IFRAME....">, the frame is placed above all HTML tags, and obviously, it didn't work. I have read something about HTMTextWriter, but after a lot of tries (and without finding a good example), I still cannot render HTML tags dinamically placed where I want. I don't want to use FRAMESET, so any hint you can give me to achieve this will be very helpful. I'm using ASP.NET 2.0 Thanks Jaime Create a HtmlGenericControl and then add it into the server side control
hierarchy. This means you'll have to find some other control on the form to add it under, like the Form itself: HtmlGenericControl iframe = new HtmlGenericControl("IFRAME"); iframe.Attributes.Add(..., ...); Page.form1.Controls.Add(iframe); Or better yet, create the IFRAME as a server side control that's initially hidden, then make it visible as you need it. That might be an easier approach for you. -Brock DevelopMentor http://staff.develop.com/ballen Show quoteHide quote > Hi all.. > > I have an ASPX page that has a form. It has a button that when it is > pressed, the submit is sent to the same page. The form is placed > inside a DIV control. > > After the form is posted and the same page is reloaded, I need to > place an IFRAME below the form because I have to load a whole page > (dynamically determined) into the frame (that page may has PDF content > type, that's why I need to use other frame). > > If I use Response.Write("<IFRAME....">, the frame is placed above all > HTML tags, and obviously, it didn't work. > > I have read something about HTMTextWriter, but after a lot of tries > (and without finding a good example), I still cannot render HTML tags > dinamically placed where I want. > > I don't want to use FRAMESET, so any hint you can give me to achieve > this will be very helpful. > > I'm using ASP.NET 2.0 > > Thanks > Jaime Thanks brock for answering..
I have tested it. IFRAME is shown in the page but not where I want. I have this HTML structure: <FORM> <DIV> <TABLE> </TABLE> </DIV> </FORM> When I add the IFRAME it always starts from the top of the page, staying on the back of the form. If I could place it before the </DIV> element, it would be shown after the table. It seems that the DIV element isn't accesible by the server in order to add controls dynamically. I have tried a panel control and a placeholder control but without success. Finally, I tried to get the height of the form so that I could force he top position of the IFRAME, but without success either. How can I do it? According to your second suggestion. How can I create a server side IFRAME? I have just added an IFRAME tag using HTML view, but that way I cannot refresh the page that is intended to be shown in the frame. That's why I'm trying to create it dynamically in Page_Load event. thanks Jaime Show quoteHide quote "Brock Allen" wrote: > Create a HtmlGenericControl and then add it into the server side control > hierarchy. This means you'll have to find some other control on the form > to add it under, like the Form itself: > > HtmlGenericControl iframe = new HtmlGenericControl("IFRAME"); > iframe.Attributes.Add(..., ...); > Page.form1.Controls.Add(iframe); > > Or better yet, create the IFRAME as a server side control that's initially > hidden, then make it visible as you need it. That might be an easier approach > for you. > > -Brock > DevelopMentor > http://staff.develop.com/ballen > > > > > Hi all.. > > > > I have an ASPX page that has a form. It has a button that when it is > > pressed, the submit is sent to the same page. The form is placed > > inside a DIV control. > > > > After the form is posted and the same page is reloaded, I need to > > place an IFRAME below the form because I have to load a whole page > > (dynamically determined) into the frame (that page may has PDF content > > type, that's why I need to use other frame). > > > > If I use Response.Write("<IFRAME....">, the frame is placed above all > > HTML tags, and obviously, it didn't work. > > > > I have read something about HTMTextWriter, but after a lot of tries > > (and without finding a good example), I still cannot render HTML tags > > dinamically placed where I want. > > > > I don't want to use FRAMESET, so any hint you can give me to achieve > > this will be very helpful. > > > > I'm using ASP.NET 2.0 > > > > Thanks > > Jaime > > > >
CompareValidator Only Works On Manual Input
Which page load fires first? ASPX or ASCX? Base Page Design Question style width and height PropertyDescriptor in GetDataSource GridView EmptyDataTemplate Question Parsing nested Tags Bizarre - DataGrid inside HTML Table Left Side menu control 2.0 ascx on a 1.1 aspx? |
|||||||||||||||||||||||