未捕获的Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:该程序集不允许部分信任的调用者。 [英] Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: That assembly does not allow partially trusted callers.

查看:113
本文介绍了未捕获的Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:该程序集不允许部分信任的调用者。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

protected void grdmissedapp_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Message")
            {
                GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                HiddenField hdnEmail = (HiddenField)row.Cells[2].FindControl("hdnEmail");
                string email = e.CommandArgument.ToString();
                if (!string.IsNullOrEmpty(email))
                {
                    Outlook.Application oApp = new Outlook.Application();
                    Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem);
                   oMailItem.To = email;
                    // body, bcc etc...
                    oMailItem.Display(true);
                }
            }
            if (e.CommandName == "Call")
            {
                GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer);
                Label lblcall = (Label)row.Cells[1].FindControl("lblcall");
                ImageButton btncall = (ImageButton)row.Cells[1].FindControl("btncall");

                if (lblcall != null)
                {
                    lblcall.Visible = true;
                    lblcall.Text = e.CommandArgument.ToString();
                    btncall.Visible = false;
                }
            }
        }







调用上述方法本地它工作正常,但当我在服务器上传它不工作错误显示



未捕获的Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:该程序集不允许部分信任的来电者。



此错误也会在本地发生但工作正常




on calling above method locally it works fine but when i upload it on server it not working error shows

"Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: That assembly does not allow partially trusted callers."

this error also occur locally but works fine

推荐答案

请检查

assembly-does-allow-allow-partial-trusted-caller [ ^ ]


在.aspx页面的顶部,将EnableEventValidation设置为false。


这篇关于未捕获的Sys.WebForms.PageRequestManagerServerErrorException:Sys.WebForms.PageRequestManagerServerErrorException:该程序集不允许部分信任的调用者。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