p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=554)
-   -   Gig Pics(PhotoAlbum)- dropdownlist (http://p2p.wrox.com/showthread.php?t=88277)

EDGY August 18th, 2012 02:42 PM

Gig Pics(PhotoAlbum)- dropdownlist
 
Imar,
My GIG pics(PhotoAlbum/default) displays my top dropdownlist selection immediately. I'd like it to display nothing initiallly, like your example/final.

Where should i look, i've been doing comparisons, but jusr can't find it.
i guess im gonna need to read the whole book again..to master it..

Thanks Imar,
Edgy Eddie
(hey Imar do you like early Genisis or early King Crimson)

Nope, that wasn't it.
What I'm inquiring about is for the dropdown list NOT to EXECUTE initially, when the(photoalbums/default.aspx) page opens/starts up and should display the Empty Template message. Which only happens initially on your example. I am aware of the appendDatabounditems option, I tried it and that wasn't it, it still loaded and displayed the first item in my list. Initially, I want the empty template option to execute.

Thanks Imar for your help and patience, Edgy Eddie (..too bad)

Well, I found the answer. There's nothing wrong with my code, its doing exactly as it should, I was looking at mine and thought i had something wrong and wanted to make it perfect, like yours, when i compared/tested them. Your initial album(id=1) in the drop downlist has no associated pics to display, thus it displays the empty message, as it should. My test data has no empty Album pics, and thats why i never get the empty item message. The page is designed to always show the first dropdownlistitem and its album pics.

So as Emily Litella(SNL/Gilda Radner) would say "oh,that's different,... Never Mind."
Thanks Imar,
Edgy Eddie from Mesquite

Imar August 20th, 2012 09:52 AM

Hi there,

You can add an empty item in Markup View and then set AppendDataBoundItems to true.

>> (hey Imar do you like early Genisis or early King Crimson)

Not really....

Imar

sophia August 20th, 2012 01:40 PM

Hi there,
you may try this as Imar has suggested

Code:

<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataTextField="Name" DataValueField="Id" AppendDataBoundItems="true">
        <asp:ListItem Value="">Select Album</asp:ListItem>
      </asp:DropDownList>

Hope it helps you


All times are GMT -4. The time now is 07:05 PM.

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