0

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 Answer 1

1

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;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.