473,402 Members | 2,046 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

RequiredFieldValidator showing an image

Hi.
I want to show an image in a requiredfield validator instead of "*".
So, I 'm set the requiredfieldvalidator attributes like following:

<asp:RequiredFieldValidator id=rfvFirstName
ControlToValidate="AddressName"
Display="Dynamic"
ErrorMessage="First Name Is Required"
Runat="server"
CssClass="AlertText"
EnableClientScript="True"
ValidationGroup="AddressManager">
<img src="../../Images/img_miss.gif" />
</asp:RequiredFieldValidator>

But always show the "*".
What can I doing wrong?

Thanks
Fernando Lopes
Nov 19 '05 #1
5 3222
Fernando,

The text property should be set to your image source. I don't know a
lot about CSS but if your "AlertText" CSS class has text in it, that
would probably override the image source in the text property. Try
removing the CSS class attribute and changing the text property to your
image. Also, I was unable to find a Validation Group property when
looking at the RequiredFieldValidator control. Am I missing something?

Corey

Nov 19 '05 #2
This works fine for me. The version of the framework I am using is 1.1. The
tag I tested is below.
<asp:RequiredFieldValidator id="rfvFirstName"
ControlToValidate="txtDiscussionNote" Display="Dynamic" ErrorMessage="First
Name Is Required"
Runat="server" CssClass="AlertText" EnableClientScript="True"
validationgroup="sdfasd">
<img src="Images/FMSLogo.gif" />
</asp:RequiredFieldValidator>
May be you can post html portion of your aspx page for someone to help you
out.
--
Gopal Rangaswamy
Microsoft Certified Solutions Developer
FMS, Inc.
<http://www.fmsinc.com/consulting>
<http://www.fmsinc.com/dotnet/SourceBook/>

"Fernando Lopes" <fe*******@remove.terra.com.br> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
Hi.
I want to show an image in a requiredfield validator instead of "*".
So, I 'm set the requiredfieldvalidator attributes like following:

<asp:RequiredFieldValidator id=rfvFirstName
ControlToValidate="AddressName"
Display="Dynamic"
ErrorMessage="First Name Is Required"
Runat="server"
CssClass="AlertText"
EnableClientScript="True"
ValidationGroup="AddressManager">
<img src="../../Images/img_miss.gif" />
</asp:RequiredFieldValidator>

But always show the "*".
What can I doing wrong?

Thanks
Fernando Lopes

Nov 19 '05 #3
Hi Corey.
I tried what did you said, but it doesn't work.
I putted this:
<asp:RequiredFieldValidator id=RequiredFieldValidator1
runat="server"
ErrorMessage="RequiredFieldValidator"
controltovalidate="AddressPrefix">
<img src="../../Images/arrow_validation.gif" />
</asp:RequiredFieldValidator>

In true, I was setting the Text attribute. In html source, the Text attribute is anything write inside control tags.
So, in design view, I'm set the Text attribute correctly.

Thansk again.
Fernando Lopes
"Corey" <co**************@citigroup.com> wrote in message news:11**********************@z14g2000cwz.googlegr oups.com...
Fernando,

The text property should be set to your image source. I don't know a
lot about CSS but if your "AlertText" CSS class has text in it, that
would probably override the image source in the text property. Try
removing the CSS class attribute and changing the text property to your
image. Also, I was unable to find a Validation Group property when
looking at the RequiredFieldValidator control. Am I missing something?

Corey

Nov 19 '05 #4
Okay Gopal!
Maybe the problem is my framework.
I'm using 2.2.
Probably is it.
Is there any asp.net 2.0 newsgroup? Do you know anyone?
But, if it helps, see my html code below:

<table class="nb bkg2" width="100%">

<tr>

<td nowrap="nowrap" colspan="4">

<asp:Button id="NewAddress" runat="server" width="150px"
onclick="NewAddress_Click" skinid="new"></asp:Button>

<asp:Button id="EditAddress" runat="server" width="150px"
onclick="EditAddress_Click" enabled="False"></asp:Button>

