Visual Web Part is a Web Part built using a User Control (.ascx)

learn more… | top users | synonyms

13
votes
4answers
8k 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 ...
9
votes
2answers
20k views

Difference between WebPart & Visual Web Part

I'm not sure how Visual Web Part is different from the actual Web Part in SharePoint 2010. Thanks!
9
votes
4answers
15k views

Error occurred in deployment step 'Recycle IIS Application Pool': Object reference not set to an instance of an object

I get this error in the deployment step of a share-point farm based project. Most of the suggested solutions on the net are a simple Visual Studio re-start, however, a simple VS restart won't fix this....
8
votes
4answers
6k views

Problem with HTTP Handler deployed on Sharepoint 2010

I've developed a Visual Web Part for Sharepoint 2010. I've used VS2010 to do that and tested the Webpart in a testing server using VS to do the deployment. But to deploy it on the production server I ...
8
votes
0answers
266 views

SharePoint 2013 Site Definition Toolbar Type Standard not showing

I have a problem with the toolbar type "standard" in SharePoint 2013. If I insert a XsltListViewWebPart with , there is no "New Element" button. And no "View Choice" and something like that. I've ...
7
votes
3answers
3k views

How to asynchronously load and refresh a Visual Web Part?

We have developed a Visual Web Part for Sharepoint 2010 with Visual Studio 2010 (Visual Web Part project template). The web part loads some stuff and shows a list of items. It takes some seconds to ...
6
votes
1answer
6k views

How to get attachment URL programmatically From SharePoint list item?

How to get attachment full URL programmatically From SharePoint list item? Explanation: I have adding new item with attachment. Now I have to bind that attachment link to grid. When click on that ...
5
votes
1answer
3k views

Getting Metadata column field control on Custom form in sharepoint

I have a custom custom sharepoint form which i have created using visual webpart. I want to have a Metadata field in my custom form.However, i am not able to find it in my ascx file. Please help.
5
votes
1answer
3k views

How to create a multilingual visual webpart in SharePoint 2013

Have anyone ever implemented multilingual visual web part in SharePoint 2013? I see there are many links out there on this topic but they are not cohesive and complete. I don't know how can I address ...
5
votes
1answer
108 views

Star Wars error “use the force”

Error when deploying a Visual Web Part: use the force attribute to explicitly re-install the feature. Is the force not with me? How do i use the force?
5
votes
2answers
323 views

Dynamically get List ID from List Name

In my Visual webpart I need to, based on the name of a list get the ID of the list, dynamically. I'm using C#. How can this be done?
5
votes
1answer
4k views

How to check for IsPostback in Visual Webpart

I have created visual webpart in SharePoint 2010 which will generate class file for class derived from Webpart and second for UserControl. Now I have TabStrip Control on .ascx markup. Now I want to ...
4
votes
3answers
6k views

Session and HttpContext not available in web part

I have a web part in which I have Grid View which displays data from a custom list. In the Page_Load I am initializing the DataTable. I want to store the DataTable object in Session object so that it ...
4
votes
5answers
4k views

Visual web part and custom web control - can't register

I have created visual web part and copied custom web control which I'd like to use. My control looks as below: namespace AppsListWebPart { [ToolboxData("<{0}:CustomImageButton runat=\"server\"&...
4
votes
1answer
395 views

Protect wsp file from Reverse Engineering

How to protect wsp file so no one can read my source code. When we change wsp file extension from wsp to zip, it gives all dll file and this dll can be extracted from .net reflector and get all source ...
4
votes
2answers
338 views

Site Columns JSLink doesn't work in custom XSLTListViewWebPart

I have a site column (Status) that I've added JSLink to, that runs my custom JavaScript. This works fine on lists. The JavaScript changes the text to a colored image. I've then created a Visual Web ...
4
votes
1answer
658 views

Visual web part - data binder issues

We have couple of lists in our application. Application types is a list which contains information about various applications - name, description and icon (as URL field with image format). Second one ...
4
votes
2answers
2k views

