473,769 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Nested webcontrols from the same objectdatasourc e - Help needed

10 New Member
Hi, I am using these: ASP.Net 2.0, VB.Net, Visual Studio 2005, SQL Server 2005, Objectdatasourc e using DAL & BLL classes

My objectdatasourc e can produce below output by CategoryID parameter: (stored procedure: GetProductsByCa tegoryID )

CategoryID | CollectionID | ProductID | CategoryName | CollectionName | ProductName | ProductPhoto

1 1 3 XYZ ABC Prod3 Photo3.jpg

1 2 4 XYZ BCA Prod4 Photo4.jpg

In my ASP.Net web page, I can able to show the product list (Photo, and below that the product name) in horizontal mode through datalist web control as per requirement. It is working fine.

ASP.Net page code below:

Expand|Select|Wrap|Line Numbers
  1. <asp:DataList ID="DataList1" runat="server" DataKeyField="ProductID" DataSourceID="ProductsByCategoryDataSource" RepeatColumns="4" RepeatDirection="Horizontal">
  2.     <ItemTemplate>
  3.          <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("Photo") %>' ToolTip='<%# Eval("Description") %>' /><br /><asp:HyperLink ID="ProductIDHyperLink" runat="server" NavigateUrl='<%#String.Format("ProductDetails.aspx?CategoryID={0}&ProductID={1}",DataBinder.Eval(Container,"DataItem.CategoryID"),DataBinder.Eval(Container,"DataItem.ProductID"))%>' Text='<%# Eval("Description")%>'></asp:HyperLink>
  4.     </ItemTemplate>
  5. </asp:DataList>
  6. <asp:ObjectDataSource ID="ProductsByCategoryDataSource" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetProductsByCategoryID" TypeName="ProductsBLL" EnableViewState="False">
  7.     <SelectParameters>
  8.          <asp:QueryStringParameter Name="CategoryID" QueryStringField="CategoryID" Type="Int32" />
  9.     </SelectParameters>
  10. </asp:ObjectDataSource>
But my new requirement is to show the collectionswise (sub headings) products in the outer web control. If it is categorywise, my job will be easier. Because in outer web control, I will get the categorylist and inner web control will take the specific categoryID as parameter to produce the list.

How can I achieve my new requirement? Please help.
Apr 21 '09 #1
0 1333

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

Similar topics

4
3096
by: V. Jenks | last post by:
What seems like a simple thing is apparently not so straightforward? I have a datalist. Inside of that datalist is an <itemtemplate> secion which contains other server controls such as a label, a radiobuttonlist, etc. I'm driving myself insane trying to figure out how to get
2
2230
by: Kjetil Klaussen | last post by:
Hi, I’m having some troubles trying to bind my dataset to a GridView control through an ObjectDataSource control. The binding works fine for regular columns in my dataset, but I can’t seem to get my expression columns to show up in my GridView. Anybody knows any neat tricks to make this work? Here’s a “step-by-step” to reproduce my worries: 1. Create a new “ASP.NET web site” project
2
2382
by: bigbrorpi | last post by:
Hi I have a FormView that contains a GridView. The GridView is populated from an ObjectDataSource. Two of the columns in the GridView are not bound, and the values used in Update mode come from dropdowns (inside of ItemTemplates). In my ObjectDataSource, I have Parameters for the bound fields, and ControlParameters for the DDLs. I cannot seem to access the DDLs since they are so nested. I've tried:
0
1850
by: H5N1 | last post by:
Hi there My problem is that in when I update GridView row, which is nested into DataList control, I want to refresh also DataList in which the GridView is nested, since after update, trigger in my DB changes some value in it (some Total sum from the GridView column). The GridView, along with its ObjectDataSource is inserted into DataList ItemTemplate.
1
3415
by: H5N1 | last post by:
Hello everybody I'm stuck for a long time with the following problem, so I will be really gratefull if you could help me a bit: I have a GridView nested in DataList (it's located in DataList's Item Template together with it's data source). In OnRowUpdated event of child GridView I'm calling DataBind() on parent DataList, since I want it to reflect the changes (maybe there's
0
1359
by: sansie | last post by:
Hi, I have a page which is basically a details view(in inset mode) inside a datalist. The problem is I want to set the field "invoiceID" (of the detailsview) to an invoiceID coming through the query string of the page. Now, I have sucessfully done this with a detailsview that is not enclosed in a datalist, using the following page load script: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles...
1
4236
by: Chris | last post by:
I am creating a nested gridview as per the tutorial here (http://msdn2.microsoft.com/en-us/library/aa992038(vs.80).aspx). My gridviews work fine. I have a master gridview containing the customerid. This value is used by a a detail gridview nested within the master. This works well but when I hide the customerid the filter stops working. I suspect that this code can't find the ID to do the filtering. How do get around this as I want to hide...
0
3518
by: mutt1170 | last post by:
I have a checkbox list nested inside a gridview. The gridview pulls its data from an objectdatasource and lists countries. The nested checkbox list is databound to another object datasource and lists the regions for each country. The checkboxlist has autopostback set to true and I want to perform an action based on whether or not each checkbox is selected. I am having trouble retrieving the nested checkboxlist to access the selected...
2
2607
by: ASF | last post by:
Hey all, I have a gridview which pulls from a BLL which pulls from a DAL (an .XSD file). Each row on that gridview has a nested repeater which pulls from another table. The code which populates each nested repeater is shown below (it's in the gridview's RowDataBound event). My question is this: what can I do to speed up this process? Currently EVERY time a new gridview row is generated the code reaches out to the database, grabs the...
0
9579
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9422
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,...
0
10206
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10035
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9851
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
8863
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 projectplanning, coding, testing, and deploymentwithout 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...
0
5293
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3556
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.