Object data source, setting parameter source to Page.Partner.Guid
I'm trying to databind using an object data source to a dropdownlist in
asp.net 2.0, The method I'm databinding to takes a parameter. My page is a
page I've implemented by inheriting from the normal page object, and it has
a property called Partner that in turn has a property called Guid. I would
like to pass the Page.Partner.Guid as a parameter to the method that I'm
databinding to. How can I do this, I can choose parameter source to None,
Cookie, Control, Form, Profile, Querystring, Session.
But I cant find my Page.Partner.Guid in any of those options, the page
control is not listed in Control.
What is Profile? Could I add my Partner object to the profile?
How do I get this to work?
RE: Object data source, setting parameter source to Page.Partner.Guid
You can just select "None" for the parameter type and pass the parameter
value in ObjectDataSource's Selecting event:
protected void ObjectDataSource1_Selecting(object sender,
e.InputParameters["guid"] = this.Partner.Guid;
You can add a custom type as a Profile property by:
<add name="Partner" type="mynamespace.Partner"/>
However, since your ObjectDataSource's using the Partner.Guid as parameter,
you cannot directly use Profile.Partner as its parameter.
Please reply to let me know whether or not you need further information.
Walter Wang (email@example.com, remove 'online.')
Microsoft Online Community Support
Get notification to my posts through email? Please refer to
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
This posting is provided "AS IS" with no warranties, and confers no rights.
Re: Object data source, setting parameter source to Page.Partner.Guid
I found a workaround:
I simply save the property in a hidden field, in Page_Load, that is not
visible and let teh object data source get its parameter from there.
|All times are GMT. The time now is 09:01 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.