Tuesday, June 03, 2008

How to use iFrames in Asp.net??

1. place your iframe tag where your want in body tag for ex
< iframe id="frame1" style="HEIGHT: 150px" border="0" name="frame1" align="middle" frameborder="no" width="100%" scrolling="no" runat="server">
2. Now, declare one Htmlgeneric control like thisprotected System.Web.UI.HtmlControls.HtmlGenericControl frame1;
3. At last ....HtmlControl
frame1 = (HtmlControl)this.FindControl("frame1");
frame1.Attributes["src"] ="target.aspx".ToString ();
write this in your application page load function.........