• 无回调刷新


    1)aspx页面关键句

    ; 2)初始化:很可能需要在Page_Load中使用 this.ClientScript.GetCallbackEventReference(this, "arg", "context", null);//初始化CallBack 初始化的目的在于使ICallbackEventHandler接口中的方法可以正确的被调用。 也可以使用 Page.ClientScript.GetCallbackEventReference(Page, "argument", "processCallbackResult", "context", true); processCallbackResult是arcgis server环境中自带的一个javascript函数(具体位置:C:\Inetpub\wwwroot\aspnet_client\ESRI\WebADF\JavaScript\display_dotnetadf.js(181):function processCallbackResult(response, context) )

    3)消息提示框的内容的实现:

    可以通过页面对ICallbackEventHandler接口的继承

    private string _callbackArg;

    string ICallbackEventHandler.GetCallbackResult()

    { return RaiseCallbackEvent(_callbackArg); }

    void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)

    { _callbackArg = eventArgument; }

    //获取传回页面的字符串

     public virtual string RaiseCallbackEvent(string responseString)

    {

    UserInfo ui = (UserInfo)Session["SessionUserInfo"];

    if (ui == null || ui.userID == 0) return ""; // break out the responseString into a querystring Array keyValuePairs = responseString.Split("&".ToCharArray()); NameValueCollection m_queryString = new NameValueCollection(); string[] keyValue; string response = ""; if (keyValuePairs.Length > 0) { for (int i = 0; i < keyValuePairs.Length; i++) { keyValue = keyValuePairs.GetValue(i).ToString().Split("=".ToCharArray()); m_queryString.Add(keyValue[0], keyValue[1]); } } else { keyValue = responseString.Split("=".ToCharArray()); if (keyValue.Length > 0) m_queryString.Add(keyValue[0], keyValue[1]); } // isolate control type and mode string controlType = m_queryString["ControlType"]; string eventArg = m_queryString["EventArg"]; if (controlType == null) controlType = "IsNull"; string sql = string.Empty; DataTable dt = null; int chkNum = 0, chkNewNum = 0, chkMsgNum = 0, ShareNum = 0, ShareNewNum = 0; int newCount = 0, chkPassNum = 0, chkRejectNum = 0; switch (controlType) { case "QueryMsg": break; case "Ctluserzone1_DrpCountry": break; case "Ctluserzone1_drpProvince": break; case "Ctluserzone1_drpCity": break; default: break; } return response; }

    4)把设置好的控件转化为html字符串

    private string GetHtmlContent(Control control)

     {

    System.IO.StringWriter sw = new System.IO.StringWriter();

     HtmlTextWriter writer = new HtmlTextWriter(sw);

     control.RenderControl(writer);

    string htmlContent = sw.ToString(); sw.Close();

    return htmlContent;

     }

    本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/neverain/archive/2009/11/06/4776349.aspx

  • 相关阅读:
    Learning Rhino 1
    Learning Rhino 2
    JavaScript tips and tricks 5
    Observer pattern in JavaScript
    敏捷开发的原则
    什么是CLS?
    整理一些小东西,留个备份
    一个调查结果(在下一个版本的VS/C#中你想要什么?)
    如何知道一个类都实现了哪些接口和从那个类继承
    敏捷软件开发主要包括哪些方法
  • 原文地址:https://www.cnblogs.com/wangzihao/p/1939895.html
Copyright © 2020-2023  润新知