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

    Hi,
    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.

    ASPX:
    <div id="div1" runat="server">
    </div>

    C#:
    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.

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top