473,770 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to programmaticall y access ObjectDataSourc e values

We would like to use those new cool features of Asp.Net 2.0 like the
ObjectDataSourc e 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
ObjectDataSourc e in my page

<asp:ObjectData Source ID="productData " runat="server"
SelectMethod="G etProduct"
TypeName="MyRed mond.Gumsnet.We bUi.UiProcess.C ontroller.Produ ctContentContro ller">
<SelectParamete rs>
<asp:Paramete r DefaultValue="1 0" Name="productID "
Type="Object" />
</SelectParameter s>
</asp:ObjectDataS ource>

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

Alain Vezina
av*****@dieselm arketing.com

Nov 21 '05 #1
3 2652
You can access the ObjectDataSourc e's SelectParameter s from anywhere on the
page and change the DefaultValue to anything you'd like. Also, you can handle
the ObjectDataSourc e's Selecting event and then modify the parameters for
that one select by adding or chaninging the ObjectDataSourc eSelectingEvent Args'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
ObjectDataSourc e 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
ObjectDataSourc e in my page

<asp:ObjectData Source ID="productData " runat="server"
SelectMethod="G etProduct"
TypeName="MyRed mond.Gumsnet.We bUi.UiProcess.C ontroller.Produ ctContentC
ontroller">
<SelectParamete rs>
<asp:Paramete r DefaultValue="1 0" Name="productID "
Type="Object" />
</SelectParameter s>
</asp:ObjectDataS ource>
Now I can bind this ObjectDataSourc e to any data control, but in this
case I want to display information at many places in my page using
this single ObjectDataSourc e. So I want to be able to
programmaticall y access ObjectDataSourc e values, but the Question is
HOW?

Alain Vezina av*****@dieselm arketing.com

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

Tks


Brock Allen wrote:
You can access the ObjectDataSourc e's SelectParameter s from anywhere on the
page and change the DefaultValue to anything you'd like. Also, you can handle
the ObjectDataSourc e's Selecting event and then modify the parameters for
that one select by adding or chaninging the ObjectDataSourc eSelectingEvent Args'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
ObjectDataSourc e 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
ObjectDataSourc e in my page

<asp:ObjectData Source ID="productData " runat="server"
SelectMethod="G etProduct"
TypeName="MyRed mond.Gumsnet.We bUi.UiProcess.C ontroller.Produ ctContentC
ontroller">
<SelectParamete rs>
<asp:Paramete r DefaultValue="1 0" Name="productID "
Type="Object" />
</SelectParameter s>
</asp:ObjectDataS ource>
Now I can bind this ObjectDataSourc e to any data control, but in this
case I want to display information at many places in my page using
this single ObjectDataSourc e. So I want to be able to
programmaticall y access ObjectDataSourc e values, but the Question is
HOW?

Alain Vezina av*****@dieselm arketing.com


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

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

Tks

Brock Allen wrote:
You can access the ObjectDataSourc e's SelectParameter s from anywhere
on the
page and change the DefaultValue to anything you'd like. Also, you
can handle
the ObjectDataSourc e's Selecting event and then modify the parameters
for
that one select by adding or chaninging the
ObjectDataSourc eSelectingEvent Args'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
ObjectDataSourc e 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
ObjectDataSourc e in my page

<asp:ObjectData Source ID="productData " runat="server"
SelectMethod="G etProduct"
TypeName="MyRed mond.Gumsnet.We bUi.UiProcess.C ontroller.Produ ctConten
tC
ontroller">
<SelectParamete rs>
<asp:Paramete r DefaultValue="1 0" Name="productID "
Type="Object" />
</SelectParameter s>
</asp:ObjectDataS ource>
Now I can bind this ObjectDataSourc e to any data control, but in
this
case I want to display information at many places in my page using
this single ObjectDataSourc e. So I want to be able to
programmaticall y access ObjectDataSourc e values, but the Question is
HOW?
Alain Vezina av*****@dieselm arketing.com

Nov 23 '05 #4

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

Similar topics

0
1724
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 characters, but not clear what the length of a path and filename should be. I would like to check the system-defined lengths programatically. At least does anyone know what the maximum length of a complete file path
6
2165
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 created using javascript are available at the server? if not how can i do the above thing so that there values can be accessed. I dont want to postback page everytime i need to create a new element.
2
9628
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 programmatically manipulate them before they're bound to any data control. I'd be using them almost like you'd use recordset fields from Classic ADO. In other words, I would like to grab the value corresponding to a publication date from my database, use the...
2
1868
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 method. Also enableViewStateMac is made false in the destination page. Still I cannot get some changed values. The scenario is such - 1. I have page 1 with a hidden variable named,"myHid" whose value is set to "Text1" 2. When a submit happens on...
2
1653
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 looking to do is have a lot of different variables stored in my
11
4498
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 AutoNumber* fields in them. Correct me if I'm wrong, but I'm assuming this means that I cannot now alter these existing Access tables and change their primary key to an "AutoNumber" type. If I'm right about this, I need some suggestions as to the...
0
929
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 user gets redirected get populated by the data of that employee. Eg: If XXX is clicked a form sholud be opened containig the information about XXX (from DB.) I know how to fetch the data from the DB but dont know how to access the values from the...
1
1295
by: pavankumar106 | last post by:
can any1 tell me how to access label values of datalist in javascript?
5
5890
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 one enter some text in text box and click the button it will show the form two and its bit easy task. But the problem is that I want to access the values of text box(Form1) to Form2 when i will click the button on form 2 but getting error the code...
0
10260
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
10102
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...
1
10038
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
9910
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
6712
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
5354
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...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
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.