Questions tagged [visual-web-part]

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

Filter by
Sorted by
Tagged with
18 votes
4 answers
11k 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 ...
Denis Molodtsov's user avatar
15 votes
2 answers
30k 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!
xorpower's user avatar
  • 453
15 votes
3 answers
724 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 ...
domsen123's user avatar
  • 590
13 votes
5 answers
22k 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....
anpatel's user avatar
  • 385
10 votes
4 answers
8k 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 ...
empz's user avatar
  • 781
9 votes
3 answers
12k 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 ...
Hitesh Chandegara's user avatar
8 votes
3 answers
4k 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 ...
empz's user avatar
  • 781
8 votes
5 answers
28k 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 '...
Pranav Bilurkar's user avatar
6 votes
1 answer
5k 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.
Rameez's user avatar
  • 165
6 votes
4 answers
9k 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 ...
Amin Sayed's user avatar
6 votes
1 answer
150 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?
tomsmithweb's user avatar
5 votes
3 answers
12k 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 ...
Naveen's user avatar
  • 1,912
5 votes
1 answer
134 views

When developing web parts, which is better server context or client context?

When developing a webpart for deployment as a farm solution is it better to use the Sharepoint server context Microsoft.Sharepoint? Or is it a better practice to use the Microsoft.Sharepoint.Client ...
Brad Fortner's user avatar
5 votes
1 answer
4k 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 ...
Pouyan's user avatar
  • 475
5 votes
2 answers
12k views

How to change active directory password using Code?

How to change active directory User Account Password using code?
Rajesh Joshi's user avatar
  • 1,344
5 votes
2 answers
2k 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?
SNGOKUL's user avatar
  • 381
5 votes
1 answer
377 views

SPCalendarView not working properly in Sharepoint 2013

I have Created a Custom Calendar webpart using SPCalendarView type. After adding this webpart to my page it is not displaying any events and the navigation buttons(two arrow buttons) for changing ...
Unknown's user avatar
  • 309
5 votes
1 answer
6k 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 ...
Ronak's user avatar
  • 359
5 votes
1 answer
1k views

Print Gantt View

We need develop a custom webpart to print the Gantt view of a tasks list. Has someone developed some similar? We are trying to do it with the jsgrid library in JavaScript, using the ...
Clara Ruiz's user avatar
4 votes
3 answers
18k 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="...
Frank Martin's user avatar
  • 3,668
4 votes
1 answer
194 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 <...
Thirusanguraja Venkatesan's user avatar
4 votes
6 answers
17k views

the name 'initializecontrol' does not exist in the current context visual studio 2013

I am encountering this error when I create a visual web part in Visual Studio 2012: the name 'initializecontrol' does not exist in the current context visual studio 2013 Edit 1: the error appears ...
Imir Hoxha's user avatar
  • 1,905
4 votes
5 answers
5k 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\"&...
jjczopek's user avatar
  • 1,537
4 votes
1 answer
577 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 ...
Rajesh Joshi's user avatar
  • 1,344
4 votes
1 answer
422 views

Sharepoint 2019 visual webpart with SQL database

We are planning implement SharePoint 2019 on-prem to replace existing SP 2010 intranet . we have few SP visual webparts with SQL data sources that was build using VB.net . we like to know if it is ...
Homes's user avatar
  • 41
4 votes
2 answers
836 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 ...
George Norberg's user avatar
4 votes
4 answers
820 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 ...
alien_ru's user avatar
  • 103
4 votes
1 answer
679 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 ...
jjczopek's user avatar
  • 1,537
4 votes
2 answers
3k 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 ...
ninel's user avatar
  • 653
4 votes
1 answer
3k views

Unable to Edit Web Part Properties in Web Part Zone in 2013

I have a custom page layout that I have designed using Visual Studio. Within it I have several web part zones and I have a zone where I would like users to be able to edit the properties of the web ...
dsara's user avatar
  • 246
4 votes
1 answer
1k 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: <...
users1100's user avatar
  • 3,230
3 votes
3 answers
10k 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 "...
Mehwish's user avatar
  • 65
3 votes
2 answers
137 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 ...
Joseph D Surgeon's user avatar
3 votes
1 answer
4k 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 ";#"): ...
MyName's user avatar
  • 147
3 votes
2 answers
283 views

SP16 On-Premise - SPFx web parts or Classic web Parts?

My company has need to migrate web parts from SP07 to SP16 On-Premise. It is clear that all the logic from the old web parts will be written from the beginning. My question is what decision we ...
Goshky's user avatar
  • 2,058
3 votes
2 answers
2k 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(...
KidBatman's user avatar
  • 381
3 votes
3 answers
8k views

Unable to validate sharepoint date time control

I have added a <SharePoint:DateTimeControl> in my visual web part and I want to make it mandatory. To do so I referred this link and used as per my code. My code is: <tr> <td> ...
users1100's user avatar
  • 3,230
3 votes
1 answer
11k 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
James's user avatar
  • 91
3 votes
2 answers
569 views

Error in CAML query

Have I written the below CAML query correctly? Am I missing anything? I am encountering an error on below line of code. SPQuery spQuery = new SPQuery(); spQuery.Query = "<Where><And><...
Zakir HC's user avatar
  • 3,650
3 votes
2 answers
3k 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(), "...
Jason Kleban's user avatar
3 votes
3 answers
4k views

Missing my custom webpart property, what did I miss in my code?

I am using SharePoint 2013. I developed a visual webpart in visual studio 2013. I have added this code in the code-behind of my webpart: public partial class VisualWebPart1UserControl : UserControl { ...
Ola's user avatar
  • 4,405
3 votes
2 answers
7k views

How to add webPart to Page with PowerShell from WebPart Gallery

I want to get my Custom WebPart by name and add into a Page with PowerShell from (Web part gallery): --> Edit Page --> Insert --> Web Part --> Custom WebParts in image are added from Custom ...
Goshky's user avatar
  • 2,058
3 votes
1 answer
93 views

Read text file entry in visual web part (C#)

I have a text file with URL & active entry URL Active Http:// 0 http:// 1 I want to convert the file to a SharePoint list in visual web part
Aashirya's user avatar
  • 1,021
3 votes
1 answer
1k 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 ...
Dominik's user avatar
  • 392
3 votes
1 answer
53 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 ...
Erin L's user avatar
  • 4,038
3 votes
3 answers
4k 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. ...
Hitesh Chandegara's user avatar
3 votes
5 answers
4k 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 ...
ironman's user avatar
  • 1,110
3 votes
2 answers
763 views

how to use a people picker control in a visual webpart

I tried to create and use a People picker in my custom visual webpart by adding the Tagprefix and the peopleeditor control in my ascx page <%@ Register Tagprefix="SharePoint" Namespace="Microsoft....
mallu coder's user avatar
3 votes
1 answer
729 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 ...
Happy's user avatar
  • 513
3 votes
1 answer
2k views

Closing the Window from Visual Web Part Page in Chrome is not working

<script lang="Javascript"> function quitBox(cmd) { if (cmd == 'quit') { open(location, '_self').close(); } return false; } </script> <input ...
Ram's user avatar
  • 439

1
2 3 4 5
10