Problem with iframe control
-
Hi In my webform(webform1.aspx), i have an iFrame control, along with with many web controls. The "src" attribute of it refers to another webform.(webform2.aspx) I want text to appear in the frame on clicking a button which fetches the value from db. Am using a session variable to hold the text to be assigned for iframe. And am using the following code in WebForm1.aspx
private void Button1_Click(object sender, System.EventArgs e) { Session["Cont"] = "This is a page"; HtmlGenericControl frame1 = (HtmlGenericControl)this.FindControl("txtFrame"); frame1.Attributes["src"] = "WebForm2.aspx"; Server.Execute("WebForm2.aspx"); Response.ClearContent(); }
And in WebForm2.aspx,Page_Load(..)if(Session["Cont"]!=null) { Literal1.Text = Session["Cont"].ToString(); }
The problem is when i click the button in WebForm1.aspx, along with actual text, a textbox with some characters is appearing in the iFrame though there's no other control in the target(Webform2.aspx) other than Literal control. :( Please help me in finding out the actual problem and its solution. Thanks~VSree