开发者

how to dynamically load the aspx page in div tag ?

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;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