Hello Donthi
Here is the code sample for your problem, but in C# and ASP.Net
suppose your template is as below
<table>
<tr>
<td>
<strong>Dear **FullName**</strong>
</td>
</tr>
</table>
in the file Template.html
Now you want to show this template on another page Default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div runat="server" id="dv">
</div>
</form>
</body>
</html>
on the code behind page write the following code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string filetoread = string.Empty;
filetoread = Server.MapPath("~/Template.html");
StreamReader filestream = (StreamReader)File.OpenText(filetoread);
if (filestream != null)
{
string ReadContents = filestream.ReadToEnd();
filestream.Close();
string FinalDoc = ReadContents.Replace("**FullName**", "Rajneesh");
}
dv.InnerText = FinalDoc ;
}
}
}
this is just an example. hope it would help you to solve your problem.