This is a migrated thread and some comments may be shown as answers.

Loading html into right page

1 Answer 42 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Tooraj
Top achievements
Rank 1
Tooraj asked on 10 Aug 2012, 09:37 AM
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.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Aug 2012, 04:28 AM
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.
Tags
TreeView
Asked by
Tooraj
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or