views:

27

answers:

1

I send id of my class object from one page to second this way

NavigateUrl='<%# "ItemDetail.aspx?itemId=" + (string)Eval("Id") %>'

Then I get the object with ObjectDataSource and function this way

<asp:ObjectDataSource ID="ObjectDataSourceItem" runat="server" SelectMethod="GetItem"
            TypeName="Catalog">
            <SelectParameters>
                <asp:QueryStringParameter Name="itemId" QueryStringField="itemId" Type="string" DefaultValue="" />
            </SelectParameters>
        </asp:ObjectDataSource>

So how to use this item in my new page code

this.ObjectDataSourceItem.?????
+1  A: 

You need to subscribe to the ObjectDataSource's Selected event, access the ObjectDataSourceStatusEventArgs ReturnValue property (e.ReturnValue), and cast it to the appropriate type. Something like:

protected void ObjectDataSourceItem_Selected(object source, ObjectDataSourceStatusEventArgs e)
{
    var myDataSet = (DataSet)e.ReturnValue;
}
Jamie Ide
Thank you, I'll try it
nCdy