string td = "<asp:TextBox runat='server' ID='Tb_Name' Text=''></asp:TextBox>";str = str.Replace("Tb_Name",td);
怎么实现,上面的是个大概?

解决方案 »

  1.   

    如果是特定的字符换成其他,直接Repalce即可否则,考虑下正则
      

  2.   

    <asp:TextBox runat='server' ID='Tb_Name' Text=''></asp:TextBox>这一类标签在asp.net render阶段会绘成 <input /> 标签一般的做法是 TextBox txtBox = new TextBox();someObj.AddChild(txtBox);
    大致如此吧
      

  3.   

    你想要换成什么?假如确定的话,使用
    string td = "<asp:TextBox runat='server' ID='Tb_Name' Text=''></asp:TextBox>";string str = td.Replace("Tb_Name", "*");*号就是要换成的字符
    假如不确定的话,考虑将值传给变量,然后进行替换!
      

  4.   


    str = str.Replace("Tb_Name",td);
     td就是个文本框。