需要 Infopath 按钮中代码隐藏逻辑的输入
我有一个信息路径表单,当我单击按钮时,它应该重定向到共享点列表项的添加项模板。在我给出的后面的代码中,
try
{
string url = "Sharepoint List item's URL";
HttpContext.Current.Response.Redirect("url");
}
catch
{
}
但我收到了像这样的安全错误
System.Security.SecurityException 请求“System.Web.AspNetHostingPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败。 在 Activity_Profile.FormCode.btnNewReportingUnit_Clicked(对象发送者,ClickedEventArgs e) 在 Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent) 在 Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
请帮助我:)
I have an infopath form,when i click on the button it should redirect to sharepoint list item's add item template.. in the code behined i gave
try
{
string url = "Sharepoint List item's URL";
HttpContext.Current.Response.Redirect("url");
}
catch
{
}
But i am getting Security error like this
System.Security.SecurityException
Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at Activity_Profile.FormCode.btnNewReportingUnit_Clicked(Object sender, ClickedEventArgs e)
at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)
at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)
Please help me on this :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请尝试以下操作:
HttpContext.Current.Response.Redirect("url", false);
System.Web
并为其添加导入语句我认为这与表单没有完全信任有关,因此不允许重定向到任何地方。
Try the following:
HttpContext.Current.Response.Redirect("url", false);
System.Web
and add an imports statement for itI'm thinking this has to do with the form not having full trust and hence not being allowed to redirect anywhere.