Показать сообщение отдельно
Старый 10.07.2009, 17:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
Fred Shen: Caller information in EP2009
Источник: http://fredshen.spaces.live.com/Blog...E4E3!272.entry
==============

If we want to get the caller page information in Enterprise portal 2009 which is similar to what we did in AX native client programming -

element.args().caller();

We can implement the following code in the user control:

using Microsoft.Dynamics.Framework.Portal;

...

...

private string GetElementCaller()

{

    string sPath = AxWebSession.GetPreviousURL(this.Page).ToString();

    string [] words = sPath.Split(‘/’, ‘?’);

    string caller = “”;

    foreach (string word in words)

    {

        if (word.Contains("aspx"))

        {

            caller = word;

            break;

        }

    }

    return caller;

}

Add a Label control on the ascx file with ID 'Label1' and put the following code in the Page_Load method

protected void Page_Load(object sender, EventArgs e)

{

   ...

   if (!this.Page.IsPostBack)

   {

      this.Label1.Text = GetElementCaller();

   }

}

You will get the result like ‘EPProjTableInfo.aspx’. 



Источник: http://fredshen.spaces.live.com/Blog...E4E3!272.entry
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.