![]() |
#1 |
Участник
|
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, напишите личное сообщение администратору. |
|
![]() |
#2 |
Участник
|
Какой-то несско... сомнительный подход. Такой код слишком просто "надурить", подставив после "?" любой незначащий параметр, содержащий подстроку "aspx". Лучше уж какие-нить регулярные выражения использовать...
|
|