Code behind Partial Class _default Inherits System.Web.UI.Page Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then ‘character count If DataBinder.Eval(e.Row.DataItem, “description”).ToString.Length >= 175 Then e.Row.Cells(3).Text = + DataBinder.Eval(e.Row.DataItem, “description”).ToString.Substring(0, 175) + e.Row.Cells(3).ToolTip = DataBinder.Eval(e.Row.DataItem, “description”).ToString Else e.Row.Cells(3).Text = + DataBinder.Eval(e.Row.DataItem, “description”).ToString End If End If End Sub End Class
Archive for the 'characters' Tag
Count number of characters in textbox
Markup Page <strong>Required Info:</strong> <asp:Label ID=”TotCharReqInfo” runat=”server” ></asp:Label> <strong>Body Length:</strong> <span id=”BodyLength”>0 <strong>Total Length:</strong> <span id=”TotLength”> <asp:Label ID=”TotLengthLbl” runat=”server” ></asp:Label> <strong>Left:</strong> <span id=”CharLeft”> <asp:Label ID=”ChLeft” runat=”server” ></asp:Label> <asp:TextBox id=”txtInputOnln” runat=”server” TextMode=”MultiLine” Width=”300px” Height=”90px” MaxLength=”350″ onKeyUp=”Count(this,350)” onChange=”Count(this,350)”/> Click to read more… <script type=”text/javascript”> var ChLeftVar = “<%=CharLeftInt %>”; var ChLeftOut var ChLefVar2 function count(clientId) { var txtInputOnln = […]