Posts

Showing posts from 2013

How to fix Web Part problems

If a web part or web part connection is corrupted or did not install properly might be a little bit tricky to remove or update the web part as you usually do. Sometimes, you will receive "Unexpected error has occurred" message, or a "#" symbol will be added at the end of your aspx page URL avoiding you to remove or update the corrupted web part in the "normal" way. There is an easy way to fix the corrupted web part by adding "?Contents=1" at the end of the Address Bar as showing in the following example: http://SiteName/Page.aspx ? Contents=1 The Page.aspx is the aspx page where your web part is placed on. The SiteName is the name of the site where the page that contains your web part is. Once you include  the "?Contents=1" at the end of your Address Bar, y ou will be redirected to the Web Part Maintenance page (You must have the appropriate permissions to use the Web part Maintenance Page). Now, make sure that you are in

Differences between "Throw","Throw ex" and "Throw new Exception(...)" in .NET

The T hrow statement is used to inform about the occurrence of an exception when a program is executing. Exceptions contain a property named StackTrace . This string contains the name of the methods on the current call stack, apart from the file name and line number from where the exception was thrown for each method. There are 3 different ways to use the Throw statement: Throw Ex:   The original stack trace will be overwritten with a new stack trace that starts from the throwing method. Throw:   Preserves the original stack trace information because rethrows the original exception. Throw new Exception(...): Keeps original stack trace and adds aditional details.        Example: class Maths {     static void Main(string[] args)     {         try         {             MethodX();         }         catch (Exception ex)         {             // Throw Ex  - Method X stack trace (Method Y has been overridden)             //Exception: System.DivideByZeroException: Attem

How to auto save a browser enabled info path form every X minutes in Sharepoint 2007, 2010 and 2013

Info Path forms can be saved automatically every X minutes by updating the FormServer.aspx file. This update will avoid for users to lose their information when the session has expired and they forgot to save the form. The following code add some conditions so only the forms within a specific site and form view will be saved . I recommend you to copy the FormServer.aspx file before start with the changes to facilitate the file recovery if it fails. Update the FormServer.aspx file using a text editor as following:   If you are using SharePoint 2007: Include before the   </head>  tag    the following: < script language ="javascript" type ="text/javascript" > var timer_is_on = 0; var t; function doTimer() { clearTimeout(t); if (document.URL.indexOf( "SiteName" ) != -1) if (g_objCurrentFormData[9] != "FormViewToExclude"  && PostbackBody.intPostbacksInProgress == 0) if (!timer_is_on) { timer_is_on