Sunday, October 5, 2014

Deploy External user control through SharePoint Solution

Today’s topic actually nothing to do with SharePoint. This topic is same for Asp.Net and .Net applications. But I'm going to do it in SharePoint solution.

First Create SharePoint Solution in visual studio.  Open project package.

Capture11

Click on Advanced tab in Package.

Capture12

Click on Add button and Add Existing Assembly.

Capture13

Select the user control from the browse button. Select deployment target as GlobelAssemblyCache.

Add new item in SafeControls section. Fill namespace and Assembly name. Tick on Safe option.

Capture14

This will add dll into globel assembly cache do your job for you. Thank you.

Saturday, October 4, 2014

Multi select check box dropdown lists in SharePoint and Asp.Net (Client side value handling using JQuery)

Today I'm going to bring you one of interesting topic. Normally Asp.Net framework does not provide a Checkbox dropdown list control. Sometimes we got problems with UI aspect when we use Asp.Net Checkbox List control. So its important to keep it short in the page.

After few hours of searching in internet i found perfect solution to make my life easy.  Check box dropdown list. This will make my page shorter cause i got hundreds of values to show. I personally thanking the owner of this control cause this is well written control. Following link will guide you to the solution and the dll file. The solution is still a beta version.

http://www.dotnetfox.com/articles/dropdowncheckboxes-or-drop-down-checkboxlist-control-in-Asp-Net-1100.aspx

http://dropdowncheckboxes.codeplex.com/releases/view/70874

By the way i’m not going to talk about the server side aspect of the control. I found a problem of accessing this control selected values by client side. fortunately after few hours of playing around i found a way to get those values. the problem is with the control name.

Following shows to how to solve it.

First if you are developing web part you need to register this third party control. (Can use in asp.net also dll should gac in to the assembly on both occasions). Then need to add to the page.

Capture1

Capture2

Capture4

Then the stuffs. This is easy to handle in server side but not in client side.  This is how get those selected values to display on caption area in dropdown list by using client side.

Capture3

when getting values from this control we always need to add “_sl” to the end of control id. This will do it for you without a post back. Special thanks goes to Saplin.Controls. Thanks.