473,612 Members | 2,331 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

nested datalist and link button

40 New Member
how to open datalist containing multiple images on click on link button in selectedIndexCh anged

Expand|Select|Wrap|Line Numbers
  1.   protected void SelectedIndexChanged(object sender, EventArgs e)
  2.     {
  3.  
  4.         dlEvntImages.Visible = true;
  5.         BLL_NewsAndEvents objNE = new BLL_NewsAndEvents();
  6.         objNE.title = dlEvents.DataKeys[dlEvents.SelectedIndex].ToString();
  7.         objNE.getImageDetails();
  8.         if (objNE.tests)
  9.         {
  10.             DataList dllEvntImages = (DataList)FindControl("dlEvntImages");
  11.  
  12.  
  13.  
  14.  
  15.             //Label lblMsg1 = (Label)FindControl("lblMsg");
  16.             Label lblMsg1 = (Label)dllEvntImages.FindControl("lblMsg");
  17.                 //(dlEvntImages.SelectedItem.FindControl("lblMsg"));
  18.             Label lblId1 = (Label)dllEvntImages.FindControl("lblId");
  19.             Label lblKey1 = (Label)dllEvntImages.FindControl("lblKey");
  20.             Image evntImage1 = (Image)dllEvntImages.FindControl("evntImage");
  21.             //lblMsg1.Visible = true;
  22.             lblId1.Text = objNE.Id.ToString();
  23.             lblKey1.Text = objNE.Key.ToString();
  24.             lblMsg1.Text = objNE.imgDesc.ToString();
  25.             evntImage1.ImageUrl = "~/ASHX/viewEvntImageHandler.ashx?Id=" + lblId1.Text + "&Key=" + lblKey1.Text;
  26.             objNE.Close();
  27.  
  28.  
  29.         }
  30.  

linkbutton is in a datalist.when i click on the link button another datalist should open containing the images
May 24 '10 #1
0 1039

Sign in to post your reply or Sign up for a free account.

Similar topics

2
3830
by: Mal P | last post by:
Hi there, I'm a J2EE fellow who (as usual) has been thrown in the deep end and have to learn a fair chunk of the .NET platform (VS, ADO, WebForms, C# etc) in roughly two days. I'm doing ok so far, but am wondering on a better way to do something... Basically, I have a form which has a few fields the user fills in. When submitted, the data is stored as a row in an SQL database table. Then, I have another page which lists all the rows...
1
3753
by: Dino Novak | last post by:
I have one datalist with another datalist in item template section. I can sucessfuly use link buttons with defined commandnames from first datalist. What do you have to do to enable link buttons from nested datalist ?
0
1677
by: Homa | last post by:
Hi, I have a nested DataList, say a datalist of customer (outer) and order (inner). for the inner DataList, I want to get the idCustomer in DataBinding time. How to I access to this information? parent.NamingContainer? Thanks for concern, Homa Wong
1
1777
by: Luis Esteban Valencia | last post by:
I have a datalist. This is the code. I have 2linkbuttons and it depends of a field to show one or the other. The IF clause is OK, but its showing me the links in BLACK not in blue! and they are like plain text not links. asp:DataList id="dlsolicitud" runat="server" Width="800px" GridLines="Both" CellPadding="4" BorderColor="#CC9966" BackColor="White" BorderStyle="None" BorderWidth="1px"> <SelectedItemStyle Font-Bold="True"...
3
1990
by: Derek | last post by:
I have a nested datalist with a dropdownlist. I need to capture the selectedvalue of the dropdownlist so I can update a database table. My question then is...how do I get the value from the nested datalist? Thanks for any help.
2
1499
by: Laura K | last post by:
I would like to create a nested datalist inside the selecteditemtemplate of a datalist. My hope is that when a user clicks on a link a set of child links is displayed. For example if the user clicks men's clothing he would get a list of sub categories like pants, shirts, shorts etc I have put together the following and I get the original datalist fine. When I try to get the sublist I get the following error: Object reference not set to...
1
1952
by: schapopa | last post by:
Hi, I have nested datalist and I have some events that work, but I cannot find out how to refresh child and parent datalist after executing events on the child datalist. My childdatalist is an user control. Thank you for your help Schapopa
1
2658
by: AJ | last post by:
Hi all, With the following code in mind : <asp:DataList ID="dlOne" DataKeyField="myField1" DataSource="<%# GetDataSource1()" Runat="server"> <ItemTemplate> Output Value Here! <asp:DataList ID="dlTwo" DataKeyField="myField2" DataSource="<%# GetDataSource2(?,?)" Runat="server">
3
8252
by: mroffey | last post by:
Hi everyone, I've been having this problem and I've searched high and low, but I can't seem to find the answer to what is probably a very simple solution. In a nutshell, I have a nested datalist, Parent and Child. In the child datalist, I need to get 1 of the values from the parent datalist. I've included the dataaccess code below, only for completeness.
0
1653
by: Brian Lowe | last post by:
I'm in a web page and I have hierarchical data so I'm using 2 nested DataList controls. DataList1 is using a data source with rows of , , and where MoreData is a list. DataList1 has an ItemTemplate with Literal controls for Name, ID and Status and a DataList control for MoreData. DataList2 is using MoreData where fields are , and .
0
8173
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8115
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8254
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8422
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7044
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6082
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5537
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4111
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.