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}