Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > BizUser.WhoAmI always returns the administrator id
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 13th April 23:07
b_gul_tàº[]ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id



Hello,

I have an asp.net web application that is called from CRM web user
interface. The application resides in a virtual directory in IIS. From within
this application, I call BizUser.WhoAmI to determine who is calling the .aspx
page. However, the method always returns the administrators user id, even
though I log on to the user interface with different users. Is there a way to
get the information of the user that is logged in?

Thanks,
Bilge Gul
  Reply With Quote


  sponsored links


2 13th April 23:08
wdwcrazy0w+k<ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id



1.) If I called my page from a menu item using an http reference, the whoamI
returned the correct user if I called it during the page_load event. If I
called the same method from a button click on the form, then I got the
administrator.

2.) If I called my page from a new tab, which openened up my form inside of
CRM, then the correct user was returned in both calls.

HTH "b_gul_t" wrote:
  Reply With Quote
3 13th April 23:09
b_gul_tàº[]ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id


My application is called like this:

I have edited the isv.config file so that a new tab is added to the left
hand side in the sales module, just under the orders tab. In the isv.config


Does the second option you have written work like this?

I also have a question about the first option. In order to add a menu item I
use the isv.config file. I did not understand where the page_load event is.

Thank you for your answer, it is nice to know that I am not the only one
experiencing this problem

Bilge Gul "wdwcrazy" wrote:
  Reply With Quote
4 19th April 15:18
wdwcrazy0w+k<ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id


The page load is the same for either option. When you open up your form in
..NET Studio to see the code, you should have code like this:

public class NameofPage : System.Web.UI.Page
{

private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
//DO BIZUSER STUFF HERE
}
}
  Reply With Quote
5 19th April 15:18
wdwcrazy0w+k<ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id


Bilge,
When you open up your asp.net form in the developer tool at the very top
should be the page_load event code block. You should add an is statement so
you only do the lookup on the first time in like this
if (!Page.IsPostBack)
{
DO BIZUSER STUFF HERE
}

Hope this Helps
  Reply With Quote
6 19th April 15:19
b_gul_tàº[]ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id


Thank you , I tried your suggestion. But I still get the administrator's user
id. My .aspx resides in a virtual directory in IIS, can it be something
related to this?

Bilge
  Reply With Quote
7 19th April 15:19
wdwcrazy0w+k<ŠÇ.²È¨žÉ¢rº,¡û\¢
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id


Might be - your directory needs to be in the same place as CRM, at least that
is how mine works. In my system I have CRM in wwwroot\crm so my project is
in wwwroot\crm\myproject
  Reply With Quote
8 29th April 00:25
matt parks
External User
 
Posts: 1
Default BizUser.WhoAmI always returns the administrator id


How have you configured the Virtual Directory? Did you let it inherait all the
settings from the root web site? It should be setup with all the same security
& service acccount settings as the root website. It's possible that you have it
set to run the virtual under the admin account.

Also, how are you setting the credentials? Are you using DefaultCredentials?

Matt Parks
MVP - Microsoft CRM

----------------------------------------
----------------------------------------

Thank you , I tried your suggestion. But I still get the administrator's user
id. My .aspx resides in a virtual directory in IIS, can it be something
related to this?

Bilge "wdwcrazy" wrote:
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666