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

Home Posts Topics Members FAQ

Nested webcontrols from the same objectdatasource - Help needed

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

My objectdatasource can produce below output by CategoryID parameter: (stored procedure: GetProductsByCategoryID )

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 1317

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

Similar topics

4
3070
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...
2
2206
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...
2
2369
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...
0
1820
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...
1
3401
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...
0
1345
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...
1
4211
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....
0
3494
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...
2
2589
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...
0
7114
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
7377
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...
0
7488
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
5045
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
4702
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
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1544
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 ...
1
762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
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...

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.