Getting portal user id from asp.net
I'm trying to retrieve the portal login id from asp.net programs in EP6.
We currently do not have SSO. And we arent using User Mapping.
I have existing programs that work fine on EP5 but Im unable to retrieve the user id when I try to run them through EP6. These programs are installed on the portal server.
I'm using the iView Editor, URL tab to do a get method:
Value: #USER NAME#
Then, in my program the code is:
lblQstring.Text = Request.QueryString.Get(0).ToString();
o_user = this.lblQstring.Text.Substring(this.Label1.Text.IndexOf("
") + 1);
I couldnt figure out what needed to be put in the parameters in the URL iView editor, so I dont know if the old code would even work. It definitely doesnt work without the parameters.
I also tried the following, in my code, which works on new portal applications made with the PDK in .net ~ but it doesn't work in the old asp.net ones.
new_user = this.User.Identity.Name.ToString();
new_user = new_user.ToUpper();
txtUserid.Text = new_user;
Is there a way to retrieve the portal login under these circumstances? If so, how?
Shibli Zaman replied
Julie, the solutions that André and Reiner have presented are indeed excellent and elegant solutions utilizing SSO.
However, you mentioned in your first post that you are trying to do this without SSO.
It might be a good idea to implement SSO and go with the solutions they provide. Otherwise, please do keep us posted on what you find. Thanks! --Shibli