473,385 Members | 1,400 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,385 software developers and data experts.

Drop Down List control and RequiredValidator.InitialValue

hi
It should be easy but I can't make it work.
I have DropDownList. I set first with text and value "Select". Then I add
RequiredValidator and set it InitialValue to "Select" and I expect that the
validator will not allow this value to stay the same but.. Validator never
fires.
What is wrong?
Thank you,
Shimon.
Feb 2 '06 #1
4 3418
Sorry.
Problems was with validation groups.

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eB*************@TK2MSFTNGP15.phx.gbl...
hi
It should be easy but I can't make it work.
I have DropDownList. I set first with text and value "Select". Then I add
RequiredValidator and set it InitialValue to "Select" and I expect that
the validator will not allow this value to stay the same but.. Validator
never fires.
What is wrong?
Thank you,
Shimon.

Feb 2 '06 #2
Shimon when you say :- "I set first with text and value "Select". what do
you mean
Can you post what you are trying to do
This sample below works:-
<ASP:DropDownList id=DropDownList1 runat=server>
<asp:ListItem></asp:ListItem>
<asp:ListItem >12/01</asp:ListItem>
</ASP:DropDownList>

<asp:RequiredFieldValidator id="RequiredFieldValidator3"
ControlToValidate="DropDownList1"
ErrorMessage="Expiration Date. "
Display="Static"
InitialValue=""
Width="100%"
runat=server>
*
</asp:RequiredFieldValidator>
Hope that helps
Patrick

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eB*************@TK2MSFTNGP15.phx.gbl...
hi
It should be easy but I can't make it work.
I have DropDownList. I set first with text and value "Select". Then I add
RequiredValidator and set it InitialValue to "Select" and I expect that the validator will not allow this value to stay the same but.. Validator never
fires.
What is wrong?
Thank you,
Shimon.

Feb 2 '06 #3
My case is the same but the first item had text and value = "select". So
InitialValue property had to be select also.
Anyway I found the problem as I posted.
Shimon.
"Patrick.O.Ige" <na********@hotmail.com> wrote in message
news:uo**************@TK2MSFTNGP14.phx.gbl...
Shimon when you say :- "I set first with text and value "Select". what do
you mean
Can you post what you are trying to do
This sample below works:-
<ASP:DropDownList id=DropDownList1 runat=server>
<asp:ListItem></asp:ListItem>
<asp:ListItem >12/01</asp:ListItem>
</ASP:DropDownList>

<asp:RequiredFieldValidator id="RequiredFieldValidator3"
ControlToValidate="DropDownList1"
ErrorMessage="Expiration Date. "
Display="Static"
InitialValue=""
Width="100%"
runat=server>
*
</asp:RequiredFieldValidator>
Hope that helps
Patrick

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eB*************@TK2MSFTNGP15.phx.gbl...
hi
It should be easy but I can't make it work.
I have DropDownList. I set first with text and value "Select". Then I add
RequiredValidator and set it InitialValue to "Select" and I expect that

the
validator will not allow this value to stay the same but.. Validator
never
fires.
What is wrong?
Thank you,
Shimon.


Feb 3 '06 #4
No worries Shimon good you got that working
Patrick

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:ue**************@TK2MSFTNGP09.phx.gbl...
Sorry.
Problems was with validation groups.

"Shimon Sim" <sh**********@community.nospam> wrote in message
news:eB*************@TK2MSFTNGP15.phx.gbl...
hi
It should be easy but I can't make it work.
I have DropDownList. I set first with text and value "Select". Then I add RequiredValidator and set it InitialValue to "Select" and I expect that
the validator will not allow this value to stay the same but.. Validator
never fires.
What is wrong?
Thank you,
Shimon.


Feb 3 '06 #5

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

Similar topics

1
by: Dec | last post by:
Ok to simplify things I'll just give an example. This is pretty much what I want to do (minus the postcode): http://www.perrys.co.uk/usedcar?ID=F5J9BNNBMVK00DF I have relatively little...
2
by: -=Chris=- | last post by:
I'm developing a custom server control that will be rendering a form based on some input. I've tried creating custom validators in vb.net like so: Dim v1 as RequiredValidator = new...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
13
by: Leszek Taratuta | last post by:
Hello, I have several drop-down lists on my ASP.NET page. I need to keep data sources of these lists in Session State. What would be the most effective method to serialize this kind of data...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
8
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID,...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: jacbyrd | last post by:
I have created a user control that is a drop down list that pulls from my database. I then drop that control into a detailsview control on an insert item template. When I run the insert command,...
6
by: zacks | last post by:
I have an application I am developing that has a Combo Box that is intended to show a list of available tables in the selected DSN. I have put code in the control's DropDown event handler to clear...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.