Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 22nd, 2017, 01:57 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Ch. 4 Drop Down Lists

Hello and TIA:

I have an asp.net page with two drop down controls.

The page allows insertion of data and once the data is inserted comes back to the same page for the possibility of further data insertion

The first time I enter data using both drop down controls all is well.

Any succeeding iteration of inserting data into the page, the first drop down list continues to show all options, but the second shows no options. I must go back to my "main menu" and re-enter the insertion page in order for the second drop down control to be "re-populated."

I've looked for differences in how the two are set up as they "should be" similar, but have not been successful.

Any thoughts would be appreciated.

Thanks,
Cliff
 
Old February 22nd, 2017, 06:24 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Further clarification

I might add that the two drop down controls are completely independent of one another.
 
Old February 23rd, 2017, 12:59 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Further clarification #2

My DetailsView (where the two drop down boxes are located) is inside of a table.

After data Insertion or a Cancel command my page with table is re-drawn as smaller in horizontal size and I must reload the page in order for my table to be large enough (horizontally) to accommodate the second drop down box correctly. The rest of my page (outside table) is re-drawn correctly.

In essence, I must re-load the page from my menu in order to see my second drop down box and it's contents a second time. If my Insertion or Cancel re-draws the page rather than clicking on the menu item to re-load the page my table is a different (smaller) size.

Thanks
 
Old February 23rd, 2017, 01:33 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Further clarification #3

After an Insert or Cancel I'm just not re-connecting with the data source for the second drop down list. I must reload the page from my Main Menu.

Continued thanks, I'm getting there.
 
Old February 23rd, 2017, 05:22 PM
Authorized User
 
Join Date: Aug 2014
Posts: 34
Thanks: 3
Thanked 0 Times in 0 Posts
Default Figured it out

Hi all:

I apologize for taking up any of your time, but it has always helped me to talk it out, sometimes via text as to what my coding problem is.

After a good night's sleep and a heavy workout(to think) today, refreshed I solved my problem. Easy actually, of course after one has fixed things it always looks easy.

In my code behind file I merely added two Response.Redirect lines, one in my DetailsView1_ItemInserted method (at the end of the method) and one in my DetailsView1_ModeChanging method.

The first fixed by Insert button reload page issue to give me my DropDown list entries and the second fixed by issue for the Cancel button to also reload the page and thus reconnect with my DataSource for the DropDown list.

All is well,
Love all of Imar's books. I've read them all

Cliff





Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop down lists - selected value glevinw BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 April 9th, 2010 12:50 PM
Help with dynamic drop down lists MarkGT Classic ASP Basics 3 April 29th, 2008 06:05 PM
Linked Drop Down Lists contagiouss_blue Excel VBA 6 June 8th, 2005 09:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.