Home » Posts tagged "ASP.NET" (Page 5)

Archive for the 'ASP.NET' 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 = […]

ASP.NET Validator – validate one of the two values

Validate one of the two textbox values Markup page Please enter on of at least one contact point: <asp:CustomValidator ID=”ContactInfoAlert” runat=”server” ErrorMessage=”CustomValidator” OnServerValidate=”CustomValidator_ServerValidate”> </asp:CustomValidator> User email: <asp:TextBox ID=”EmailTbx” runat=”server” ToolTip=”Enter email.” > </asp:TextBox> User phone: <asp:TextBox ID=”PhoneTbx” runat=”server” ToolTip=”Enter phone number.” > </asp:TextBox> <asp:Button ID=”Btn1″ runat=”server” Text=”Next” CausesValidation=”true”/> Click to read more… Code-behind page Protected […]

List Directory Content with Bulleted List Hyperlink – VB.NET

Code Behind Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) ‘ make a reference to a directory Dim DirPath As New IO.DirectoryInfo(“C:\\My_Website\My_Folder”) Dim FCollect As IO.FileInfo() = DirPath.GetFiles() Dim FInfo As IO.FileInfo ‘list the names of all files in the specified directory For Each FInfo In FCollect ‘bind url to line item – […]