473,657 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to assign current logged in USER name to the people picker control in ASPX page

4 New Member
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.Collecti ons.ArrayList entityArrayList = new System.Collecti ons.ArrayList() ;
PickerEntity entity = new PickerEntity();
userPicker = new PeopleEditor();
userPicker.Mult iSelect = false;
entity.Key = SPContext.Curre nt.Web.CurrentU ser.LoginName;

entity= userPicker.Vali dateEntity(enti ty);


entityArrayList .Add(entity.Key );
userPicker.Upda teEntities(enti tyArrayList);

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
Dec 5 '09 #1
0 1280

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1617
by: Homa | last post by:
Hi, I am using a role-based Forms Authentication. I have several directories that have different levels of authorization. When I try to access another directory, the page bounce me back to the login page everytime. After I re-login, I can access the page. I can't figure out what happened. I saved the roles to the User so when I access another page, they should able to see that before they bounce me out.
8
1290
by: Alan Silver | last post by:
Hello, I'm trying to write a simple user control as an exercise (and 'cos it might be useful). I am trying to do a simple date picker, which consists of three drop down lists, one for the day, one for the month and one for the year. I know this isn't earth-shattering stuff, but I'm still learning, so please be patient!! I'm having trouble with the properties of the control. I have created the control OK and it displays fine. I added a...
2
2898
by: pv | last post by:
Hi everyone, I need help with following scenario, please: Users are accessing same web server from intranet (users previously authenticated in Active Dir) and from extranet (common public users). If user is from intranet, web server should recognize it and application should create additional options in controls regarding groups the user belongs to. If user is from extranet it should be logged in as anonymous and a link to login page...
3
1667
by: Alan Silver | last post by:
Hello, I have some pages that are protected by forms authentication, and am adding code to the global.asax so that if someone tries to load (say) /order83.aspx, if they are logged in, it will rewrite the url to /order.aspx?orderid=83, and if they aren't logged in, it will redirect them to the default page. The reason for this is that I don't want people seeing the login page if they aren't site admin folk. If I just let the normal...
3
1825
by: Phillip N Rounds | last post by:
I'm having trouble with using cookies to monitor the stages of login. I have a two stage Registration page ( register.aspx ) and my target page ( MyPage.aspx ) I'm using a cookie named LoginStatus to tract the stage of the login process. LoginStatus = "1" denotes that the first part of the login process has been performed. LoginStatus = "2" denotes that the login process has been completed.
11
1852
by: Matthew | last post by:
Ok let me try to explain this as good as I can. I am creating this application where it contains a userlogin class. The user logs in before entering the main apploication. I want to do audit trails and I am trying to figure out how to get the user ID that logged in. Can anyone help me. I have samples if anyone needs them.
25
3313
by: crescent_au | last post by:
Hi all, I've written a login/logout code. It does what it's supposed to do but the problem is when I logout and press browser's back button (in Firefox), I get to the last login page. In IE, when I press back button, I get to the page that says "Page has Expired" but Firefox does not do this. I think it's something to do with sessions not properly unset or something like that but I haven't been able to figure it out. I am
1
1454
by: pcloches | last post by:
I'm having a very difficult time with some of our new pages. We've moved to a web farm, and it seems in spurts it will come where parts of my page think the user is logged in, and parts think the user is not logged in. It seems to happen to an entire control. (None of the controls have OutputCache set) For example, our login control on top will appear showing the user is logged inw hen they have been redirected to RegNewUser, but...
2
3147
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button then the calender gone actually i want if i click outside off the calender then it should me removed ..How kan i do this ... Pls inform me as early as possible .. I am waiting for ur quick replay ...Here i attached the source code .... <!DOCTYPE...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.