User controls are custom, reusable controls, and they use the same techniques that are employed by HTML and Web server controls. They offer an easy way to partition and reuse common user interfaces across ASP.NET Web applications.

learn more… | top users | synonyms

9
votes
2answers
7k views

Programmatically add JS/CSS to pages

I've created a Visual Studio SharePoint 2010 solution with an ASCX that adds some JavaScript files and CSS to the head of each page; this is based on this article. When I deploy the solution, it adds ...
7
votes
3answers
927 views

Visual Studio 2012. Visual webpart's ascx.g.cs file empty after registering any control

I've discovered a problem when a Visual webpart's g.cs appears to be empty. I'm using Visual Studio 2012 Update 3 and a project for SharePoint 2010. The steps to reproduce the problem: in Visual ...
6
votes
2answers
3k views

How do I add a custom control to the My Site person.aspx page?

I have created a server control and want to place it in the person.aspx page on the My Site however do not want to edit the page through SharePoint Designer but want to edit the file itself from the ...
5
votes
3answers
1k views

.Webs and anonymous access?

We're developing a public facing SharePoint site so it have anonymous access. To be able to run custom web parts that access lists/libraries we need to run with elevated privileges which works fine, ...
4
votes
3answers
417 views

Manage some state inside a Sharepoint WebPart

