Loading html into right page

2 posts, 0 answers
  1. Tooraj
    Tooraj avatar
    74 posts
    Member since:
    Aug 2010

    Posted 10 Aug 2012 Link to this post

    I want to load a html file into a div in right page (right side of treeview) in Code Behind using AJAX,
    Please help.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 13 Aug 2012 Link to this post

    Hi Tooraj,

    Try the following code snippet to load a html file to the div.

    <div id="div1" runat="server">

    div1.InnerHtml = GetFrameContent();
    private string GetFrameContent()
       string path = Server.MapPath("Your html file here");
       string content = System.IO.File.ReadAllText(path);
       return content;

    Hope this helps.

Back to Top