对标题文本框输入的字体加红   判断我写好了  在数据库有字段    如果 checked 就==1 否则==0
  
  怎么对字体加红啊 

解决方案 »

  1.   

    txtName.ForeColor=System.Drawing.Color.Red;
      

  2.   

    if(dr["check"].ToString()=="1")
       Label1.ForeColor = "red";
      

  3.   

    Dim LL As Label
    LL.ForeColor = Drawing.Color.Red
      

  4.   

    刚写错
    Label1.Attributes.Add("style", "color:red");
      

  5.   

    XXX.ForeColor=System.Drawing.Color.Red;
    前景色
      

  6.   

    XXX.ForeColor=System.Drawing.Color.Red;
      

  7.   

    Label1.Attributes.Add("style", "color:red");
      

  8.   

    例:
    <span  <%if(checked==1){%>style="color:red;"<%}%>>字体变红</span>
      

  9.   

    if(checked==1)
    {
      Response.Write("<input type=\"text\" style=\"color:#FF0000\" value=\"我是标题\"/>");
    }else
    {
     Response.Write("<input type=\"text\" value=\"我是标题\"/>");
    }
      

  10.   

    <input type="text" style="color:#FF0000" value="我是标题"/>
      

  11.   

    ForeColor  没有这个属性啊
      

  12.   

      前台<input id="newstitle" runat="server" type="text" />
      <asp:CheckBox ID="CheckBox1" runat="server" Text="加红" />
    后台:按钮里得  if (CheckBox1.Checked == true)
                {
                    pnewsmodel.Jiahong = 1;
                   
                }  点击按钮 如何使加红
      

  13.   

    如果是<input id="newstitle" runat="server" type="text" />
    的话就
    if (CheckBox1.Checked == true)
      {
      pnewsmodel.Jiahong = 1;
        newstitle..ForeColor=System.Drawing.Color.Red;
      }