Showing Tag: "asp" (Show all posts)

Can't access master page properties from content pages

Posted by jineesh uvantavida on Tuesday, October 24, 2017,
You can add the add this on your Content  page 

<%@ MasterType VirtualPath="~/Main.master"%>

and then simply use Master.YourPropertyName in code file or this.Master.YourPropertyName


Continue reading ...
 

How to only allow numbers in TextBox control in asp.net

Posted by jineesh uvantavida on Saturday, October 14, 2017, In : Tips & Ideas. 
You can simply use regular expression validator as

    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <asp:RegularExpressionValidator ID="RegularExpressionValidator1"
        ControlToValidate="TextBox1" runat="server"
        ErrorMessage="Only Numbers allowed"
        ValidationExpression="\d+">

    </asp:RegularExpressionValidator>

Also you can use the below regular expression to make the text-field as 12 digit number to be added.(madatory)

    ^[0-9]{12}$

Also you can make the field ...

Continue reading ...
 
 

Translate This Page

 


Make a free website with Yola