コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null != Request.QueryString["type"] &&
                Request.QueryString["type"] == "build")
            {
                JavaScriptSerializer jss     = new JavaScriptSerializer();
                AjaxContext          context = new AjaxContext();
                context.Html = string.Empty;
                try
                {
                    context.IsSuccess = true;

                    BuildModelsAndPermissions();
                }
                catch (Exception ex)
                {
                    context.IsSuccess  = false;
                    context.Source     = ex.Source;
                    context.Message    = ex.Message;
                    context.TargetSite = ex.TargetSite.ToString();
                    context.StackTrace = ex.StackTrace;
                    if (null != ex.InnerException)
                    {
                        context.InnerException = ex.InnerException.ToString();
                    }
                }
                string error = jss.Serialize(context);
                Response.Write(error);

                Response.Flush();
                Response.End();
            }
        }
コード例 #2
0
ファイル: Map.aspx.cs プロジェクト: Jitlee/LPS
        protected void Page_Load(object sender, EventArgs e)
        {
            if (null != Request.QueryString["type"]
                && Request.QueryString["type"] == "build")
            {
                JavaScriptSerializer jss = new JavaScriptSerializer();
                AjaxContext context = new AjaxContext();
                context.Html = string.Empty;
                try
                {
                    context.IsSuccess = true;

                    BuildModelsAndPermissions();
                }
                catch (Exception ex)
                {
                    context.IsSuccess = false;
                    context.Source = ex.Source;
                    context.Message = ex.Message;
                    context.TargetSite = ex.TargetSite.ToString();
                    context.StackTrace = ex.StackTrace;
                    if (null != ex.InnerException)
                    {
                        context.InnerException = ex.InnerException.ToString();
                    }
                }
                string error = jss.Serialize(context);
                Response.Write(error);

                Response.Flush();
                Response.End();
            }
        }