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

dropdown list

Hi

in my web form i had dropdown list

control and using items property i;ve

added
"--- select Item-----"
0
1
upto 10 numbers.

i also placed required field

validator control for this drop down

list.

when am running my application, if

click on submit button with out

selecting any value in the list then

it is storing 0 value at back end.
how to prompt the user to select the
value from dropdown list.

can anyone tell me how to do this.

thanx in advance.
yoshitha
Nov 19 '05 #1
1 1633
Yoshita:
The following works:

<asp:ListBox ID="drop" Runat="server">
<asp:ListItem>0</asp:ListItem>
<asp:ListItem>1</asp:ListItem>
<asp:ListItem>2</asp:ListItem>
<asp:ListItem>3</asp:ListItem>
<asp:ListItem>4</asp:ListItem>
</asp:ListBox>
<asp:RequiredFieldValidator ID="reqDrop" Runat="server"
ControlToValidate="drop" ErrorMessage="*" />
<asp:button id="btn" Runat="server" />

You'd need to show us some code so we can help you.

HOWEVER. If you are doing this in Firefox (or another browser which isn't
IE), client-side validation isn't going to work. In you button's OnClick
event, you'll need to add

Page.Validate()
If Page.IsValide then
..do your normal stuff here
end if

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Yoshitha" <gu**********@rediffmail.com> wrote in message
news:O6**************@TK2MSFTNGP10.phx.gbl...
Hi

in my web form i had dropdown list

control and using items property i;ve

added
"--- select Item-----"
0
1
upto 10 numbers.

i also placed required field

validator control for this drop down

list.

when am running my application, if

click on submit button with out

selecting any value in the list then

it is storing 0 value at back end.
how to prompt the user to select the
value from dropdown list.

can anyone tell me how to do this.

thanx in advance.
yoshitha

Nov 19 '05 #2

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

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
4
by: Paul | last post by:
I have a dropdown list box and a button on a web form, the autopost back is false for the dropdown list box and button. When the button is pushed the selection in the dropdownlist box is lost,...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
5
by: jung_h_park | last post by:
From: jung_h_park@yahoo.com Newsgroups: microsoft.public.dotnet.framework.aspnet Subject: Dropdown List not retaining its SelectedValue Date: Mon, 26 Jun 2006 21:02:57 -0700 Hello, My...
3
by: er1 | last post by:
Hi all, I have created a double dropdown list. Based on the first list selection, second list populates (this works fine). I have a submit button, which when clicked should run a select query...
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
0
by: Andrus | last post by:
I'm using WinForms DataGridView I need to make dropdown list wider that grid column width. I tried the following code, but dropdown list widht is the same as column width. How to increase...
3
by: fish919 | last post by:
Hello All, I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box. You start with a dropdown list that has 5 choices and each of...
5
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.