473,586 Members | 2,490 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="#E 7E7FF" BorderStyle="No ne" BorderWidth="1p x"
BackColor="Whit e" CellPadding="3" GridLines="Hori zontal">
<SelectedItemSt yle Font-Bold="True" BorderWidth="2p x"
ForeColor="#F7F 7F7" BorderStyle="So lid" BorderColor="Pu rple"
BackColor="#738 A9C"></SelectedItemSty le>
<HeaderTemplate >
</HeaderTemplate>
<AlternatingIte mStyle BackColor="#F7F 7F7"></AlternatingItem Style>
<FooterTemplate >
</FooterTemplate>
<ItemStyle ForeColor="#4A3 C8C" BorderColor="Tr ansparent"
BackColor="#E7E 7FF"></ItemStyle>
<ItemTemplate >
<asp:ImageButto n ID="imageBtn1" runat="server" CommandName=sel ect
ImageUrl='<%# DataBinder.Eval (Container.Data Item, "PhotoName" , path)
%>'>
</asp:ImageButton ><br>
<asp:Label ID="Imagebutton 1" runat="server" Text='<%#
DataBinder.Eval (Container.Data Item, "PhotoId") %>'>
</asp:Label>
<br>
<asp:CheckBox ID="select" Runat="server"> </asp:CheckBox>
<br>
<asp:DropDownLi st ID="size" Runat="server" AutoPostBack="T rue" >
<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:DropDownLis t>
<br>
<asp:Label ID="price" Runat="server"> </asp:Label>
</ItemTemplate>
<FooterStyle ForeColor="#4A3 C8C" BackColor="#B5C 7DE"></FooterStyle>
<HeaderStyle Font-Bold="True" ForeColor="#F7F 7F7"
BackColor="#4A3 C8C"></HeaderStyle>
</asp:datalist>


private void DataList1_Selec tedIndexChanged (object sender,
DataListCommand EventArgs e)
{
string ImageLink;
ImageLink= ds.Tables[0].DefaultView[e.Item.ItemInde x].Row["photoname"].ToString();
Response.Redire ct("Pictures.as px?thisstring=" + ImageLink);
}
Nov 16 '05 #1
0 1605

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

Similar topics

4
5469
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
4563
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 anywhere other than through building a DataTable, and then doing a DataBind. Thanks. Mike
4
8284
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 = DataBinder.Eval(MyDatalist.Items(count).DataItem, "customerId") but it doesn't work.
0
1509
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 to in my Itemcommand event of the datalist. When I press a button on the datalist, that brings me into the Itemcommand event. I have access to...
1
1751
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 String Dim myDataListItem As DataListItem Dim myDatagridItem As DataGridItem Dim myCheckBox As CheckBox
5
13378
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 to get a Boolean value TRUE or FALSE when a checkBox is selected. When the checkBoxList was out of the DataList i used "OnSelectedIndexChanged"...
4
4033
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 work:( Thanks My CheckBoxList in the DataList Below
1
11941
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 dlSignIn_SelectedIndexChanged subroutine when I click the button in the datalist. And the dlSignIn.SelectedIndex property has the correct index for...
6
9573
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 only print the Parent Category once, regardless of how many child items are in it. So my perfect output would look something like:
1
1573
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 have a button on the page, where I want to read the contents of the datalist. As an example that I have found on MS...
0
7915
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8204
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7965
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5712
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5392
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1184
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.