Toolbar::CurrentTool returns an empty string when in callback request/response.
上次发布: August 25, 2014No Product Found
漏洞 ID 编号
NIM006759
已提交
February 12, 2007
上次修改时间
June 5, 2024
适用范围
No Product Found
找到的版本
9.2
编程语言
C#
状态
Will Not Be Addressed
开发团队已考虑过该问题或请求,并决定不会解决该问题。 问题的“其他信息”部分可能包含进一步说明。
附加信息
No Public Explanation
解决办法
When click any tool in toolbar, execute a Javascript to send a callback request to the server with the current tool name. And save the string in a session variable. In the future the current tool name could be retrieved from the session variable. Here is the code:Client side Javascript: function currenttool() { toolbar = Toolbars["Toolbar1"]; var f = document.form1; var mod = f.elements[toolbar.currentToolField].value; return mod; } function manuallyCallbackrequest() { var message = currenttool(); var context = null; <%=sCallbackInvotion%> }Server side code:public partial class _Default : System.Web.UI.Page, ICallbackEventHandler{ public string sCallbackInvotion; protected void Page_Load(object sender, EventArgs e) { sCallbackInvotion = Page.ClientScript.GetCallbackEventReference(this, "message", "processCallbackResult", "context", "postBackError", true); } protected void Map1_MapClick(object sender, ESRI.ArcGIS.ADF.Web.UI.WebControls.PointEventArgs args) { if (Session["currentToolName"] != null) { System.Diagnostics.Debug.WriteLine(Session["currentToolName"].ToString()); } } #region ICallbackEventHandler Members public string GetCallbackResult() { return null; } public void RaiseCallbackEvent(string eventArgument) { Session.Add("currentToolName", eventArgument); } #endregion}