473,395 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to programmatically access ObjectDataSource values

We would like to use those new cool features of Asp.Net 2.0 like the
ObjectDataSource in our project. I tried few basics examples and its
work well.

Let's say I have a page that displays a detail of a product. On my
page I have a product name and a short description. So I declare an
ObjectDataSource in my page

<asp:ObjectDataSource ID="productData" runat="server"
SelectMethod="GetProduct"
TypeName="MyRedmond.Gumsnet.WebUi.UiProcess.Contro ller.ProductContentController">
<SelectParameters>
<asp:Parameter DefaultValue="10" Name="productID"
Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>

Now I can bind this ObjectDataSource to any data control, but in this
case I want to display information at many places in my page using this
single ObjectDataSource. So I want to be able to programmatically
access ObjectDataSource values, but the Question is HOW?

Alain Vezina
av*****@dieselmarketing.com

Nov 21 '05 #1
3 2626
You can access the ObjectDataSource's SelectParameters from anywhere on the
page and change the DefaultValue to anything you'd like. Also, you can handle
the ObjectDataSource's Selecting event and then modify the parameters for
that one select by adding or chaninging the ObjectDataSourceSelectingEventArgs's
InputParameters. HTH

-Brock
DevelopMentor
http://staff.develop.com/ballen
We would like to use those new cool features of Asp.Net 2.0 like the
ObjectDataSource in our project. I tried few basics examples and its
work well.

Let's say I have a page that displays a detail of a product. On my
page I have a product name and a short description. So I declare an
ObjectDataSource in my page

<asp:ObjectDataSource ID="productData" runat="server"
SelectMethod="GetProduct"
TypeName="MyRedmond.Gumsnet.WebUi.UiProcess.Contro ller.ProductContentC
ontroller">
<SelectParameters>
<asp:Parameter DefaultValue="10" Name="productID"
Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
Now I can bind this ObjectDataSource to any data control, but in this
case I want to display information at many places in my page using
this single ObjectDataSource. So I want to be able to
programmatically access ObjectDataSource values, but the Question is
HOW?

Alain Vezina av*****@dieselmarketing.com

Nov 23 '05 #2
Is there a way to go through the ObjectDataSource using foreach(....)

Tks


Brock Allen wrote:
You can access the ObjectDataSource's SelectParameters from anywhere on the
page and change the DefaultValue to anything you'd like. Also, you can handle
the ObjectDataSource's Selecting event and then modify the parameters for
that one select by adding or chaninging the ObjectDataSourceSelectingEventArgs's
InputParameters. HTH

-Brock
DevelopMentor
http://staff.develop.com/ballen
We would like to use those new cool features of Asp.Net 2.0 like the
ObjectDataSource in our project. I tried few basics examples and its
work well.

Let's say I have a page that displays a detail of a product. On my
page I have a product name and a short description. So I declare an
ObjectDataSource in my page

<asp:ObjectDataSource ID="productData" runat="server"
SelectMethod="GetProduct"
TypeName="MyRedmond.Gumsnet.WebUi.UiProcess.Contro ller.ProductContentC
ontroller">
<SelectParameters>
<asp:Parameter DefaultValue="10" Name="productID"
Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
Now I can bind this ObjectDataSource to any data control, but in this
case I want to display information at many places in my page using
this single ObjectDataSource. So I want to be able to
programmatically access ObjectDataSource values, but the Question is
HOW?

Alain Vezina av*****@dieselmarketing.com


Nov 23 '05 #3
Check out ObjectDataSource.Select()

-Brock
DevelopMentor
http://staff.develop.com/ballen
Is there a way to go through the ObjectDataSource using foreach(....)

Tks

Brock Allen wrote:
You can access the ObjectDataSource's SelectParameters from anywhere
on the
page and change the DefaultValue to anything you'd like. Also, you
can handle
the ObjectDataSource's Selecting event and then modify the parameters
for
that one select by adding or chaninging the
ObjectDataSourceSelectingEventArgs's
InputParameters. HTH
-Brock
DevelopMentor
http://staff.develop.com/ballen
We would like to use those new cool features of Asp.Net 2.0 like the
ObjectDataSource in our project. I tried few basics examples and
its work well.

Let's say I have a page that displays a detail of a product. On my
page I have a product name and a short description. So I declare an
ObjectDataSource in my page

<asp:ObjectDataSource ID="productData" runat="server"
SelectMethod="GetProduct"
TypeName="MyRedmond.Gumsnet.WebUi.UiProcess.Contro ller.ProductConten
tC
ontroller">
<SelectParameters>
<asp:Parameter DefaultValue="10" Name="productID"
Type="Object" />
</SelectParameters>
</asp:ObjectDataSource>
Now I can bind this ObjectDataSource to any data control, but in
this
case I want to display information at many places in my page using
this single ObjectDataSource. So I want to be able to
programmatically access ObjectDataSource values, but the Question is
HOW?
Alain Vezina av*****@dieselmarketing.com

Nov 23 '05 #4

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

Similar topics

0
by: John G | last post by:
How can I Programmatically access maximum path, file, and sum of both lengths? I am using VB.NET 2003. The PathTooLongException indicates that a path < 248 characters, filename < 260...
6
by: Vikram | last post by:
I have added some input elements on a page using javascript at client side. when i submit the page, i am unable to access the values of input elements created using request.form. Are elements...
2
by: | last post by:
I've defined an ObjectDataSource against a dataset, and I can bind the ObjectDataSource's members to data controls. I'm wondering how to take the values in an ObjectDataSource and...
2
by: P K | last post by:
I am using server.transfer for a website being developed in vs.net 2005 And I need to get the posted values after server.transfer. For this I set the second parameter "true" in the transfer...
2
by: Chuck C | last post by:
Is there a way to access the values from a session by using an index/count instead of the name? Something like: $_SESSION Also, can you query the name and value for this? What I am...
11
by: Alan Mailer | last post by:
A project I'm working on is going to use VB6 as a front end. The back end is going to be pre-existing MS Access 2002 database tables which already have records in them *but do not have any...
0
by: ashima515 | last post by:
Hi I have made a datagrid whose first col(employee code) is a hyperlink column that redirects the user to another form. I want that when a particular employee code is clicked, the form to which the...
1
by: pavankumar106 | last post by:
can any1 tell me how to access label values of datalist in javascript?
5
by: ezhar | last post by:
Hi, I have two form i my project. Form1 contains a text box with public access modifiers and a button. and Form 2 contains a label and a button. the following task i am trying to do. when some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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...
0
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,...

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.