I'm hitting this and having the issue that, despite setting the
AllowUnsafeUpdates property, I'm still getting the error. when the
searchAlert.Update function is called.
Any tips?
using (SPSite site = new SPSite(SPContext.Current.Site.Url))
{
using (SPWeb web = site.OpenWeb())
{
site.AllowUnsafeUpdates = true;
web.AllowUnsafeUpdates = true;
web.Update();
SearchServiceApplicationProxy proxy = (SearchServiceApplicationProxy)
SearchServiceApplicationProxy.GetProxy(SPServiceContext.GetContext(site));
KeywordQuery query = new KeywordQuery(proxy);
query.ResultsProvider = SearchProvider.Default;
query.QueryText = queryString;
SearchAlert searchAlert = new SearchAlert(site, query);
searchAlert.Update();
}
}