<asp:Button id="DeleteAddress" runat="server" width="150px" enabled="False"
onclick="DeleteAddress_Click" skinid="del"></asp:Button>

<asp:Button id="SetPrimaryAddress" runat="server" width="150px"
enabled="False" onclick="SetPrimaryAddress_Click"></asp:Button>

</td>

</tr>

<tr>

<td nowrap="nowrap" colspan="4">

<asp:GridView id="GridAddresses" runat="server" width="100%"
autogeneratecolumns="False" pagesize="1" datakeynames="AddressID"
onselectedindexchanged="GridAddresses_SelectedInde xChanged"></asp:GridView>

<ucg:PagingControl id="PC1" runat="server" visible="false"
onpagingcontrolnavigation="PC1_PagingControlNaviga tion" />

</td>

</tr>

<tr>

<td nowrap="nowrap" colspan="4">

<table class="nb bkg2" width="100%">

<tr>

<td nowrap="nowrap"><asp:label id="lbl_Country" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap"><UCPU:combocountries id="Country" runat="server"
autopostback="true" width="200"
oncombocountryindexchanged="Country_SelectedIndexC hanged"
combocountriesvalidation="true"
combocountriesvalidationgroup="AddressManager" /></td>

<td nowrap="nowrap"><asp:label id="lbl_PostalCode" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap">

<UCG:maskededitcontrol id="PostalCode" runat="server" datatype="Alfanumeric"
width="185" mask="#####-###" controlname="PostalCode"/>

<asp:button id="ValidateZipCode" runat="server" width="18px" height="18px"
/>

</td>

</tr>

<tr>

<td nowrap="nowrap"><asp:label id="lbl_State" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap"><UCPU:combostates id="State" runat="server"
autopostback="true" width="200"
oncombostateindexchanged="State_SelectedIndexChang ed"
combostatesvalidation="true" combostatesvalidationgroup="AddressManager"
/></td>

<td nowrap="nowrap"><asp:label id="lbl_Perimeter" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap"><UCPU:comboperimeters id="Perimeter" runat="server"
autopostback="true" width="213" comboperimetersvalidation="false" /></td>

</tr>

<tr>

<td nowrap="nowrap"><asp:label id="lbl_City" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap">

<CCS:PickListCall id="PickListCall1" runat="server" picklistcallwidth="185"
onpicklistcallbuttonclick="PickListCallClick"
picklistcallpage="PickListCityPage" picklistdestinyview="CityPickList" />

<asp:RequiredFieldValidator id="rfvFirstName"
ControlToValidate="AddressName" Display="Dynamic"

ErrorMessage="First Name Is Required" Runat="server" CssClass="AlertText"
EnableClientScript="True"

validationgroup="AddressManager"><img src="../../Images/img_miss.gif"
/></asp:RequiredFieldValidator>

</td>

<td nowrap="nowrap"><asp:label id="lbl_TimeZone" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap">

<UCPU:combotimezones id="SimplectTimeZone" runat="server"
autopostback="false"

width="213" combotimezonesautopostback="false"
combotimezonevalidation="true"

combotimezonevalidationgroup="AddressManager" />

</td>

</tr>

</table>

<...>

Thanks.
Fernando

"Gopal (FMS, Inc.)" <go**********@fmsinc.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
This works fine for me. The version of the framework I am using is 1.1.
The
tag I tested is below.
<asp:RequiredFieldValidator id="rfvFirstName"
ControlToValidate="txtDiscussionNote" Display="Dynamic"
ErrorMessage="First
Name Is Required"
Runat="server" CssClass="AlertText" EnableClientScript="True"
validationgroup="sdfasd">
<img src="Images/FMSLogo.gif" />
</asp:RequiredFieldValidator>
May be you can post html portion of your aspx page for someone to help you
out.
--
Gopal Rangaswamy
Microsoft Certified Solutions Developer
FMS, Inc.
<http://www.fmsinc.com/consulting>
<http://www.fmsinc.com/dotnet/SourceBook/>

