Get Returned object from ObjectDataSource

Posted on: Fri Nov 20 17:34:19 -0800 2009. Updated on: Fri Nov 20 17:53:23 -0800 2009.
Category: DotNet

If you have a function that returns a value and is called by an ObjectDataSource, ie Insert or Update, you can use this to get the returned value from the function

// define the OnInserted function of the object data source in the aspx side.

protected void ObjectDataSourceProduct_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
{
	ProductId = (int)e.ReturnValue;
	Response.Redirect("EditProduct.aspx?productId=" + ProductId.ToString());
}

Comments:

Add a Comment:

simple_captcha.jpg
(human authentication)


Ads

Categories

About

Random foliage

This website is meant to be a reference for ASP Dot Net developers. The entries are a compilation of things I've figured out how to do and that I deem useful to keep of track for future reference. Assumptions: web development with: C Sharp (vb sucks), visual studio 05/08, .net 3.5, meant for programmers. Written by: James Reategui.