Navigation

Search

Categories

On this page

Overriding Custom CSS in Sharepoint 2010
Turning on full error messages in Sharepoint 2010
Sharepoint Branding and Design
Creating a simple modal dialog box with Javascript in Sharepoint 2010
Export data to an earlier SQL Server version
Referenced Assembly Does Not Have a Strong Name
Searching the text of stored procedures
Sharepoint 2010 Developer Dashboard
SharePoint 2010: Connecting to SQL Server Using the External Content Type Feature
Sharepoint 2010 DateTime Control

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 405
This Year: 33
This Month: 14
This Week: 0
Comments: 17

Sign In
Pick a theme:

# Thursday, May 10, 2012
Thursday, May 10, 2012 3:16:00 AM (GMT Daylight Time, UTC+01:00) ( Sharepoint )


In SharePoint 2010 Microsoft has added the After property to <SharePoint:CssRegistration> to force custom CSS to always load after a specifi c CSS fi le, such as the out-of-the-box corev4.css. Here is an example of how to apply custom CSS in a SharePoint 2010 master page:

<SharePoint:CssRegistration name=”/Style Library/customstyle.cssAfter=”corev4.cssrunat=”server/>

The After property requires a more complete path to load CSS after fi les that are not the out-of-thebox CSS. The following code shows how to ensure that one custom CSS file is applied after another. Notice that the second one uses a more complete path for the After property because it is loading after a custom CSS file:

<SharePoint:CssRegistration name=”/Style Library/customstyle.cssAfter=”corev4.cssrunat=”server/>

<SharePoint:CssRegistration name=”/Style Library/secondfile.cssAfter=”/Style Library/customstyle.cssrunat=”server/>

Comments [0] | | # 
Thursday, May 10, 2012 3:02:00 AM (GMT Daylight Time, UTC+01:00) ( Sharepoint )

 

One of the first things you will realize when working on your custom master page is that when you make a mistake, SharePoint’s default error messages are rather unhelpful. As mentioned earlier, if you omit one of the required content placeholders and browse a site that uses your master page,SharePoint will reply with simply “An unexpected error has occurred.”  SharePoint can actually return descriptive error messages, but they are turned off by default for security reasons. If you are working in a development environment,
though, it’s imperative to enable these full error messages.

Here are the steps for turning on the full error messages:

1.  Log in to the physical SharePoint Server machine and navigate to the directory that holds your SharePoint website. It will most likely be located at C:\inetpub\wwwroot\wss\VirtualDirectories\ and will be in a subdirectory with the port number of your SharePoint site. If you have trouble finding it, you can open IIS7 and in the Sites folder, right-click your SharePoint site, and then select Explore. This will take you directly to the directory that holds your SharePoint website.

2.  Locate the fi le named web.config and open it for editing in Notepad.

3.  Press Ctrl+F and find the line of code that contains the word “callstack.” You will find a line that looks like this:

<SafeMode MaxControls=”200CallStack=”falseDirectFileDependencies=”10TotalFileDependencies=”50AllowPageLevelTrace=”false>

Change both the CallStack and AllowPageLevelTrace attributes from false to true.

4. Press Ctrl+F again and this time search for the word “errors.” You will fi nd a line that looks
like this:

<customErrors mode=”On/>
Change the mode from On to Off. This tells IIS not to show its customary basic error messages and to instead display the raw detailed error messages.
5. Save and close web.config. Note that this change will cause IIS to restart the web application in which your SharePoint site resides. Be careful when making edits to this file in production or shared development environments. 
With these changes in place, browsing a page with an error will now reveal the complete error message.

Comments [0] | | # 
# Wednesday, May 02, 2012
Wednesday, May 02, 2012 9:17:55 PM (GMT Daylight Time, UTC+01:00) ( Sharepoint )


This blog has a lot of great information on this topic:

http://erikswenson.blogspot.com/

Comments [0] | | # 
# Monday, April 30, 2012
Monday, April 30, 2012 2:05:42 AM (GMT Daylight Time, UTC+01:00) ( Sharepoint )
// Add a content editor Web Part to a page and add the following HTML.
----------------------------------------------------------------------------------------

<script type="text/javascript">
function OpenDialog()
{
  var options = SP.UI.$create_DialogOptions();
  options.url = "http://bing.com";
  options.width = 400;
  options.height = 300;
  options.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);
  SP.UI.ModalDialog.showModalDialog(options);
}

function CloseCallback(result, target)
{
  if(result === SP.UI.DialogResult.OK)
  {
    alert('You clicked OK');
  }
}
</script>
<input type="button" value="Show Dialog" onclick="OpenDialog()" />

This is a very simple dialog but it opens a large scale of possibilities: you can make server calls from within the dialog, you can host Silverlight applications.

When the dialog is dismissed, the code in the callback function is executed. This demo only displays a simple message, but based on the incoming result you can test whether the user clicked the OK or the Cancel button and other choices that have been made by the user in the dialog.

Comments [0] | | # 
# Wednesday, April 25, 2012
# Tuesday, April 10, 2012
Tuesday, April 10, 2012 6:28:53 PM (GMT Daylight Time, UTC+01:00) ( C# | VB.NET )
# Monday, April 09, 2012
Monday, April 09, 2012 6:18:00 PM (GMT Daylight Time, UTC+01:00) ( SQL )


Sometimes I need to look for all stored procedures containing <text>.  This is how you do it:

SELECT OBJECT_NAME(id) 
    FROM syscomments 
    WHERE [text] LIKE '%my search text%' 
    AND OBJECTPROPERTY(id, 'IsProcedure') = 1 
    GROUP BY OBJECT_NAME(id
Comments [0] | | # 
# Thursday, April 05, 2012
Thursday, April 05, 2012 9:07:00 PM (GMT Daylight Time, UTC+01:00) ( Sharepoint )

 

The Developer Dashboard is an instrumentation framework introduced in Microsoft SharePoint Foundation 2010. Similar in concept to ASP.NET page tracing, it provides diagnostic information that can help a developer or system administrator troubleshoot problems with page components that would otherwise be very difficult to isolate. For example, a developer can easily introduce extra SPSite or SPWeb objects into his or her code unknowingly or add extraneous SQL Server queries.

In the past, the only way to debug performance problems caused by the extra overhead of these instances in code would be to attach a debugger to the code and monitor SQL Server Profiler traces. With the Developer Dashboard, a developer can identify this type of problem, either programmatically by using the object model or visually by looking at page output.

How to turn it on and off: http://msdn.microsoft.com/en-us/library/ff512745.aspx

Comments [0] | | # 
Thursday, April 05, 2012 2:48:00 AM (GMT Daylight Time, UTC+01:00) ( Sharepoint )

 

This is a feature I’ve begun using quite a bit

http://www.dotnetcurry.com/ShowArticle.aspx?ID=794

Comments [0] | | # 
# Friday, March 30, 2012
Friday, March 30, 2012 7:38:32 PM (GMT Daylight Time, UTC+01:00) ( Sharepoint )

 

SharePoint also offers a DateTime picker control that you can use in your web parts and application pages. This control has the name DateTimeControl and is located in the Microsoft.SharePoint.WebControls namespace of the Microsoft.SharePoint.dll

http://karinebosch.wordpress.com/sharepoint-controls/datetimecontrol-control/

Comments [0] | | #