"Fernando Lopes" <fe*******@remove.terra.com.br> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
Hi.
I want to show an image in a requiredfield validator instead of "*".
So, I 'm set the requiredfieldvalidator attributes like following:

<asp:RequiredFieldValidator id=rfvFirstName
ControlToValidate="AddressName"
Display="Dynamic"
ErrorMessage="First Name Is Required"
Runat="server"
CssClass="AlertText"
EnableClientScript="True"
ValidationGroup="AddressManager">
<img src="../../Images/img_miss.gif" />
</asp:RequiredFieldValidator>

But always show the "*".
What can I doing wrong?

Thanks
Fernando Lopes


Nov 19 '05 #5
2.0 is still beta. You may search Visual Studio .Net 2005 newsgroups for
help...Good luck.
--
Gopal Rangaswamy
Microsoft Certified Solutions Developer
FMS, Inc.
<http://www.fmsinc.com/consulting>
<http://www.fmsinc.com/dotnet/SourceBook/>

"Fernando Lopes" <fe*******@remove.terra.com.br> wrote in message
news:OT****************@TK2MSFTNGP12.phx.gbl...
Okay Gopal!
Maybe the problem is my framework.
I'm using 2.2.
Probably is it.
Is there any asp.net 2.0 newsgroup? Do you know anyone?
But, if it helps, see my html code below:

<table class="nb bkg2" width="100%">

<tr>

<td nowrap="nowrap" colspan="4">

<asp:Button id="NewAddress" runat="server" width="150px"
onclick="NewAddress_Click" skinid="new"></asp:Button>

<asp:Button id="EditAddress" runat="server" width="150px"
onclick="EditAddress_Click" enabled="False"></asp:Button>

<asp:Button id="DeleteAddress" runat="server" width="150px" enabled="False" onclick="DeleteAddress_Click" skinid="del"></asp:Button>

<asp:Button id="SetPrimaryAddress" runat="server" width="150px"
enabled="False" onclick="SetPrimaryAddress_Click"></asp:Button>

</td>

</tr>

<tr>

<td nowrap="nowrap" colspan="4">

<asp:GridView id="GridAddresses" runat="server" width="100%"
autogeneratecolumns="False" pagesize="1" datakeynames="AddressID"
onselectedindexchanged="GridAddresses_SelectedInde xChanged"></asp:GridView>
<ucg:PagingControl id="PC1" runat="server" visible="false"
onpagingcontrolnavigation="PC1_PagingControlNaviga tion" />

</td>

</tr>

<tr>

<td nowrap="nowrap" colspan="4">

<table class="nb bkg2" width="100%">

<tr>

<td nowrap="nowrap"><asp:label id="lbl_Country" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap"><UCPU:combocountries id="Country" runat="server"
autopostback="true" width="200"
oncombocountryindexchanged="Country_SelectedIndexC hanged"
combocountriesvalidation="true"
combocountriesvalidationgroup="AddressManager" /></td>

<td nowrap="nowrap"><asp:label id="lbl_PostalCode" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap">

<UCG:maskededitcontrol id="PostalCode" runat="server" datatype="Alfanumeric" width="185" mask="#####-###" controlname="PostalCode"/>

<asp:button id="ValidateZipCode" runat="server" width="18px" height="18px"
/>

</td>

</tr>

<tr>

<td nowrap="nowrap"><asp:label id="lbl_State" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap"><UCPU:combostates id="State" runat="server"
autopostback="true" width="200"
oncombostateindexchanged="State_SelectedIndexChang ed"
combostatesvalidation="true" combostatesvalidationgroup="AddressManager"
/></td>

<td nowrap="nowrap"><asp:label id="lbl_Perimeter" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap"><UCPU:comboperimeters id="Perimeter" runat="server"
autopostback="true" width="213" comboperimetersvalidation="false" /></td>

</tr>

<tr>

<td nowrap="nowrap"><asp:label id="lbl_City" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap">

