Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4333888
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:27:14+00:00 2026-05-21T10:27:14+00:00

hii all this is my master page <%@ Master Language=C# AutoEventWireup=true CodeFile=OfficeApps.master.cs Inherits=master1 %>

  • 0

hii all
this is my master page

<%@ Master Language="C#" AutoEventWireup="true" CodeFile="OfficeApps.master.cs" Inherits="master1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head runat="server">
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  <link rel="Stylesheet" type="text/css" href="Styles/jquery-ui-1.8.1.custom.css" />
  <link rel="Stylesheet" type="text/css" href="Styles/ui.jqgrid.css" />
  <link rel="Stylesheet" type="text/css" href="Styles/ui.multiselect.css" />

  <script src="JS/jquery.js" type="text/javascript"></script>
  <script src="JS/jquery-1.3.1.min.js" type="text/javascript"></script>
  <script src="JS/hoverIntent.js" type="text/javascript"></script>
  <link href="Styles/MasterStyleSheet.css" rel="stylesheet" type="text/css" />
  <title></title>
  <asp:ContentPlaceHolder ID="head" runat="server">
  </asp:ContentPlaceHolder>
</head>

<body>

<form id="form1" runat="server">


<div>
    <table class="mastertable">
        <tr>
            <td class="masterheader">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">


                    <div class="logo">
                        <asp:Image ID="image2" class="logo1" src="Images/OfficeApps.png" runat="server" />
                    </div>
                    <div class="menubar">
                        <asp:Literal ID="Literal1" runat="server"></asp:Literal>
                    </div>
                </asp:ContentPlaceHolder>
            </td>
        </tr>

          <tr>
            <td class="mastercontent">

                <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
                </asp:ContentPlaceHolder>

              <div class="divbutpos">

    <asp:Button ID="Button1" runat="server" Text="LOGOUT" OnClick="Button1_Click" BackColor="#00CCFF"
        BorderStyle="None" Font-Bold="True" Font-Names="Verdana" Font-Underline="True"
        ForeColor="White" Style="cursor: hand" />
    <%-- <asp:ImageButton ID="ImageButton1"  CssClass="divbutpos" OnClick="Button1_Click" ImageUrl="~/Images/signout.JPG" runat="server" />--%>
   </div>

            </td>
        </tr>
         <tr>

            <td class="masterfooter">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server">
                </asp:ContentPlaceHolder>
            </td>
        </tr>

  </table>
</div>

the reason i posted my entire masterpage is that it has multiple contentplaceholders in a table format…..

my content page looks like this

<%@ Page Title="" Language="C#" MasterPageFile="~/OfficeApps.master" AutoEventWireup="true"
    CodeFile="UsersGrid.aspx.cs" Inherits="UsersGrid" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">

<div class = "scroll">

    <div id="searchbox" title="SearchBox" class="SearchBox">
        <div class="SearchBoxHeader">
            <h2 style="text-align: center; color: #2E6E9E;">
                SEARCH</h2>
        </div>

        <asp:Label ID="lbl_FilterStatus" runat="server">Status: </asp:Label>  <asp:DropDownList
            ID="dl_FilterStatus" runat="server">
            <asp:ListItem Value="1" Selected="True">Active</asp:ListItem>
            <asp:ListItem Value="0">InActive</asp:ListItem>
        </asp:DropDownList>
        <asp:Label ID="lbl_FilterUname" runat="server">Username: </asp:Label><asp:TextBox
            ID="tb_FilterUname" runat="server"></asp:TextBox>
        <asp:Label ID="lbl_FilterSname" runat="server">Shortname: </asp:Label><asp:TextBox
            ID="tb_FilterSname" runat="server"></asp:TextBox>
        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="Images/search_icon.gif"
            ImageAlign="AbsBottom" OnClientClick="return searchuser();" />
    </div>

<table id="usergrid">
</table>

<div id="pager1" style="text-align: center;">
</div>

</div>

<div class="divlblpos">
        <asp:Label CssClass="welcomelogo" ID="Label1" runat="server" Text="Welcome"></asp:Label>
        <asp:Label ID="Label2" runat="server" CssClass="welcomelogo"></asp:Label>
</div>
<asp:HiddenField ID="Hf_SelectedID" runat="server" />  


