如何从EventHandler - ItemAdded打开URL链接到SharePoint列表? 我试过了:SPUtility.Redirect,properties.RedirectUrl但它不起作用,mayby我做错了什么。请帮忙。如何从EventHandler打开URL - ItemAdded [SharePoint 2010]
感谢, 六合
如何从EventHandler - ItemAdded打开URL链接到SharePoint列表? 我试过了:SPUtility.Redirect,properties.RedirectUrl但它不起作用,mayby我做错了什么。请帮忙。如何从EventHandler打开URL - ItemAdded [SharePoint 2010]
感谢, 六合
我不知道你是否仍然有同样的问题。 反正以下链接可能有助于某人。
http://www.sharepointkings.com/2008/06/redirection-from-event-handler.html
这一页,但是,不正确地解释HttpContext的是如何工作的
public class **CustomEventReceiver** : SPItemEventReceiver
{
private HttpContext _currentContext = null;
public CustomEventReceiver() : base()
{
if (null != HttpContext.Current)
{
_currentContext = HttpContext.Current
}
}
public override void ItemAdding (SPItemEventProperties properties)
{
// Here one can use _currentContext and redirect ...
}
}
应该牢记类名称必须以获得HttpContext的匹配。
此代码适用于我。
这将需要将事件处理程序从ItemAdded切换到ItemAdding。 –
嗨,它不工作;(我使用:SPUtility.Redirect(“http:// xxxx:xx/sites/xxx/Lists/test/AllItems.aspx”,SPRedirectFlags.Trusted,HttpContext.Current);'和我有一个comunicat NullrefereceException – user900258