replace texbox values inside an html template

前端 未结 2 1472
北恋
北恋 2021-01-29 12:42

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

2条回答
  •  抹茶落季
    2021-01-29 12:54

    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

提交回复
热议问题