<div id="dialog" title="UserDetails" style="display: none;">

    <table  cellspacing="5px" cellpadding="10px">
        <tr>
            <td>
                <asp:Label ID="lbl_usrnm" CssClass="popuptxt" runat="server" Text="UserName"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="Tb_UserName" Height="15px" Font-Size="13px" runat="server"></asp:TextBox>
            </td>

         <td>
                <asp:Label ID="unameerror" runat="server" Text=""></asp:Label>
            </td>

        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_name" CssClass="popuptxt" runat="server" Text="Name"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="Tb_Name" Height="15px" Font-Size="13px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_shortnm" CssClass="popuptxt" runat="server" Text="ShortName"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="Tb_SName" Height="15px" Font-Size="13px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Admin" CssClass="popuptxt" runat="server" Text="IsAdmin"></asp:Label>
            </td>
            <td>
                <asp:CheckBox ID="Cb_Admin" Checked="false" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Active" CssClass="popuptxt" runat="server" Text="IsActive"></asp:Label>
            </td>
            <td>
                <asp:CheckBox ID="Cb_Active" Checked="false" runat="server" />
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Email" CssClass="popuptxt" runat="server" Text="Email"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="Tb_Email" Height="15px" Font-Size="13px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_phone" CssClass="popuptxt" runat="server" Text="Phone"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="Tb_Phone" Height="15px" Font-Size="13px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_mob" CssClass="popuptxt" runat="server" Text="Mobile"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="Tb_Mobile" Height="15px" Font-Size="13px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Depts" CssClass="popuptxt" runat="server" Text="Departments"></asp:Label>
            </td>
            <td>
                <asp:ListBox ID="Lb_Departments" Font-Size="13px" DataTextField="DepartmentName"
                    Width="154px" DataValueField="DepartmentID" runat="server" SelectionMode="Multiple">
                </asp:ListBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_App" CssClass="popuptxt" runat="server" Text="Applications"></asp:Label>
            </td>
            <td>
                <asp:ListBox ID="Lb_Applications" DataTextField="ApplicationName" Font-Size="13px"
                    Width="154px" DataValueField="ApplicationID" runat="server" SelectionMode="Multiple">
                </asp:ListBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Sup" CssClass="popuptxt" runat="server" Text="Supervisors"></asp:Label>
            </td>
            <td>
                <asp:ListBox ID="Lb_Supervisor" DataTextField="UserName" Font-Size="13px" Width="154px"
                    DataValueField="UserID" runat="server" SelectionMode="Multiple"></asp:ListBox>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="Lb_Success" Font-Size="10px" runat="server" Text=""></asp:Label>
            </td>
            <td>                    
                <asp:Button ID="Button_Edit" Width="150px" runat="server" Text="Edit" OnClientClick="return edituser();" />                    
            </td>
        </tr>
    </table>
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" runat="Server">
</asp:Content>

my problem is when i have to validate using the below code inside the contentplaceholder validation is not being done
the code is

<script type="text/javascript">


     $.validator.addMethod("regex",function(value, element, regexp) 
            {
                var check = false;
                var re = new RegExp(regexp);
             return this.optional(element) || re.test(value);
            },"<p style='color:red'>*Please check your input</p>");



        $(document).ready(function() {
            $("#aspnetForm").validate({
                rules: {
                    <%=Tb_UserName.UniqueID %>: {
                        minlength: 5,
                        required: true,
                     regex: "^[a-zA-Z0-9'.\\s\]{3,15}$" 

                    },
                    <%=Tb_Name.UniqueID %>: {
                        minlength: 5,
                        required: true,
                    regex: "^[a-zA-Z0-9'.\\s\]{3,15}$" 
                    },
                    <%=Tb_SName.UniqueID %>: {
                        required: true,
                    maxlength:4,
                    regex: "^[a-zA-Z0-9'.\\s\]{1,4}$" 
                    },
                    <%=Tb_Email.UniqueID %>: {
                     required: true,
                    regex:"^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$"
                    },
                    <%=Tb_Phone.UniqueID %>: {
                        minlength: 8,
                        maxlength: 8,
                        required: true,
                    regex:"^[0-9\s]{8}$"
                    },
                    <%=Tb_Mobile.UniqueID %>: {
                        minlength: 10,
                        maxlength:10,
                        required: true,
                        regex:"^[0-9\s]{10}$"
                    }
                }, 
                messages: {
                    <%=Tb_UserName.UniqueID %>:{ 
                        required: "Please Enter your username", 
                        minlength: "User name must be atleast of 5 characters" 
                    },
                     <%=Tb_Name.UniqueID %>:{ 
                        required: "Please Enter your name", 
                        minlength: "name must be atleast of 5 characters" 
                    },
                     <%=Tb_SName.UniqueID %>:{ 
                        required: "Please Enter your shortname", 
                      maxlength:"Shortname cant exceed 4 characters"
                    },
                     <%=Tb_Email.UniqueID %>:{ 
                        required: "Please Enter email", 

                    },
                    <%=Tb_Phone.UniqueID %>:{ 
                        required: "Please Enter phone", 
                      minlength:"phone number should have 8 digits",
                      maxlength:"phone number should have 8 digits only"
                    }, 

                <%=Tb_Mobile.UniqueID %>:{ 
                        required: "Please Entermobile number", 
                        minlength: "mobile number should have 10 digits"
                        maxlength:"mobile number should have 10 digits only"
                    }
                    }
            });
        });
    </script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:27:15+00:00Added an answer on May 21, 2026 at 10:27 am

    Why not use the asp.net validators, they do the same thing you’re trying to do, PLUS server side validation!

    • RegularExpressionValidator(can also be used for min and max length)
    • RequiredFieldValidator

    Server side validation is a must because javascript can always be disabled or modified by the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hii All, Aardvark < Zoroaster # return true I think, this is very basic.
Hi I have a plugin.dll which contains this all npp functions I have embeded
Hi i'm wondering how to redirect a http://mysite.com/pdf/blah.pdf to http://mysite.com/pages/page.aspx for all pdf file
hii all..i have some code that make all string characters which have been input
Hii, I m using a simple HTML Text editor by providig 'contentEditable' property of
hii i am using ajax file upload in this code <script type=text/javascript src=fileuploader.js></script> <script
the page in question is http://www.streetstyles4all.co.uk/test4.html (general menu drop down problem) Hi I have
Hii i have this code : $handle = popen(php -q nah.php -p=. '$part' .
Hii, I am creating a WPF aplication. My home page will look like the
Hii all... I have to work on a website and make it configure to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.