HighTechTalks DotNet Forums  

ObjectDataSource Requires Current User ID

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss ObjectDataSource Requires Current User ID in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Jonathan Wood
 
Posts: n/a

Default ObjectDataSource Requires Current User ID - 01-03-2008 , 11:19 PM






I have a page with a GridView, which uses an ObjectDataSource control to
obtain the data.

The ObjectDataSource control calls a static method on a class I've created.
However, this method needs an argument that is the user key of the current
user.

I know how to use GetUser() to get a MembershipUser object and use the
ProviderUserKey property. But how can I get the ObjectDataSource to use
this?

Is there an even that would allow me to set this somehow?

Thanks!

--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com


Reply With Quote
  #2  
Old   
maciek kanski
 
Posts: n/a

Default Re: ObjectDataSource Requires Current User ID - 01-04-2008 , 02:59 AM






Jonathan Wood wrote:
Quote:
The ObjectDataSource control calls a static method on a class I've
created. However, this method needs an argument that is the user key of
the current user.
wrap existing method with the new one:

public static void YourClass.SelectMethodForObjectDataSource() {
YourClass.ExistingMethod(HttpContext.Current.User. Identity.Name);
}

and give the YourClass.SelectMethodForObjectDataSource to ObjectDataSource


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.