62,270
社区成员
发帖
与我相关
我的任务
分享<asp:TextBox ID="txtFeedRemark" onfocus="this.blur()" onclick="showbreakDownReason(this);" runat="server" Width="98%" TextMode="MultiLine" Rows="6" onkeyup="limitLength_Grid(this.value,150,'输入超长',this)" Text='<%#DataBinder.Eval(Container.DataItem, "WTBusiness_var_FeedBackRemarks ").ToString()%> '></asp:TextBox>protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType==DataControlRowType.DataRow)
{
e.Row.Cells[2].Text = "<i>" + e.Row.Cells[2].Text + "</i>";
// 也可以使用DataBinder.Eval取得相应Cell内的值
decimal boxOfficeTotal = (decimal)DataBinder.Eval(e.Row.DataItem,”BoxOfficeTotals”);
if(boxOfficeTotal > 20000)
e.Row.BackColor = System.Drawing.Color.Yellow;
}
} this.TextBox1.Text = "123123\r\n19310a";
前台:
<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine"></asp:TextBox>