CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_studio_2005 Tags:
Item Type: NewsGroup Date Entered: 10/12/2005 9:48:30 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 8 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
brandon1974
Asp.Net User
Checkbox List problem10/12/2005 9:48:30 PM

0/0

Hello everyone, I'm using VS 2005 Beta 2, VB.NET.

I have a page with a datalist, a panel, a check box list and a "save" button.

When the selected index of the datalist changes, the checkbox list is populated from a database, and pre-selected items are determined.

Everything is right with the world, until the "save" button gets clicked.

The checkbox list loses all of its values, and returns nothing, zilch, nada. None of the selected or non-selected items will be present to use elsewhere.

I know that selecting a value in the datalist causes a postback, and that clicking the "save" button is causing another postback, which is *probably* why my checkbox list is losing it's values.

Does the checkbox list need to be re-created from viewstate when the page is initalized? If so, can someone please point me to an example in VB.NET?  I can translate C# if needs be.

Thanks in advance for your time,
Brandon

gknierim
Asp.Net User
Re: Checkbox List problem10/13/2005 2:10:58 AM

0/0

Hi Brandon,

Are the ITEMS in the checkbox list created at runtime, or just the values for the items?

If the items for the list are created, you will need to make sure that EnableViewState is true for the checkboxlist. Also, make sure that you are not creating the checkboxlist items each time the page loads by placing the

if (!IsPostBack)

{

}

section in the Page_Load event.

Let me know if this helps!

Greg


"Providing software solutions for your world!"
Excellent .NET Hosting here!
brandon1974
Asp.Net User
Re: Checkbox List problem10/13/2005 2:47:18 AM

0/0

Hi Greg, thanks for your reply.

The check box list is populated from a Data reader when the selected index of a Data List is changed. Then the values for which items are checked is done by looping through another data reader.

I did set the EnableViewState attribute to true for the CheckboxList, and the CheckboxList is only populated during the SelectedIndexChanged event of the Data List, not during the Page Load.

Thanks,
Brandon
Armysniper
Asp.Net User
Re: Checkbox List problem10/14/2005 8:31:52 PM

0/0

Ensure that you do not have code in your Load that resets the values of the CheckedListBox. When you perform a selected index event, you are doing a post back. In your load code make sure you check for postbacks. If it is a postback dont do code that would initialize the page. Use the Page.IsPostBack property to check for it in your load code.

4 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Problem with UpdatePanel and CheckBoxList - asp.net_ajax.asp ... Problem with UpdatePanel and CheckBoxList, > ROOT > NEWSGROUP > Asp.Net Forum > ... I have users control which has two checkbox list and ChartFx ...
Nabble - Struts - User - Checkbox List Problem... Checkbox List Problem... Hi, In my form I have employee number, name, and roles, here employee number and name are text fields and roles is a...
Checkbox list control problem - ASP Free Checkbox list control problem- .NET Development. Visit ASP Free to discuss Checkbox list control problem ... Discuss Checkbox list control problem in the .NET ...
Checkbox List Problem... Checkbox List Problem... Narayana S. Thu, 17 Jul 2008 03:34:18 -0700 ... can any one please guide me to solve this problem. Checkbox List Problem... Narayana S ...
developerWorks: Message List - Problem with "check box" button Re: Problem with "check box" button. Re: Problem with "check box" button ... Re: Problem with "check box" button. Problem with "check box" button ...
checkbox problem Staff List. Login. Register. PHP Freaks Forums > PHP > PHP Help > Topic: checkbox problem ... Topic: checkbox problem (Read 113 times) 0 Members and 1 Guest ...
Check box problem! Try searching our database. Check box problem! Thread view: ... Firstly i have a check box that when UNselected i want Text1 to be greyed ...
developerWorks: Message List - Problem with CheckBox Group developerWorks: Message List - Problem with CheckBox Group. Re: Problem with CheckBox Group ... Problem with CheckBox Group. Re: Problem with CheckBox Group ...



 
All Times Are GMT