Converting an InfoPath Filler Form to a Web Based InfoPath Form

So, I’ve been working on an InfoPath form that was passed down to me and originally created as a Filler form. I finally completed it and needed to publish it, but there was a problem; its a filler form not a web based form. So, I had to reconfigure the form to work in a web browser and not try to launch in InfoPath filler.

The first step was to change the form to a Web Browser Form by going to the File tab > Form Options

InfoPath Options Menu

Next, you’ll want to go into the Compatibility section of the Form Options menu
Continue reading

Advertisements

SPMetal with Anonymous Access

So, I recently ran into a problem with using SPMetal with anonymous access. When Anonymous users access a web part that runs LINQ queries, they’ll get prompted for credentials in SharePoint 2010. The problem is actually related to the way the LINQ code works. It uses the default SPContext.Current to get the site objects. This becomes a problem when you need to run a piece of code with elevated permissions because without rebuilding the SPContext.Current, you’re still using the default permissions. With the default permissions, as an anonymous user, you will not have enough access to make calls using LINQ and as a result, you’ll be prompted to log in.

This blog had an okay solution:

Use the HttpContext object to force all SP objects to be created again. When this happens within the RunWithElevatedPrivileges method, the SPContext is recreated with this higher level of priveleges.

This code has its problems though.

Continue reading

SharePoint 2010 CSS Chart

I found a fantastic resource for someone who is branding SharePoint 2010 or implementing their own custom design.

It is a detailed chart on what CSS classes are used in SharePoint 2010, where they are used, and a graphic outlining the areas they effect. The author even includes the CSS tags that are used so you can easily copy & paste them into your Style Sheets.

I would recommend taking a look at this if you’re planning on stylizing SharePoint 2010. I wish I would have found it earlier!

Thanks go out to the SharePoint Experience for putting the list together.

http://sharepointexperience.com/csschart/csschart.html

CSS Only Menu

So, I recently decided I was tired of JavaScript and ASP.NET Menu controls. As a result, I challenged myself to create a CSS only menu provider. It was surprisingly easy.

First, I set up my parent and Child Menus like so:

 
Continue reading

JQuery in ASP.NET Applications – My jDiv Solution

So, I have a general frustration with working with jQuery in an ASP.NET application. The first, and most obvious, is the ugly markup the HTML controls output. The muddled IDs and the inability to add custom HTML attributes is frustrating.

So, I’ve begun work on a set of classes & controls to help developers work with jQuery in a .NET application.

So far, I’ve composed a jDiv class to use from code behind to generate clean Div tags with as many classes & custom attributes as you like. Also, you can add as many children jDiv elements as you’d like and then just call the parent’s .ToString() method to output all of the markup. This may sound simple, but it is a great tool when you want to use server side C# or VB to output some data, then you want to use jQuery to animate it. The .ToString() method will output the markup, which you can easily output to a clean div.

Continue reading

Editing the View of a List in SharePoint Designer

I ran into a problem earlier this week where I needed to add an image link to a view in SharePoint 2010. After some head scratching and googling, I came across a good walk though on This Blog that shows you how to edit the  list view markup to contain a custom image.

Before you do this, make sure you throw a few test items in your list, it allows you to select the hyperlink in design view.

If you read the blog link posted above, then skip this next step. But before adding the image you’ll need to either write or generate some xsl script. The easiest way to do this is to let SharePoint Designer generate it for you by opening your list in SPD. When you follow the steps below, SPD automatically converts the standard List View into an XSL List View.

Continue reading

Conditionally Hiding the Ribbon Based on User Permissions

So, I recently needed to hide the SharePoint 2010 ribbon. After trying several different options, I found a very simple, but solid, solution.

To start you’ll need to crack open your master page in SharePoint designer.

Next, find the <div id=”s4-ribbonrow” class=”s4-pr s4-ribbonrowhidetitle”> tag that should be just a few lines below the head tag on the standard SharePoint 2010 V4 master.

Now, you’ll want to add a SPSecurityTrimmedControl to the page like the one below.

Continue reading