Create a custom error page to redirect to instead of generic AccessDenied.aspx?

When a user has not been given permissions to a particular site they receive the ugly "Error: Access Denied" page. Is it possible to capture this on one particular team site (via custom webpart) and ...
4
votes
1answer
531 views

Update panel not working in Safari browser

I have a visual web part in which one button and a label inside an update panel. When I run the web part in IE and Firefox it works fine but it does not work in Safari. My declarative part is: <...
3
votes
1answer
76 views

Which is recommended form control to use in SharePoint?

When trying to develop Web Part or Application page or modifying existing SharePoint application pages like (user.aspx, create.aspx, etc..) From below list which control is recommended to use <...
3
votes
2answers
344 views

Getting custom webpart property with JSOM

I have a webpart with a custom property setup like so: public static string TargetUrl; [WebBrowsable(true), WebDisplayName("My DisplayName"), WebDescription("My Description."), Personalizable(...
3
votes
4answers
4k views

Refreshing page or making it to respond after downloading the file. All happening in Webpart

I'm having a Visual Webpart that allows user to select Managed Properties and find out what is stored inside it. The result is displayed inside a gridview which he/she can export it to excel. It is ...
3
votes
1answer
3k views

How do I retrieve a user's LogIn name through the Created By column of a specific item in a document library

Created By Field Returns the following: 1073741823;#System Account I want the following without string manipulation (i.e. without using substring to remove all of the characters before ";#"): ...
3
votes
2answers
2k views

Page.ClientScript.RegisterClientScriptInclude in Sandbox?

I'm trying to use jQuery in a Sandboxed Visual WebPart (2010): protected void Page_Load(object sender, EventArgs e) { string jQuerySrc = Page.ClientScript.GetWebResourceUrl(this.GetType(), "...
3
votes
3answers
8k views

How to change active directory password using Code?

How to change active directory User Account Password using code?
3
votes
4answers
709 views

Problem with Visual web part

Good day! I have an event handler that, when you add a document to the library redirects the user to a web form with the parameters of the document. In the web form, it displays the current user in ...
3
votes
3answers
12k views

Error occurred in deployment step 'Activate Features'

I am creating and deploying Visual Web Part on SharePoint 2013 with VS 2013 as Farm Solution. When deploying Web Part on the server i get the following error: Error occurred in deployment step '...
3
votes
1answer
989 views

Show asp.net webpart elements based on user permission level?

I want to do the following: I have a webpart and two users (not in groups, though, because for a reason I don't understand there are no groups in the productive environment here ;) ). One stands ...
3
votes
3answers
3k views

How to create and write XML file in SharePoint /_layout folder using visual studio(programmatically)?

How to create and write XML file in below URL using visual studio(programmatically). web.Url + "/_layouts/MyPoject/Generated.xml" I want to generate XML programatically inside MyProject Folder....
3
votes
5answers
3k views

How to detect where a memory leak is in my application?

I have a web part that loops through web apps, sites, and webs. I'm using DoesUserHavePermissions() to check whether or not the user has access to the site. I'm getting an error and I've made sure to ...
3
votes
1answer
86 views

multi checkbox webpart properties

I wish to provide option to Select multiple option in my webpart Properties. Below code only allows me to Select one option. How to Select multiple options? Private colorPicked As MyColors Public ...
3
votes
2answers
1k views

Reading Web Part custom properties using JavaScript client object model in SharePoint 2010

Is it possible to read visual web part custom properties using Java script client object model in SharePoint 2010?
3
votes
1answer
304 views

Error: Sharepoint 2010 Web Part appears to be causing a problem. Invalid temp directory in chart handler configuration

I have a sp2010 website where I am trying to use a network path for the images as I have a WebFarm which is loadBalanced using CISCO ACE appliance hardware (without IP Stickiness). The reason I am ...
3
votes
1answer
1k views

Setting the DisplayFormURL of a CalendarView item to an absolute URL, SPCalendarView control

Background: I have a WebPart that makes use of the SPCalendarView control and in it I add items (events) dynamically from different Calendar lists from multiple sites. like this (please note that I ...
3
votes
1answer
416 views

Intellisense for Visual WebParts (ASCX) and Custom Application Pages (ASPX) in VS 2010

How can I enable intellisense for visual webparts (.ascx) & custom application (aspx) pages in VS 2010? It would save me a lot of time! Thanks in advance.
3
votes
0answers
2k views

Why Sharepoint FormField's ID is parametrized and how it can take different values after its initial creation?

In SPD 2010, on designer surface of a web part page I insert DataFormWebPart by: "Current Data Source" ("Data Sources Details" Task Pane) --> choose rows --> "Insert Selected Fields As.." --> "New ...
3
votes
1answer
218 views

Why Microsoft.SharePoint.WebControls over System.Web.UI.WebControls? [closed]

I am building visual web parts for SharePoint 2010 Foundation, using ASP.NET 3.5 in Visual Studio 2010. For those who are new, these are like making a custom "normal" .net control that you can drop ...
2
votes
5answers
4k views

Adding new webparts to an already deployed solution

I have a webpart project built in visual studio 2010 and it has been deployed successfully to my production environment. I recently had to make some changes to the webpart and also needed to add a ...
2
votes
3answers
8k views

How to change default VisualWebPart name

I am new to SharePoint 2010 development and just created a VisualWebPart in Visual Studio 2010 but it added the webpart as "VisualWebPart1". How do I change the default name of it and make it "...
2
votes
2answers
118 views

SharePoint Visual Studio Development

I need to understand the best practice for developing SharePoint solutions for sites that exist already on the production server. I am currently trying to create a visual webpart for a list that ...
2
votes
3answers
7k views

the file '/_controltemplates/.ascx' does not exist

I am making a visual web part which is referencing a user control. The code in SharePointProjectItem.spdata is given below. <ProjectItemFile Source="ExportUserControl.ascx" Target="...
2
votes
2answers
2k views

How to set visual webparts to load one after - another sharepoint 2010

I have a webpart page which have 2 custom visual webparts. When i set the debugger point on both the page loads of the webpart the 2nd visual webpart debugger is hit...that makes me think the 2nd ...
2
votes
1answer
5k views

How do I get the list item ID of an item I just created in a Visual Webpart

I have a visual webpart which creates a list item, but I need to reference the newly created item's ID for later use in the same webpart. How would I do this in C#? Thanks
2
votes
2answers
957 views

One Visual Webpart Multiple Times On Page (problems saving personalization state)

I have a requirement for building a budget report which has the same key fields for 6 different categories. I have written a visual web part which pulls a listitem for each section and displays the ...
2
votes
1answer
2k views

How do I set the Default Value of a TextBox ToolPart without using [DefaultValue(“Default Value”)]

Right now I have created a bunch of custom controls in the ToolPart panel and I want to set a default value for one of the text boxes. Obviously I want the value to be editable by the user. I have ...
2
votes
1answer
23 views

Format data from multiple lists in Visual Web Part formatted like Standard List

I'm trying to roll data from multiple lists into one web part using Visual Studio, preferably a Visual Web Part. I want it to look like a normal SharePoint list view, with options to sort, filter, and ...
2
votes
2answers
71 views

Cannot write file in a folder

I cannot write a file into a folder through some code in a VisualWebPart in a Sharepoint 2013 solution. I've given write permission to c:\myfolder to Everyone. The code I use to write is the ...
2
votes
1answer
162 views

Create a VisualWebPart from Picture Library

I've a Picture Library to which I added pictures,now i want to create a Visual Web Part which displays a list of pictures added to library like this I created the similar design in ascx file like ...
2
votes
1answer
800 views

User profile picture in visual web part

I want to make user upload the profile picture in my web part, I searched over the internet how to accomplish this? I found the this post which describes how to get it. My code is: void ...
2
votes
1answer
786 views

need to display image of the user in the people picker, Sharepoint 2013?

In the people picker, the attributes it shows are name,designation and their online or offline status, Is it possible to display the image of the person?