Control the position of a CustomValidator

Discussion in 'ASP .Net' started by Mr. X., Sep 22, 2008.

  1. Mr. X.

    Mr. X. Guest

    Hello.

    How can I control the position of customValidator.

    I have code like this (ASP.NET)
    <asp:CustomValidator dir = "rtl" CHARSET=WINDOWS-1255"
    id = "email_err"
    ControlToValidate="a_email"
    OnServerValidate="checkEmail"
    Text="..."
    ErrorMessage="..."
    runat="server" />

    in CSS I have declared :

    #email_err
    {
    position: absolute;
    top:290px;
    left:230px;
    width:220px;
    visibility:visible;
    font-size:16pt;
    font-weight:bold;
    color:red;
    }

    But, I see that the customValidator's position is not at the position of
    CSS.

    I want a sample for that, please.

    Thanks :)
     
    Mr. X., Sep 22, 2008
    #1
    1. Advertising

  2. Mr. X.

    Norm Guest

    On Sep 22, 2:58 pm, "Mr. X." <no_spam_please@nospam_please.com> wrote:
    > Hello.
    >
    > How can I control the position of customValidator.
    >
    > I have code like this (ASP.NET)
    > <asp:CustomValidator dir = "rtl" CHARSET=WINDOWS-1255"
    >   id = "email_err"
    >   ControlToValidate="a_email"
    >   OnServerValidate="checkEmail"
    >   Text="..."
    >   ErrorMessage="..."
    > runat="server" />
    >
    > in CSS I have declared :
    >
    > #email_err
    > {
    >   position: absolute;
    >   top:290px;
    >   left:230px;
    >   width:220px;
    >   visibility:visible;
    >   font-size:16pt;
    >   font-weight:bold;
    >   color:red;
    >
    > }
    >
    > But, I see that the customValidator's position is not at the position of
    > CSS.
    >
    > I want a sample for that, please.
    >
    > Thanks :)


    The client id of the custom validator is most likely not "email_err".
    The ids of server controls are determined not only by their id, but by
    all of their parent's ids. "View Source" on your page to see the
    actual id. However, a better solution is to just use a css class
    instead of id. Try this:

    I have code like this (ASP.NET)
    <asp:CustomValidator dir = "rtl" CHARSET=WINDOWS-1255"
    id = "email_err"
    ControlToValidate="a_email"
    OnServerValidate="checkEmail"
    Text="..."
    ErrorMessage="..."
    CssClass="email_err"
    runat="server" />

    in CSS I have declared :

    ..email_err
    {
    position: absolute;
    top:290px;
    left:230px;
    width:220px;
    visibility:visible;
    font-size:16pt;
    font-weight:bold;
    color:red;

    }
     
    Norm, Sep 22, 2008
    #2
    1. Advertising

  3. Mr. X.

    Mr. X. Guest

    Thank you very much.

    :eek:)
     
    Mr. X., Sep 23, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jim Heavey

    CustomValidator Control

    Jim Heavey, Dec 2, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    347
  2. =?Utf-8?B?Vmk=?=

    CustomValidator Control

    =?Utf-8?B?Vmk=?=, Oct 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    362
    Scott Allen
    Oct 21, 2004
  3. Dan Sikorsky
    Replies:
    1
    Views:
    5,859
    Dan Sikorsky
    Feb 17, 2005
  4. avp
    Replies:
    1
    Views:
    21,675
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    Dec 16, 2005
  5. James Wong
    Replies:
    4
    Views:
    500
    James Wong
    Jul 14, 2004
Loading...

Share This Page