Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Control the position of a CustomValidator

Reply
Thread Tools

Control the position of a CustomValidator

 
 
Mr. X.
Guest
Posts: n/a
 
      09-22-2008
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


 
Reply With Quote
 
 
 
 
Norm
Guest
Posts: n/a
 
      09-22-2008
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;

}
 
Reply With Quote
 
 
 
 
Mr. X.
Guest
Posts: n/a
 
      09-23-2008
Thank you very much.

)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Client Validation (JavaScript) for CustomValidator Control avp ASP .Net 1 12-16-2005 04:05 PM
HOWTO: Dynamically Add CustomValidator Control To Validation Summary Dan Sikorsky ASP .Net 1 02-17-2005 07:34 PM
CustomValidator Control =?Utf-8?B?Vmk=?= ASP .Net 1 10-21-2004 04:20 AM
How to set position of a web control depending on other control's position at run-time? James Wong ASP .Net Web Controls 4 07-14-2004 10:24 AM
CustomValidator Control Jim Heavey ASP .Net 1 12-02-2003 03:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57