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);
}