Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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
 
Old December 7th, 2009, 03:30 PM
Friend of Wrox
 
Join Date: Nov 2003
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?
 
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
 
Old December 10th, 2009, 11:19 AM
Friend of Wrox
 
Join Date: Nov 2003
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.
 
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
 
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 .
 
Old December 10th, 2009, 12:50 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

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





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





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