Recently we had client experiencing an ugly error when adding a list item, which the error appears to be System.InvalidOperationException: There is an error in XML document (1, 43). Done lots of checks, but just couldn’t figure out why this happened until we found out it’s due to Internet Explorer 9!
I had the problem of page not able to redirect when in an ajax postback. It happens to be the fact that I disabled a line in web.config:
<add name=”ScriptModule” type=”System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35″ />.
This line should be added in HttpModules, so that redirection will work in Ajax postback. This class manages HttpModules for Ajax functionalities in ASP.NET.
This is a useful function for sending a message via Sharepoint:
private void SendEmail(SPWeb oWeb, bool appendHtmlTag, bool htmlEncode, String toAddress, String subject, String message, bool elevated) { //check if external email is set bool isExternalEmailSet = SPUtility.IsEmailServerSet(oWeb); if ((elevated == true) && (isExternalEmailSet == true)) {//run elevated SPSecurity.RunWithElevatedPrivileges(delegate() { SPUtility.SendEmail(oWeb, appendHtmlTag, htmlEncode, toAddress, subject, message); }); } else if ((elevated != true) && (isExternalEmailSet == true)) {//run un-elevated SPUtility.SendEmail(oWeb, appendHtmlTag, htmlEncode, toAddress, subject, message); } }
Today I was testing the loading time of my site, which I sometimes find it slow to access especially the first time loading. I knew there are a lot of images to be loaded especially those in portfolio sections but I also found that the biggest loading item seems to be ScriptResource.axd from Ajax. It was 330kb!
Recent Comments