asp.net - replace texbox values inside an html template -


i have textboxes.. when 'preview' button clicked goes page contains html template.. need replace textbox entered values inside template.. how code using asp.net? html template

<table width="450" border="0" cellspacing="0" cellpadding="0" class="bg" bgcolor="red"> <tr>                                                 <td width="90" valign="top" class="bg" bgcolor="#ffffff">         <h2 style="width: 642px">&nbsp;&nbsp;&nbsp;&nbsp;<i><font color="#333333" face="geneva, arial" size=2.5>from:</font>&nbsp;&nbsp;              [mg-from]<br/>         &nbsp;&nbsp;&nbsp;&nbsp;<font color="#333333" face="geneva, arial" size=2.5>to:</font>&nbsp;&nbsp;&nbsp;&nbsp;              [mg-to]<br/>         &nbsp;&nbsp;&nbsp;&nbsp;<font color="#333333" face="geneva, arial" size=2.5>subject:</font>              [mg-subject]</i></h2>     </td> </tr> </table> 

i need replace [mg-from] in html template txtfrom.text value given in first page how code using asp.net?

try 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 replace "[mg-from]" given txtfrom.text value try , let me know


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -