How we provide the source dynamically for Iframe tag ?

Ranjeet_8
Posted by Ranjeet_8 under ASP.NET category on | Points: 40 | Views : 1589
Try this.
Write this code on ASPX

<div runat="server" id="Iframe">
</div>

Write this code on ASPX.CS
using System.Text; // Namespace


string URL = "http://www.dotnetfunda.com"; // Set your custom url.
StringBuilder sb = new StringBuilder();
sb.Append("<frameset cols='35%,80%'> ");
sb.Append("<iframe name='frame1' src='" + URL + "'> ");
sb.Append("</frameset> ");
Iframe.InnerHtml = sb.ToString();

Comments or Responses

Login to post response