473,498 Members | 1,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation of multiple dropdowns in .Net4

1 New Member
This is making me crazy! I have validated hundreds of forms during my career, but this won't work no matter what I try!

I have 5 dropdownlists populated via sql database that only appear in a GridView row, when it is selected. On each I have added <asp:ListItem Text="Select.." Value="0" /> and AppendDataBoundItems="true".

I also have events on SelectedIndexChanged and DataBinding therefore during validation what is happening is if one dropdown has not been selected, I lose the values selected from all the others when I prompt the user to select a value.

I have posted code in a few Microsoft forums and been given a lot of advice, all of which I have tried and none have worked.

I would like to use the built-in validation, but I have also tried client side with JavaScript. I have tried saving the correct values to Session["variable"] but each time the user (me) selects a valid value from a dropdown, the page performs a postback and loses the values from the others.

I am desperate as tomorrow is the deadline and this is the only part of the Web App not working! Please help!
May 19 '11 #1
1 1438
Frinavale
9,735 Recognized Expert Moderator Expert
Wait, why are you losing the other selected values??
These should be stored in ViewState...

Why are you having this problem?

Edit: oh it's because of the binding.

I use the Page PreRender event to reset any values that need to be set....the Page PreRender is the last time you have access to controls before they are rendered into HTML and sent to the browser. It occurs after all other events have happened so you know that whatever you do here will not be reset.
May 30 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

17
8257
by: Phil Powell | last post by:
Where can I find an online PHP form validator script library to use? I have tried hacking the one here at work for weeks now and it's getting more and more impossible to customize, especially now...
2
4001
by: MOHAMMED AZEEMUDDIN | last post by:
Hi, I''m looking for someone to help me out in ASP. I''ve 3 to 4 or more combo boxes. On the change event of the combo boxes I want to fill the values. Suppose I change the value in combobox1 the...
3
1565
by: Damon | last post by:
I am working on a site in which I would like to have two dropdowns that will allow a user to navigate through the administrative pages of the site. The first would allow the user to choose the...
1
1454
by: Andy | last post by:
What I want to do is to populate multiple dropdowns when editing. Presumably... a) I should use a DataReader so that I can get each ResultSet for each dropdown control, and that should cut down...
1
1125
by: NuCoder | last post by:
I have a web page that has 4 drop downs for the user to filter a search on. They can either select one or all four to do a search, how can I determing which drop down was selected to do a search or...
4
7238
by: jedimasta | last post by:
Good evening all, I'm a relatively new to javascript, but I've been working with ColdFusion and PHP for years so I'm not necessarily ignorant, just stuck and frustrated. Using ColdFusion I'm...
7
1380
by: chhatra | last post by:
I have 8 dropdowns to be filled from database . To avoid roundtrips to the database what i should use?
0
2642
by: tanish2k | last post by:
hi. I am using c#, visual studio 2003. I need to validate a xml file against schema which itself has 2 more schema imported under it. i have following 2 xsd files : xsd1 --->...
1
2154
by: beary | last post by:
I need to populate a textarea from drop down box. There are a few "solutions" out there, but they seem to remove the first choice from the textarea when a second selection is made. So I need... 1)...
0
1709
by: kalinda | last post by:
I am trying to make multiple joins between two tables and am at a loss. I've tried a variety of things with this being the latest, but it pulls all records multiple times. Basically I have a main...
1
6887
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7379
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5462
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
4590
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3093
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1419
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
656
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
291
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.