i have some textboxes.. when \'preview\' button is clicked it goes to another page which contains an html template.. i need to replace the textbox entered values inside the temp
try this out
FileStream fs = new FileStream(**TemplateFileNamegoesHere**,FileMode.Open);
StreamReader fr = new StreamReader(fs);
string data = fr.ReadToEnd();
string data=data.Replace(" [mg-from]", txtfrom.text );
it will replace the "[mg-from]" to given txtfrom.text value try and let me know
public partial class EmployeePortal_CommunicationPreview : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.IO.FileStream fs = new FileStream("~/Auto-Emails/Internalcommunication.htm", FileMode.Open);
StreamReader fr = new StreamReader(fs);
string data = fr.ReadToEnd();
string from = data.Replace(" [mg-from]", txtfrom.text);
}
}
here the txtfrom.text belongs to the first page... i need to pass the txtfrom of the first page to the second page replacing [mg-from]... how will i do ??