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.
6
votes
2answers
4k 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 ...
6
votes
2answers
2k 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 ...
4
votes
3answers
833 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
370 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
2answers
469 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
1answer
1k 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
169 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
66 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
421 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
138 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 ...
3
votes
1answer
287 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
...
3
votes
1answer
355 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 ...
2
votes
4answers
477 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 ...
2
votes
1answer
7k 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
552 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
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
1answer
1k 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
28 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
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
230 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
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
1answer
304 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
2answers
448 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
134 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
1answer
1k 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
2k 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
2answers
2k 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
31 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
2answers
187 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
307 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
552 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
2k 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
89 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
2answers
62 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
397 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
54 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
607 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
1
vote
1answer
766 views
What date picker controls are available to enter a date range inside a custom web part?
I have a custom web part that executes a SharePoint search query and displays the results. I'd like to add controls to the web part so that users can select a date range (ie. start date and end date) ...
1
vote
2answers
153 views
Creating Custom List Forms for Creating, Editing, or Displaying a List Item
I'm following this article (as well as different MSDN pages) and trying to add some custom template forms to my content type.
I think I'm doing all by the book, but for some reason wont deploy my ...
1
vote
1answer
2k views
SharePoint 2010 : Visual Webpart - Multiple User Control
SharePoint 2010: Visual Studio 2010
I have requirement : i have one web part and using custom web part property i load 4 different user control.
Solution 1 : I created web part and using custom web ...
1
vote
1answer
330 views
ListFieldIterator doesn't return value of Enterprise keywords
In my project I use ListFieldIterator control to allow users view and change meta data values. I can read values of ListFieldIterator fields with code like this:
object value = ...
1
vote
1answer
180 views
Refining search results on multi-word names
I have a basic people search landing page setup with the standard webparts for searching: PeopleSearchBoxEx, PeopleCoreResultsWebpart, etc.
On the page I make use of the RefineSearchResults web ...
1
vote
1answer
271 views
first visit to site loads page twice
I create a new Site Collection within an existing SP Web Application. The new Site Collection is created as a child of an existing Site Collection (the Root Site Collection in the Web Application) ...
1
vote
2answers
1k views
1
vote
1answer
1k views
Unable to resolve The file '/_controltemplates/xxxxxxx.ascx' does not exist.
I have developed a custom user control and loading it in a webpart, the aim to run the webpart from bin with custom policy.
I made the WSP Builder generate the CAS policy and it does contain the ...
1
vote
0answers
15 views
Issue between user control and Visual webpart
I have user control in my master page (countrycontrol.ascx) on clicking the user control It will show links, user is allowed to select the country based on the selected country the visual webpart need ...
1
vote
1answer
69 views
Ajax Calendar Extender Position is not working in SharePoint Webpart
I am using Ajax Calendar Extender, but it is not pop up next to textbox, it is appearing int the middle of the page.
Here is the code:
<asp:TextBox ID="dtEnginerring" runat="server" ...
1
vote
0answers
98 views
Cannot save field values from ListFieldIterator to list item
I have the following issue. I created rendering template for list. This template is shown in New\Display\Edit forms. Then i've created two user controls: "mainCard" and "mainCard_Info". First control ...


