0

404 page not found error on deployment of SharePoint hosted App in SharePoint 2013

SharePoint 2013 is quite exciting for me due to the new things/improved things presented to developer community. I liked the app concept and wanted to try hands on that. Picked up a SharePoint Hosted app, and just did a using VS 2012 and as Pressed F5 to see this running. Well, I was asked to trust the application and I thought..wow , its nice…Trusted It…what the HECK, I landed to a 404 page not found page. Binged…found that this is not just me who have got this issue….Took a step back and trying to understand , why is it coming…

Well, as this was a SharePoint hosted app, SharePoint deploys all the files to a special App domain where your App lives. When a user accesses your App, they are redirected to a page that lives in the App domain, which has a peculiar url something like http://app-c1043465e318cb.sedwdev-apps.local .

I just added another binding to the web application in the IIS. and VOILA…the deployment works.

Hope this will be useful for someone is struck with similar issue 🙂

Happy Learning…

0

Change SharePoint Site URL

In my project, After we had created the site where data from another blogging platform has to be migrated, we got a Change request to change the URL of the site. With my SharePoint 2007  experience, i really got worried that it might push our GO live date . Searched on internet and really did not find much there which has to be really easy. Just decided to navigate to

 Site Settings >> Title, description, and icon … and realized that now with name of the site , we have option to change the URL too..

Change URL

Wohoooooooooooooo…This was what we wanted. Seems to be very simple, but , believe me, If this would not have been provided, we would had a bad time 🙂

0

Firefox settings to avoid prompt for SharePoint Sites

We all complain about Firefox prompting for password each time we access any SharePoint Site. Here is a workaround or may be fix to avoid that.

  •  Open Firefox browser.
  • Enter “about:config” in address bar and click enter. You should get either below screen or just go to the about:config page.

             Firefox alert

  • Click on “I’ll be Careful, I promise!” and proceed.
  • In about Config page, enter “network.automatic”.
  • In the list, double-click “network.automatic-ntlm-auth.trusted-uris”
  • Enter the URL for which you’d like to enable integrated Authentication(i.e do not want any prompt for authentication). To enter multiple urls, separate them by commas.
  • Click OK

You are done. Have a hassle free experience in Firefox for SharePoint Sites .

0

Handle Rich Text Editor In SharePoint

While accessing a data from a list where we have rich text editor, We might get an unexpected problem. While getting the data from list item columnusing listitem[“Column Name”], in case of rich text field, we get entire HTML data.

This might be a problem when you are doing a ciustome web part and retrive data .The HTML might break some of ur desired HTML.Lets say if you need your entire string to be stripped off all tags, Below code will be helpful.
plainText= Regex.Replace(html, @"]*>", "");
Use namespace System.Text.RegularExpressions to make Regex available. html is variable having the HTML content.

0

Re-Occurance ID in SharePoint Events

While working for one of my projects, We were required to display an “add to outlook” link to enable users to add events from sharepoint webpart to their outlook. I used below format to get the data for a particular event
http://[web site url]/_vti_bin/owssvr.dll?CS=109?Cmd=Display&CacheControl=1&List=[List GUID]ID=[Item ID]&Using=Lists%2fEvents/event.ics
Everything were working fine , and came to know about one issue with this functionality. The issue was with repeating events, while adding any item , it was blocking the calkendar from first to last day of the repeating(re-occuring) event. OMG!!!!!
Initially thought that this is how sharepoint works, but was not able to believe this and then i started looking into the out of box behaviour of re-occuring events. and then noticed that the re-occuing events are shown as single event in full calendar view.
That where i realized an important property named ReoccuranceID in for events. Each event item has this property. For normal events, its same as the event ID but for repeating event we get a particular occurance, where as the event id gets us entire series of that event.
just modified the above mentioned link to
http://[web site url]/_vti_bin/owssvr.dll?CS=109?Cmd=Display&CacheControl=1&List=[List GUID]ID=[ReOccurance ID]&Using=Lists%2fEvents/event.ics

The reoccurance id has a value something like 967.0.2011-09-29T14:00:00Z.
This contains a identifier , Date and Time Zone information of the event occurance.
Hope this will help someone.

0

Time Zone For SharePoint User



While working for projects where users are located in different time zones…and The SharePoint server is located in one particular time zone, it becomes a tedious work when it comes to display or deal with events occurring across different timzones using code.

The Time Zone can be managed at three levels. Web Application level, Site Collection level and user Level.
If we wanna do a setting of Time zones to users’ current time zone using code, Its quite straight forward..Well not that much straight 🙂
Below code can be used to Set the time zone for a user once he logs into a page.

SPWeb webCurr = SPContext.Current.Web;
SPUser curruser = SPContext.Current.Web.CurrentUser;
string strReturn =
@”Time Zone: [TimeZone]“;
try
{
if (curruser.RegionalSettings == null)
{
SPRegionalSettings regsettings =
new SPRegionalSettings(webCurr, false);
ushort intTimeZoneID = GetTimeZoneID(strTimeZone);
if (intTimeZoneID != 0)
{
regsettings.TimeZone.ID = intTimeZoneID;
webCurr.AllowUnsafeUpdates = true;
curruser.RegionalSettings = regsettings;
curruser.Update();
webCurr.AllowUnsafeUpdates = false;
}
string strData = strReturn.Replace(“[TimeZone]”, strTimeZone);
return strData;
}
else
{
string strData = strReturn.Replace(“[TimeZone]”, curruser.RegionalSettings.TimeZone.Description);
return strData;
}
}
catch (Exception ex)
{
return “Error ” + ex.Message;
}
finally
{
webCurr = null;
curruser = null;
}

Considering that the strTimeZone is The time zone picked from the browser location using JavaScript.
This will work easily for any user ..ahhhh not all users…
We will get an Err0r ” Thread is aborted” which is not able to tell you what is wrong there..
anyways… Look for a group where you have assigned Read access to your user. A small change would be required for such users’ permission. Navigate to the permission properties…and check the checkbox for Edit personal user information in the list of available permission at Site
That’s it..You are good to go and the time zone would be set to all users based on their current location(time Zone).

0

Mobile Access of a SharePoint Site

We all know that , we can access any SharePoint Site on Mobile, and this capability is in built. I am not sure hoiw many of us , have tried accessing this. I am sure, who all have tried that, would not have been much impressed, as it brings up a entire site and library structure , and it does not provide much on content. For Publishing portal, this is not a problem. We see, published content.
Anyways, reason for this blog is to make one option available for users to see entire web site as they see on their browser. A small Configuration change is required to achieve that.
Action:
Just navigate to the web application web config folder and look for App_Browser folders. You should be able to find two files. Edit the File conpat.browser in. Change the attribute IsMobileDevice to false for the mobile devices for which you do’nt want the Mobile View of the Site. Save and IISRESET (Just to make sure, things get effected). and, You are Done. 🙂

0

Use Inbuilt Sharepoint Modal PopUp

While doing developement with MOSS , any notification or popup was invitation to Javascripts and several other way of doing modal popup. Guess What, SP 2010 brings Modal Dialog Framework supported with Javascript client object . I really do not have to write much as already few nice articles are written.
I am drafting this blog to have these article listed for reference. Thanks to Lee and Jonathon
1) Display a SharePoint Modal Popup
2) Modaling to a page