Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 5th, 2009, 07:11 AM
Registered User
 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need to assign current logged in USER name to the people picker control in ASPX page

Hi All

I need to assign the current user to the people picker control in my custom ASPX page which I am planing to host in sharepoint (WSS) .

I was trying on these lines but without success.


System.Collections.ArrayList entityArrayList = new System.Collections.ArrayList();
PickerEntity entity = new PickerEntity();
userPicker = new PeopleEditor();
userPicker.MultiSelect = false;
entity.Key = SPContext.Current.Web.CurrentUser.LoginName;

entity= userPicker.ValidateEntity(entity);


entityArrayList.Add(entity.Key);
userPicker.UpdateEntities(entityArrayList);

It is throwing type casting exception.did tried with all the rules of the book but nothing worked!

Please let me know if you have any idea to fix this issue .


Thanks in advance
Jagadish
  #2 (permalink)  
Old December 7th, 2009, 03:30 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

What is the error and what line of code is causing the error?
  #3 (permalink)  
Old December 10th, 2009, 01:46 AM
Registered User
 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Could trace to some extend

userPicker = new PeopleEditor();
SPUser user = ipsWeb.CurrentUser;
PickerEntity entity = new PickerEntity();
entity.Key = user.LoginName;

System.Collections.ArrayList entityArrayList = new System.Collections.ArrayList();
entityArrayList.Add(entity);
userPicker.UpdateEntities(entityArrayList);


I could get the logged user in the entity and even UpdateEntities is working fine without throwing any error but still 'The control is blank for me'.Pls Help pls help
  #4 (permalink)  
Old December 10th, 2009, 11:19 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

You did not tell me what the error was and what line of code the error points to.
  #5 (permalink)  
Old December 10th, 2009, 11:40 AM
Registered User
 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

The above line never get assigned to userid .I could not assign the my id to the ppl editor control.there is no error message as such

Regards
Jagadish
  #6 (permalink)  
Old December 10th, 2009, 11:42 AM
Registered User
 
Join Date: Dec 2009
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am using this ppl editor control in a custom application page which is hosted in a WSS site .
  #7 (permalink)  
Old December 10th, 2009, 12:50 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Then I suggest you contact the author of that page for support.
 


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom control writing properties to ASPX- Page jack_in_black ASP.NET 2.0 Professional 1 July 14th, 2006 07:55 AM
Pasar valor de un User Control a una forma aspx emartinez ASP.NET Espanol 2 August 2nd, 2005 02:32 PM
Change TextBox control location on aspx page minhpx General .NET 2 March 4th, 2005 08:29 AM
Calling procedure of User Control from aspx file vskumar VB.NET 1 February 15th, 2005 11:17 AM
Getting the name of the logged on user Grahame2003 C# 2 March 4th, 2004 04:48 AM



All times are GMT -4. The time now is 07:56 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.