Hi everybody... I am trying to load the contents of one aspx page into div tag of another aspx page, i dont want to use jquery for it. can anybody please suggest me the server side solution to load the div tag dynamically on click of button.
T开发者_开发知识库hanks in advance
Just get the page it self and send it to the control
in HTML file
<div class="code">
<pre><asp:Literal id="litCode" runat="server /></pre>
</div>
in CS file
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
populate();
}
private void populate()
{
litCode.Text = getSoureCodeFromFile("http://localhost:21300/Search.aspx");
}
private string getSoureCodeFromFile(string url)
{
string r = "";
using (WebClient wc = new WebClient())
{
r = wc.DownloadString(url);
}
return r;
}
精彩评论