Considering a simple example of a webpart that adds items to a list based on a simple button click: public partial class MyVisualWebPartUserControl : UserControl { private int cont = 0; ...
4
votes
1answer
512 views

How to make a UserControl Minimal Download Strategy Compliant

I have a feature which specifies a custom user control to be added to the AdditionalPageHead delegate control as such: <?xml version="1.0" encoding="utf-8"?> <Elements ...
4
votes
1answer
2k views

adding link to suite bar in sharepoint 2013

I have followed the following liks to add custom links to sharepoint 2013 suite bar. http://blogs.msdn.com/b/findnavish/archive/2013/02/07/sharepoint-2013-customizing-suite-bar.aspx ...
4
votes
2answers
471 views

Opening a document in read-only mode using an external control

I have a .Net application that (amongst other things) provides a front end to a sharepoint document library. Users are able to open documents, and I use the Open Documents Control to do so ...
4
votes
2answers
560 views

Reuse the MiniContactCard from People Matches in SharePoint 2010?

Is the mini contact card, as seen in the People Matches section of a standard SharePoint 2010 search results page, a reusable component easily applied elsewhere? It has all of the bits we want to use ...
3
votes
4answers
575 views

Which is Better a UserControl or WebPart?

What are the advantages of user controls over WebParts when dealing with SharePoint? Some I can think of are: familiarity, reusability, and development speed. I am planning to implement them in ...
3
votes
1answer
2k views

How to import external javascript in a User Control?

I have a code-behind User Control (myUserControl.ascx and myUserControl.ascx.cs) that are in ControlTemplates/MyFolder/ and, in the code of myUserControl.ascx I need to use some javascript ...
3
votes
1answer
213 views

How to migrate c# application to Web Control to use in SharePoint application

I have created C# application which use Microsoft.SharePoint Namespace. That Application let the user to select the wiki page and available anchors inside that wiki page. Now I migrated that C# ...
3
votes
1answer
72 views

Template usercontrol hide based on page

Is it possible to hide a usercontrol that I have added to a custom template based on what page I am on. I have several pages that use the template but I only want one page to display the control the ...
3
votes
2answers
494 views

Custom User Control and FIPS Encryption Issues

I have created several custom user controls that I added to the Redering templates of some forms in a custom solution for WSS 3. Most of these templates have codebehind and they all are correctly ...
3
votes
3answers
2k views

ASP.NET User Control in SharePoint WebPart

I want to use the Visual Studio designer to make controls for my WebPart... I've been pointed to two approaches that seem ok. First, SmartParts... which I'll look into later. Second was to create an ...
3
votes
1answer
377 views

SharePoint List items, UserControls and cookies

I have another task at hand. I need to use cookies to read a title of an item from a custom list in SharePoint. This task is for SharePoint 2010. I have a container set up that will display the ...
2
votes
1answer
11k views

Calling the SP.UI.ModalDialog.showModalDialog method

My SharePoint solution has a userControl that Register a js block string getJS(string title, string htmlContent) { return (string.Format(@" ExecuteOrDelayUntilScriptLoaded(function ...
2
votes
1answer
655 views

Overriding GlobalNavigation Delegate control

I have overridden the GlobalNavigation delegate control and have been very pleased with the results. Now I would like to remove my global navigation from application pages that display in iframes ...
2
votes
2answers
31 views

User Control is is not rendering in pagelayout in MOSS2007

Hi I registerd user control in pagelayout and trying use that but it seem like it not rendering any thoughts %@ Register TagPrefix="sd" TagName="adbanner" ...
2
votes
3answers
4k views

Custom master pages used in multiple SharePoint 2010 sites

My company has just stated using SharePoint 2010 and I have been tasked with adding some custom functionality to the master pages - essntially we just want a global top navigation bar that contains ...
2
votes
3answers
30 views

Deleting user permissions from document library instead of site level

I wanted to delete a user permission from ONE of the various document libraries in a SharePoint site. But when i deleted the permission, it seemed to have deleted the user permission at a much higher ...
2
votes
1answer
89 views

Rich Text Control on a Layouts Page

I want to create and deploy a layouts page in a SharePoint 2013 environment. It is basically a form where you can store values. Is it possible to use the Rich Text Control which is utilizing the ...
2
votes
1answer
2k views

Customize Quick Lanch navigation

I have to create web control that can be placed to master page. This control should display Quick Launch navigation from web that is defined in control properties. Also this page should contain own ...
2
votes
1answer
91 views

How to upgrade a SharePoint 2010 Project to SharePoint 2013 (WebParts, MasterPage, App Page, User Controls) in Visual Studio 2012?

We have a SharePoint 2010 project solution which we are trying to uprgade to SharePoint 2013. This includes webparts, application pages, user controls, masterpage, etc. Foll. is the procedure we ...
2
votes
1answer
1k views

fully Customized Editprofile.aspx SP2010

I have to customize the EditProfile.aspx page that under the 14 Layouts hive. I know I can add fields in the user profile and make them show in the edit page , but this is a little more that what ...
2
votes
2answers
262 views

Storing farm level data for a web component

I've built a SharePoint user control (not a web part) and am deploying it via Solutions, Features, etc. It's a commercial component and I want to be able to store license information once it's ...
2
votes
2answers
1k views

Difference between Webparts and user controls?

Difference between Webparts and user controls?
2
votes
2answers
1k views

How to consume a custom sharepoint web service in a sharepoint user control

i have created a custom web service in sharepoint which works fine, i am trying to use this web service in a user control but get missing assembly reference error, i have copied the webservice dll in ...
2
votes
2answers
1k views

Tutorial for displaying a MessageBox in a WebPart [duplicate]

Possible Duplicate: Couldn’t find any way of displaying a message box in Visual Webpart 2007 (User Control) I have been working on SharePoint 2007 for more then a year but still don't have ...
1
vote
2answers
181 views

Registering all templates in folder /_controltempaltes/custom

I have a question regarding the directives in the MasterPage. So if I deploy a custom template to ControlTemplates in SharePoint folder, to use it I will need to write a directive which imports that ...
1
vote
2answers
3k views

Dynamically add controls to webpart without Postback?

Is it possible to dynamically add controls to a webpart without having a postback for example with AJAX/Java Script/jQuery/Partial Postback within SharePoint? I'm searching for some kind of ...
1
vote
3answers
4k views

SP2013: Adding a custom usercontrol to masterpage using Design Manager

I created a custom masterpage using the SP2013 Design Manager. I also created a SharePoint solution in Visual studio 2012 with a custom usercontrol (ascx) and custom webparts. The masterpage works ...
1
vote
1answer
2k views

Customizing SmallSearchInputBox default text

I am trying to customize the text displayed in the search box of my SharePoint site. The default is "Search this site...". I found a number of articles which explain how to do it (by overriding the ...
1
vote
2answers
3k views

How to add code-behind to a User Control?

I have a User Control (myUserControl.ascx) with the code: <div id="content"> TEST USER CONTROL <div> that is called from a webpart: protected override void OnLoad(EventArgs e) ...
1
vote
1answer
60 views

Loading a UserControl within another UserControl code

Can someone tell me how I can load a user control from within another user control. I'm using MOSS 2007
1
vote
3answers
229 views

Add user control or web part to every page in a site

I want to have a feature which causes the following to happen everytime any page in a site loads. I need to have a web part or user control which adds information about the current user to the page. ...
1
vote
3answers
917 views

user control losing new values when saving

I have a user control in a web part that pulls data from a SP list and displays it in standard ASP.Net controls. When I save the data, the old values seem to get saved even if I had changed them. I ...
1
vote
1answer
751 views

User control in delegate control

My question is regarding a delegate control called TopNavigationDataSource, normally when you create a delegate control you just define there some new properties etc. But what if I want to deploy ...
1
vote
3answers
4k views

Create SP People Picker on the client-side

I would like to know if there is a way to generate a SharePoint 2010 People picker control just with JavaScript. Imagine that I am doing a Windows 8 App, I would like to create that control ...
1
vote
1answer
98 views

How to upgrade user controls on Development Server

I just came across User Controls developed by developers who left company now, I tried looking on google on how to upgrade them on development server but couldn't find any blog or post regarding it. ...
1
vote
1answer
54 views

I want to know where are the timer jobs, webparts and user controls saved?

Are they saved in the content db or Layouts folder?
1
vote
4answers
46 views

Register user controls (ascx) in web.config?

Since ASP.NET 2.0 I usually register reusable user controls in web.config, rather then register it in every page with <%@ Register %> directives. Is there any "Sharepoint way" to do it for ...
1
vote
2answers
1k views

How to check if current user is member of the current site or above member group, site owner group etc

How can I do a check that looks if current user is a member group or above member group on current site? Above member group I mean site owner group etc.. So far I have done: var currentSite = ...
1
vote
2answers
64 views

sharepoint 2007 webpart question

I created a user control in visual studio I want to deploy to sharepoint 2007. This is my first one and I created the project using the repository pattern and POCO. Does sharepoint support this type ...
1
vote
1answer
829 views

SharePoint 2010 ASCX Edit withou WSP Deploy?

I have deployed an ASP.NET control in a wsp package. I would like to add some custom JavaScript and HTML to the .ascx file. Nothing that would need a recompile and re-deploy. Where is the actual ...
1
vote
1answer
66 views

Is it possible to write a feature to inject a custom control into a masterpage?

I have 3 site collections that need a specific css file, and to not have to make changes in multiple places our team has opted for a single masterpage. Instead of creating a second masterpage with a ...
1
vote
2answers
1k views

SPCalendarView control, same events are displayed each month in a VisualWebPart UserControl.ascx.cs file

I am creating a custom SharePoint Calendar to pull from multiple SharePoint Calendar Lists. In the markup I have the following: <SharePoint:SPCalendarView ID="EventsCalendar2" width="100%" ...
1
vote
1answer
118 views

How can I do a check if current user is following current site?

I have a usercontrol and inside its ascx.cs file I would like to do a check(if) if current user is following the current site. How can I accomplish that? So far I have done something like this: ...
1
vote
2answers
3k views

Can a user control be added to a Visual Web Part?

Can i add a user control to a Visual Web Part (in visual studio) in sharepoint 2010? I have a user control which has content that i want placed on most of my visual web parts. Has anyone got any ...
1
vote
1answer
1k views

Usercontrol RenderingTemplate and Code behind

Can I use code-behind in RenderingTemplate? It's not possible to just use code-behind like using it in an application page. What am I missing to use my own code inside a RenderingTemplate