Object data source, setting parameter source to Page.Partner.Guid

Discussion in 'ASP .Net Web Controls' started by Allan Ebdrup, Oct 4, 2006.

  1. Allan Ebdrup

    Allan Ebdrup Guest

    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?

    Kind Regards,
    Allan Ebdrup
    Allan Ebdrup, Oct 4, 2006
    1. Advertisements

  2. Hi Allan,

    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,
    ObjectDataSourceSelectingEventArgs e)
    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 (, 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.
    Walter Wang [MSFT], Oct 5, 2006
    1. Advertisements

  3. Allan Ebdrup

    Allan Ebdrup Guest

    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.
    Allan Ebdrup, Oct 6, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne Wengert

    Problem Using GUID as SQLDataSource Parameter

    Wayne Wengert, Feb 5, 2006, in forum: ASP .Net
    Wayne Wengert
    Feb 6, 2006
  2. Stylus Studio
    Stylus Studio
    Aug 12, 2005
  3. Max Ischenko

    passing GUID parameter to adodbapi

    Max Ischenko, Jul 22, 2004, in forum: Python
    Max Ischenko
    Jul 22, 2004
  4. shapper

    Parameter and Guid

    shapper, Feb 22, 2008, in forum: ASP .Net
    Feb 23, 2008
  5. Darren

    Counting partner enquiries and setting daily maximum.

    Darren, Jan 26, 2004, in forum: ASP .Net Web Services
    Jan 26, 2004

Share This Page