During project development, the tool bar or task of the adf is troublesome and lacks flexibility. Therefore, it is very helpful to know that the Js library provided by ArcGISServer has great benefits for the development of ArcGISServer. For example, after creating a task, we can not display the task page, but we can "steal" The task function and use JavaScript to use this function.
Code:
Code
1 function CX ()
2 {
3 executeTask ('searchtext = '+ document. getElementById ('info '). value, "WebForm_DoCallback ('taskmanager1 $ SearchAttributesTask1 ', argument, processCallbackResult, context, postBackError, true )");
4}
The above is the function of "Stealing" SearchAttributesTask, but the page form can be customized. "SearchText" is followed by the information to be queried, so that the custom query is implemented.
In addition to the above form of "theft", we can also use the Ajax provided by Asp. Net to implement the refreshing operation. For example, if we want to display a feature in the center, we first implement Asp for the map page. net's own Ajax ICallbackEventHandler interface, and implement void ICallbackEventHandler in the interface event. raiseCallbackEvent (string eventArgument), write the code in the center of the feature, and then return Map1.CallbackResults. toString. This is what we are stealing. The returned format is a string that can be processed by processCallbackResult of the esri js library. After parsing this string, the map can be refreshed (this string includes ^ :: for more information about the format, see the help description ). We cannot refresh the returned string through Asp. Net ICallbackEventHandler. We need to register the corresponding js call block.
Code
1 public string centeratCallBackFunctionInvocation;
2 protected void Page_Load (object sender, EventArgs e)
3 {
4 centeratCallBackFunctionInvocation = Page. ClientScript. GetCallbackEventReference (this,
5 "message", "processCallbackResult", "context", "postBackError", true );
6}
You can also call and input parameters in page js:
Code
1 function Center2 ()
2 {
3 var wgid = document. getElementById ("wgid"). value;
4 var message;
5 if (wgid)
6 {
7 message = "WGID =" + wgid;
8 <% = centeratCallBackFunctionInvocation %>
9
10}
11
12}
In this way, we can flexibly implement operations such as Ajax refreshing, not limited to controls such as FloatPanel.