<CCS:PickListCall id="PickListCall1" runat="server" picklistcallwidth="185" onpicklistcallbuttonclick="PickListCallClick"
picklistcallpage="PickListCityPage" picklistdestinyview="CityPickList" />

<asp:RequiredFieldValidator id="rfvFirstName"
ControlToValidate="AddressName" Display="Dynamic"

ErrorMessage="First Name Is Required" Runat="server" CssClass="AlertText"
EnableClientScript="True"

validationgroup="AddressManager"><img src="../../Images/img_miss.gif"
/></asp:RequiredFieldValidator>

</td>

<td nowrap="nowrap"><asp:label id="lbl_TimeZone" runat="server"
skinid="bold"></asp:label></td>

<td nowrap="nowrap">

<UCPU:combotimezones id="SimplectTimeZone" runat="server"
autopostback="false"

width="213" combotimezonesautopostback="false"
combotimezonevalidation="true"

combotimezonevalidationgroup="AddressManager" />

</td>

</tr>

</table>

<...>

Thanks.
Fernando

"Gopal (FMS, Inc.)" <go**********@fmsinc.com> wrote in message
news:u3**************@TK2MSFTNGP12.phx.gbl...
This works fine for me. The version of the framework I am using is 1.1.
The
tag I tested is below.
<asp:RequiredFieldValidator id="rfvFirstName"
ControlToValidate="txtDiscussionNote" Display="Dynamic"
ErrorMessage="First
Name Is Required"
Runat="server" CssClass="AlertText" EnableClientScript="True"
validationgroup="sdfasd">
<img src="Images/FMSLogo.gif" />
</asp:RequiredFieldValidator>
May be you can post html portion of your aspx page for someone to help you out.
--
Gopal Rangaswamy
Microsoft Certified Solutions Developer
FMS, Inc.
<http://www.fmsinc.com/consulting>
<http://www.fmsinc.com/dotnet/SourceBook/>

"Fernando Lopes" <fe*******@remove.terra.com.br> wrote in message
news:uM**************@tk2msftngp13.phx.gbl...
Hi.
I want to show an image in a requiredfield validator instead of "*".
So, I 'm set the requiredfieldvalidator attributes like following:

<asp:RequiredFieldValidator id=rfvFirstName
ControlToValidate="AddressName"
Display="Dynamic"
ErrorMessage="First Name Is Required"
Runat="server"
CssClass="AlertText"
EnableClientScript="True"
ValidationGroup="AddressManager">
<img src="../../Images/img_miss.gif" />
</asp:RequiredFieldValidator>

But always show the "*".
What can I doing wrong?

Thanks
Fernando Lopes



Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: BK | last post by:
I'm having a really strange problem with and HtmlSelect server control (listbox) and a RequiredFieldValidator that I am trying to use to make sure that someone has items in the listbox. The way...
3
by: Vic | last post by:
Hi all. Is is possible to somehow connect a RequiredFieldValidator to an image, so instead of the RequiredFieldValidator's text, an image would appear? Thanks in advance.
0
by: Nicolas | last post by:
How can I have only one RequiredFieldValidator to control two TextBox webcontrols so that only one message is displayed <asp:Label id="lbl_UserName" runat="server"></asp:Label><br> <asp:TextBox...
3
by: me | last post by:
Is there any particular reason why a requiredfieldvalidator cant validate a listbox? I have bound the two together but the validator always returns false on isvalid and so does the Page, no matter...
7
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and...
4
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for...
4
by: Joe | last post by:
Hello, I have created a login page using dotnet. I am using requiredFieldValidator and noticed that the code works fine in IE but not in Netscape, Opera, Mozilla, Firefox, etc. For example...
8
by: Gabriella | last post by:
Hi, I have the CSS class below, and the image (pro.gif) is not showing on my page. It is showing ONLY where's some text in the div, but all I need is the image itself. ..pro {background-image:...
3
by: Sandeep Singh Sekhon | last post by:
I am developing an application in ASP.NET 1.1. on one page I allow the user to upload and delete the files to the server. When I delete the file, I physically delete the file from the location....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.