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

Dropdownlist items get empty on postback

In my page , i have 2 dropdowns . i am populating them through javascript and accessing them on button click. but the values of the dropdowns getting empty. can u suggest any solution?
Mar 12 '14 #1
1 1629
Frinavale
9,735 Expert Mod 8TB
You need to remember what your DropDownLists were populated with between server request/responses. You can use hidden fields if you just need to maintain the values between server requests for a particular page...or if you need to remember this between pages you could use cookies.


Once you have the information about what the DropDownLists were populated with you can repopulate them on page load (or ajax return).

-Frinny
Mar 14 '14 #2

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

Similar topics

3
by: Gandalf | last post by:
I wish to apply different styles to items in a DropDownList. However, any styles applied in the codebehind (using the ListItem.Addtributes property) do not get rendered. This is an old question but...
2
by: news.microsoft.com | last post by:
Hello, Here is the problem. I have created an array of list items and I am adding them to many DropDownList controls. --------------The Code ------------------- Dim liArray(5) As ListItem...
1
by: anandv81 | last post by:
Hi, I have a dropdownlist and a requiredfieldvalidator that checks if a value has been selected for the dropdownlist by the user. I am populating the ddl at runtime and adding two items (...
1
by: Joe Delphi | last post by:
Hi, I am trying to populate dropdownlist items from the results of a database query. My code looks like this: Private Sub PopulateSubByBox(ByVal DBConn As SqlConnection) Dim DBComm As New...
2
by: js | last post by:
hi, how to validate if dropdownlist value is empty? many thanks.
2
by: echan8 | last post by:
I have a dropdown list in a datagrid which I am dynamically adding items to with JavaScript. When I try to access the value of the dropdown list on postback, there is no value. The value is...
3
by: ssims | last post by:
For some reason my databound DropDownList will not populate. I've tried a variety of things...here's the latest. - I pulled a DropDownList on to the page. - Then I pulled a SqlDataAdapter and...
3
by: =?Utf-8?B?ZGVuIDIwMDU=?= | last post by:
Hi, Trouble in retaining values of dropdownlist, textboxes, and other controls when dropdownlist selectedindexchanged event is triggered, the controls are inside a user control and this user...
1
by: Anilsg | last post by:
Hi all, I have the DropDownList in the FormView,inside InsertTemplateField The data is binded in run time to it in codebehind page,FOr the First time the page is loaded the DropdownList is...
1
by: divya | last post by:
Hello, I used the below code to move selected items between two listboxes Left and Right:- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="TestPopup.aspx.cs" Inherits="TestPopup" %> ...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.