473,511 Members | 12,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with dropdownlist

8 New Member
hi,

I am new to this web site please help me with the bug i am getting. Here i have populated dropdownlist. i have to fill a particular item in ddl that is stored in sql 2000 database
Mar 11 '08 #1
7 1019
Markus
6,050 Recognized Expert Expert
hi,

I am new to this web site please help me with the bug i am getting. Here i have populated dropdownlist. i have to fill a particular item in ddl that is stored in sql 2000 database
Is this a problem with TSDN?
Mar 11 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
hi,

I am new to this web site please help me with the bug i am getting. Here i have populated dropdownlist. i have to fill a particular item in ddl that is stored in sql 2000 database
Which language?

Moved to the Misc. forum in the meantime.
Mar 11 '08 #3
looserash
8 New Member
hi,

actually here when i want to update my dropdownlist each time i have to select the item in dropdownlist otherwise it ll give an error if not selected. so can i write the code in c# even if i dont select it has to store null value in database and run without any error. help me with this. thanks
Mar 12 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
This will then be best answered in the .NET forum. Moved to .NET.
Mar 12 '08 #5
Frinavale
9,735 Recognized Expert Moderator Expert
hi,

actually here when i want to update my dropdownlist each time i have to select the item in dropdownlist otherwise it ll give an error if not selected. so can i write the code in c# even if i dont select it has to store null value in database and run without any error. help me with this. thanks
Set your DropDownList to AutoPostback...then you can check on the server if the value they've selected is invalid.

I'm not clear on what the problem is, could you please elaborate on what your program is supposed to do?

-Frinny
Mar 12 '08 #6
looserash
8 New Member
hi,

i have set it to auto postback.. here m able to place the item in the dropdownlist from the database during update event.my problem is here i want to select the dropdownlist each time if i don select it throws an error.. but i want it to update even if i don select the item in dropdownlist. please help me with this.

thank you.
Mar 13 '08 #7
Frinavale
9,735 Recognized Expert Moderator Expert
hi,

i have set it to auto postback.. here m able to place the item in the dropdownlist from the database during update event.my problem is here i want to select the dropdownlist each time if i don select it throws an error.. but i want it to update even if i don select the item in dropdownlist. please help me with this.

thank you.
Please post your code for populating (adding items to) your DropDownList.
I'm not sure if you're trying to programatically set the selected value, or if you are talking about letting the user select a value.

Are you trying to remember the value that the user selected?
Then after adding new values, resetting the selected value?

I still don't understand what you are trying to do.

To set the selected item programatically:
Expand|Select|Wrap|Line Numbers
  1. 'If you only know the value that should be selected:
  2. myDropDownList.Items.FindByValue("the value that should be selected").Selected = True
  3. 'If you know the index that should be selected:
  4. myDropDownList.Items(0).Selected = True
  5. '....
  6.  
You should probably also post the code for your AutoPostBack event (the Selected Index Changed event)

-Frinny
Mar 13 '08 #8

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

Similar topics

1
1970
by: Antonio D'Ottavio | last post by:
Good morning, I've a problem with a dropdownlist located inside any row of a datalist, I fill both datalist and dropdownlist at runtime, the problem is with the dropdownlist infact using the event...
2
2193
by: Olav Tollefsen | last post by:
I have a Web Form with a DataList. Inside the ItemTemplate, I have a DropDownList control. <asp:DataList ID="ProductDataList" Runat="server"> <ItemTemplate> <asp:DropDownList ID="DropDownList1"...
2
4534
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...
3
2007
by: Bas Paap | last post by:
I'm having a problem with formviews and DropDownLists in ASP.NET 2.0. I'm using a formview to insert an order into a database. Part of the order is the customer. Currently, I have a dropdownlist...
4
344
by: Savas Ates | last post by:
I have a datagrid control and in my edit item template tag I have ,
0
1457
by: ana_gil | last post by:
hello i have a problem with a dropdown list i am populating from an Access table. I´ve seen this problem in other discussions but i can´t seem to find the solution. please help. my .aspx has...
10
1526
by: Dan | last post by:
Hi, I create 5 dropdownlist in code-behind. I want to insert their selectedvalues in a table by making a string separated with ":" I can get their selecedvalues but i'm stuck when i want to...
4
8536
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
2
6925
by: pankajsingh5k | last post by:
Dear All, Please help me... I had read an article to lazy load a tab in a tabcontainer using an update panel on http://mattberseth.com/blog/2007/07/how_to_lazyload_tabpanels_with.html ...
6
4261
by: shashi shekhar singh | last post by:
Respected Sir, I have to create multiple dynamic dropdownlist boxes and add items dynamically in <asp:table> server control but problem occurs , i.e. except of fist dropdown list no dropdownlist...
0
7148
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
7367
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,...
1
7089
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
7517
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...
1
5072
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...
0
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
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
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
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.