473,508 Members | 2,475 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

access datalist items

I'm using a datalist to display a picture and a dropdownlist
associated to it.
When clicked the picture should display a larger picture ( this is
working fine). When the user has selected a picture he has to select a
value from the dropdownlist which corresponds to diferent sizes for
the picture. My question is: how can I get the value of the
dropdownlist?
Please, I really need some help.
Thanks
<asp:datalist id="DataList1" runat="server" RepeatColumns="4"
BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px"
BackColor="White" CellPadding="3" GridLines="Horizontal">
<SelectedItemStyle Font-Bold="True" BorderWidth="2px"
ForeColor="#F7F7F7" BorderStyle="Solid" BorderColor="Purple"
BackColor="#738A9C"></SelectedItemStyle>
<HeaderTemplate>
</HeaderTemplate>
<AlternatingItemStyle BackColor="#F7F7F7"></AlternatingItemStyle>
<FooterTemplate>
</FooterTemplate>
<ItemStyle ForeColor="#4A3C8C" BorderColor="Transparent"
BackColor="#E7E7FF"></ItemStyle>
<ItemTemplate>
<asp:ImageButton ID="imageBtn1" runat="server" CommandName=select
ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PhotoName", path)
%>'>
</asp:ImageButton><br>
<asp:Label ID="Imagebutton1" runat="server" Text='<%#
DataBinder.Eval(Container.DataItem, "PhotoId") %>'>
</asp:Label>
<br>
<asp:CheckBox ID="select" Runat="server"></asp:CheckBox>
<br>
<asp:DropDownList ID="size" Runat="server" AutoPostBack="True" >
<asp:ListItem Value="6''*4''">6''*4''</asp:ListItem>
<asp:ListItem Value="7''*5''">7''*5''</asp:ListItem>
<asp:ListItem Value="8''*6''">10''*8''</asp:ListItem>
</asp:DropDownList>
<br>
<asp:Label ID="price" Runat="server"></asp:Label>
</ItemTemplate>
<FooterStyle ForeColor="#4A3C8C" BackColor="#B5C7DE"></FooterStyle>
<HeaderStyle Font-Bold="True" ForeColor="#F7F7F7"
BackColor="#4A3C8C"></HeaderStyle>
</asp:datalist>


private void DataList1_SelectedIndexChanged(object sender,
DataListCommandEventArgs e)
{
string ImageLink;
ImageLink= ds.Tables[0].DefaultView[e.Item.ItemIndex].Row["photoname"].ToString();
Response.Redirect("Pictures.aspx?thisstring="+ ImageLink);
}
Nov 16 '05 #1
0 1599

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5463
by: Kaung Htut O via DotNetMonster.com | last post by:
Hi to all Is there a way to access Datalist Footer's Control properties from outside of datalist event. Pls note that I mean not a datagrid, only for datalist. Thanks Kaung Htut Oo
1
4549
by: Mike Malter | last post by:
I take it that the only way to add rows to a DataList control is through DataBind? If not, how do I manually add rows to a DataList control? I have searched everywhere and can't find an example...
4
8280
by: jenn | last post by:
Hi Anyone knows how to access to a value of a row in a datalist. Something like this in datagrid Dim str = MyDataGrid.Cell(0).tex I would like something like this Dim str =...
0
1501
by: bill yeager | last post by:
I have a datalist displaying parent information and a datagrid presenting child information. The data is being rendered just fine. The datagrid has template columns on it that I cannot gain access...
1
1742
by: bill yeager | last post by:
I did some more debugging and found the following: 1) I placed the following code in the button event just to see if I could cycle thru the datagrid control collection: <code> Dim strhello As...
5
13374
by: Patrick.O.Ige | last post by:
I'm binding a CheckBoxlist below in the ItemDataBound(the CheckBoxList is in a Datalist) By doing "li.Selected = True" i can see all the checkBoxes are selected. But what i want is to be able...
4
4029
by: Patrick.O.Ige | last post by:
I have a CheckBoxList in a DataList and i'm trying to get item Selected after doing a postBack. I have set my CheckBoxlist AutoPostBack="True" Any ideas what 'm doing wrong? It seems not to...
1
11933
by: Gary Frank | last post by:
I added a couple of labels and a button to a Datalist control called "dlSignIn" by adding them to the Item template. The labels are bound to a dataset column. Program code gets executed in the...
6
9560
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
1
1570
by: David | last post by:
Hi, This one appears a little strange to me. Here is the scenario. I load a datalist the first time a page is run. The page has a !IsPostback and the datalist gets loaded at this point. I...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
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
7336
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
7066
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
7504
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
5059
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
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3214
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.