Create a Site Definition file with Visual Web part in Visual Studio
I tried to create a site definition file in Visual Studio 2013 and SharePoint 2013 by following the MSDN tutorial:
Walkthrough: Create a Basic Site Definition Project. Near the end, I added a virtual web part control to the site definition and registered MyWebPartControls in the site definition's default ASPX page as written in the MSDN tutorial:
Unfortunately, IntelliSense doesn't show any MyWebPartControls: tags, and VisualWebPart1 is highlighted with a warning “Element 'SMWebPart3' is not a known element. This can
occur if there is a compilation error in the Web site, or the web.config file is missing.”
Since it’s a warning, I went ahead to build and deploy the solution. However, when I used the site definition template to create a subsite, it returned a parser error:
Unknown server tag 'MyWebPartControls:TestSiteDef1.VisualWebPart1'
I spent half day researching and debugging, and finally solved the problem. The issue is on the registration line:
<%@ Register Tagprefix="MyWebPartControls" Namespace="TestSiteDef.VisualWebPart1" Assembly="$SharePoint.Project.AssemblyFullName$" %>
The $SharePoint.Project.AssemblyFullName$ is a replaceable parameter to provide values for SharePoint solution items whose actual values are not known at design time. Unfortunately, it does not find the right assembly name during the deployment. It should
be replaced by the Assembly’s Strong Name. Here is how I fixed the problem step by step:
In Solution Explorer, open the package node and double click Package.package
Click Manifest tab in the Package.package.
Copy the full assembly name in the package’s manifest. It may be similar like this:
Assembly="TestSiteDef,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
Back to the site definition’s default.aspx page, replace the
Assembly="$SharePoint.Project.AssemblyFullName"
in the registration line with the copied text:
Assembly="TestSiteDef,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
Change the Namespace from
Namespace="TestSiteDef.VisualWebPart1"
to
Namespace="TestSiteDef".
The line to register the web part in a site definition file will look like this:
<%@
Register
Tagprefix="MyWebPartControls"
Namespace="TestSiteDef "
Assembly="TestSiteDef, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=a300f1f2da8ae976"
%>
Clean, build and deploy the solution. It works like charm. (Note: the warning message on visual web part may still exist, but you can ignore it).
Assuming your .ascx.vb file is inheriting from the web part class, you can add the custom properties in the same manor (language syntax aside).
Be sure to use the attributes to correctly identify and scope the properties. (see:
http://www.sbrickey.com/Tech/Blog/Post/SharePoint_Attributes_for_Web_Part_properties)
Scott Brickey
MCTS, MCPD, MCITP
www.sbrickey.com
Similar Messages
-
Certain data in a form Library is limited to a selected group of people (say Director's Group).
I have created a Director's view in the Form library.
Then created a Director's page with a web part connecting that Director's view to get the desired data.
Then I have hidden the view, since form library can have contribute permission to all the users.
Permissions to that Director's page is given to only Director's Group.
However, Director's Group would like to export the data to MS EXCEL. Is it possible?
If not, any workaround using OOB functionalities?
Thank you,
SRA
SRAEngineerHi SRA, if I understand your needs correctly, the following links provide the answer:
https://nazishqasim.wordpress.com/exporting-sharepoint-filtered-list-data-to-excelcsv-using-data-view-web-part-jquery-and-net/
http://danssharepointblog.blogspot.com/2013/10/how-to-create-export-to-excel-button.html
cameron rautmann -
Site definition files? anyone?
OK so I am new to website creation, so please cut me some
slack. Using Dreamweaver CS3 on a Mac, in the manage sites window,
none of the sites I created with Dreamweaver 8 are shown, yet they
all reside in a local sites folder in my documents folder. When I
choose the import function, it asks for the location of my site
definition files (ste) but none are visible anywhere on my system.
How do I import/recognise my previously built sites in Dreamweaver
CS3? Totally confused here...The sites *should* have been migrated when you installed CS3,
but you can
always go back into DW8, EXPORT the sites, then IMPORT them
into CS3.
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"Tik-Tok Man" <[email protected]> wrote in
message
news:fd4vjq$ddf$[email protected]..
> OK so I am new to website creation, so please cut me
some slack. Using
> Dreamweaver CS3 on a Mac, in the manage sites window,
none of the sites I
> created with Dreamweaver 8 are shown, yet they all
reside in a local sites
> folder in my documents folder. When I choose the import
function, it asks
> for
> the location of my site definition files (ste) but none
are visible
> anywhere on
> my system. How do I import/recognise my previously built
sites in
> Dreamweaver
> CS3? Totally confused here...
> -
How do I create an interactive PDF file with variable data
We would like to basically do a 'mail merge' of our list of customers with an interactive PDF file (including videos, menus, etc - not just form fill out and web links) to create a single PDF file that contains multiple mail pieces ... one for each customer ... with each mail piece being customized for that customer. Customizations would include different greetings (Dear Bob, Dear Dana, etc), as well as different charts based on data unique to the customer, different photographs, etc.
I've seen that InDesign and Acrobat Professional can be used to create an interactive PDF (such as from http://tv.adobe.com/watch/ask-the-adobe-ones/14-calling-rufus-about-interactive-pdf-making). However I don't understand how I can insert data from a database, csv file, excel file etc into the PDF file so that each page, or each set of pages, within the PDF can be customized.
Can anyone point me to a tool to use for this?
Thanks,
Bob KendallFor that kind of volume and unattended operation, you want InDesign Server – which is the server/high volume edition of INDD.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Thu, 3 Nov 2011 06:58:07 -0700
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: How do I create an interactive PDF file with variable data
Re: How do I create an interactive PDF file with variable data
created by Ti26E31DSxxx<http://forums.adobe.com/people/Ti26E31DSxxx> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4005459#4005459 -
How to create and save a file in flex web application ?
Hi,
I want to create and save a file form flex web application. Is it possible ?
I have done some googling and found that its only possible through file referece, which needs some serverside implementation be called.
Is it not possible with file reference to create and save file directly ?
Can any one suggest how to over come this.
Thanks in advance.Alex,
code written with the Flex Builder 3 libraries will certainly run in Flash Player 10. However, what you need is not so much the capabilities of FP10 but the library functionalities of the Flex 4 package. And I think that Flex 4 code will only run in FP10 and not 9 (but haven't tested this as at work we have not yet been permitted to upgrade, so there is not a lot of point going for Flex 4!).
Richard -
Hi,
I want to create a visual webpart which will read data from excel sheet and import it in to sql server database.(using sharepoint development)
I want to do it using visual webpart.
Please help to solve the issue.
Thanks in advance!
Regards
RajniHi Rajni,
Microsoft.Office.Interop.Excel assembly provides class to read excel file data, in your web part solution, reference the assembly, and following blog contains samples about how to read the excel file data,
and import it to SQL database.
1.Create a Visual Web Part Project:Create
Visual Web Parts in SharePoint 2010
2.Read the excel workbook by using SPFile class:
http://alancejacob.blogspot.in/2012/06/read-data-from-excel-file-and-insert-in.html
http://stackoverflow.com/questions/14496608/read-excel-file-stored-in-sharepoint-document-library
3.Export the excel workbook to SQL Server:
http://www.c-sharpcorner.com/UploadFile/99bb20/import-excel-data-to-sql-server-in-Asp-Net/
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Dreamweaver CS6 will not recognize existing site definition files
Neither does CC, naturally. These are sites I haven't edited for about a year. I can't find any information about reloading sites by importing the contents, only by opening the STE files... which in this case, won't open.
Are you attempting to simply open the .ste, or are you going to Site > Manage Sites > Import?
If you are tring to import them correctly (second option above) and they aren't importing, the .ste files may be corrupt. To create new site definitions from your existing content...
1. Go to Site > New Site
2. For the "Local Site Folder" browse to one of your current site folders on your HD
3. Add a server and FTP credentials obtained from your hosting company (if you don't have them)
4. Save
5. Repeat for each site
EDIT: If you don't have the site's files locally, do the same as above (setting the local site folder to an empty folder on your HD) and, once you add the FTP info, click the Get button (down arrow) in the Files window to download your entire site onto your machine. -
How do I create an after effects file with an interchangeable image
Hey,
hope someone can help me, I'm using after effects to create a mp4 file, it contains a photo which has a animation super imposed ontop of it.
When the projects finished the base photo that the animation is created around could change up three times a day.
What I'm trying to work out is a way for a non technical user to just be able to upload the new photo to somewhere and for the animation to be created and returned somehow to him so that the animator doesn't have to re open and edit the affect effect project each time a new photo comes in.
Is there a way to do this built into after effects does any one know?
Thanks for any helpFor that kind of volume and unattended operation, you want InDesign Server – which is the server/high volume edition of INDD.
From: Adobe Forums <[email protected]<mailto:[email protected]>>
Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
Date: Thu, 3 Nov 2011 06:58:07 -0700
To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
Subject: How do I create an interactive PDF file with variable data
Re: How do I create an interactive PDF file with variable data
created by Ti26E31DSxxx<http://forums.adobe.com/people/Ti26E31DSxxx> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/4005459#4005459 -
I can't open or save file with Java Web Start
Hi,
i can't open or save file with Java Web Start:
import java.io.*;
import java.util.*;
public class MetaDataFileCreator {
public String fileNameSpace = null;
public String fileName = null;
protected Properties file = null;
public MetaDataFileCreator(String fileNameSpace, String fileName) {
this.fileNameSpace = fileNameSpace;
this.fileName = fileName;
public void createMetaDataFile() {
try {
System.out.println("file METADATA");
ClassLoader cl = this.getClass().getClassLoader();
String nameFileMetaData = fileNameSpace + fileName + ".txt";
FileOutputStream fileOS = new FileOutputStream(cl.getResource(nameFileMetaData).getFile());
file = new Properties();
file.setProperty("aaaaa", "aaaa");
file.store(fileOS, "");
fileOS.close();
} catch (Exception e) {
System.out.println("Error writing metadata-file: " + e);
System.exit(1);
e.printStackTrace();
I have try also to open a file like this:
ClassLoader cl = this.getClass().getClassLoader();
file.load(cl.getResourceAsStream(nameFile));
also like this:
try {
fos = (FileOpenService)ServiceManager.lookup("javax.jnlp.FileOpenService");
fss = (FileSaveService)ServiceManager.lookup("javax.jnlp.FileSaveService");
} catch (UnavailableServiceException e) {
fss = null;
fos = null;
System.out.println("Error with JNLP");
System.exit(1);
if (fss != null && fos != null) {
try {
// get a FileContents object to work with from the
// FileOpenService
FileContents fc = fos.openFileDialog(null, null);
//FileContents newfc2 = fss.saveAsFileDialog(null, null, fc);
// get the OutputStream and write the file back out
if (fc.canWrite()) {
// don't append
os = fc.getOutputStream(false);
} catch (Exception e) {
e.printStackTrace();
also like this:
File f = new File((System.getProperty("user.home")+"x.txt").toString());
FileOutputStream fileX = new FileOutputStream(f);
OutputX = new PrintWriter(new BufferedWriter(new OutputStreamWriter(fileX, "UTF8")));
OutputX.println(....
but it doesn't work with Java Web Start.
Can someone help me?
How can I open or save file?
thank you.
SebastianoDid you specify <all-permissions/> in your JNLP file? Did you sign your code? What error are you getting?
-
How to create Auto complete text box in share point 2010 Visual web part
Hi All ,
I am want to use Auto complete text box in share point 2010 Visual web part ,data need to get from share point list how to create
please guide me how to use Auto complete text box
Thanking you,
Arun DarlyHi Arun,
Please refer to the following article.
SharePoint 2010: JQuery Autocomplete Textbox Containing List Items
http://smarttools.codeplex.com/wikipage?title=Autocomplete%20Text%20Field
Please don't forget to mark it as answered, if your problem resolved or helpful. -
Just where ARE the site definition files?
I've just received CS4. I want to move it to my more powerful laptop when I install it. I know how to do that and I can move site files, but where are the site definition files? I really don't want to have to set up each site from scratch. Is there one (or more) files that are the name, url, location, id, password etc for each of the (many) sites in CS3?
don CarlosTo import/export site definitions (not site files):
On the old computer:
Site > Manage Sites
Shift click to highlight all site names
Export..
Same procedure on new computer then Import.. -
Creating Player Problem from file with unknown content
Hi,
I need to create Player from video file with unknown content ie. from file "test.dat"
try{
MediaLocator ml = new MediaLocator(new URL("file:///D:/test.dat"));
Player p = Manager.createPlayer(ml);
catch(NoPlayerException npe){}
catch(MalformedURLException mUe){}
catch(IOException ioe){}
throws NoPlayerException
Pleeeease Help!!!I think it should be : "file:D:/test.dat" But i do believe that it will not work with a .dat file...
-
How to Add a User Control to a SharePoint 2013 Visual Web Part ?
Hi,
1.I have created SharePoint 2013 Farm Solution through VS 2012.
2.Added visual Web part
3.Created a User control (Farm Solution ) and added some Control From tool Box.
4.Drag and drop user control from solution explorer to visual web part.
so its Register tag and with prefix tag user controls automatically added on visual web part source. when i try to build solution it throws Exception:
Exception :The name 'InitializeControl' does not exist in the current context.
Please Provide solution after try/or proper workaround.
Thanks,
SiddheshwarSite name=http://sitename:22222/
Visual Web part:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Src="~/_controltemplates/15/SP2013Controls/SPControls.ascx" TagPrefix="uc1" TagName="SPControls" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SPWebpart.ascx.cs" Inherits="SP2013Controls.SPWebpart.SPWebpart" %>
<uc1:SPControls runat="server" id="SPControls" />
User Control Code:
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SPControls.ascx.cs" Inherits="SP2013Controls.ControlTemplates.SP2013Controls.SPControls" %>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:Button ID="Button1" runat="server" Text="Button" />
Deployement Location:{SharePointRoot}\Template\ControlTemplates\SP2013Controls\
After User controls added on webpart .g.cs file getting blank.
After 1st Build:
'InitializeControl' does not exist in the current context
The file '/_controltemplates/15/SP2013Controls/SPControls.ascx' does not exist.
after 2nd Build Try:
'InitializeControl' does not exist in the current context -
SharePoint 2013 Visual Web Part Custom Property.
How to create drop down control to display existing libraries in current web site using a custom web part property?i want to show this control on web part configuration.then users can select the relevant library without typing.(SharePoint
2013 Visual Web Part).
ThanksThis has been answered for SP 2010 at SP:SO. Things wont change much in SP 2013 as far as VWP is concerned. Basically you will need to implement Custom Web Part Editor.
http://stackoverflow.com/questions/6946153/edit-webpart-properties-with-dynamic-dropdownlist
Here is an example.
http://sptechbytes.blogspot.ca/2013/02/sharepoint-2010-creating-custom-editor.html
Amit -
Hi..
how to use Connectable Visual Web Parts in 2 different pages.
RavindranathThe old SharePoint framework has a framework for that, cross/page web part connections:
http://msdn.microsoft.com/en-us/library/dd585662(v=office.11).aspx I'm not entirely sure if you still can create those kind of web parts in 2010 and you'll have to find that out,
but the new web part connections framework doesn't support cross-page connections.
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com
Maybe you are looking for
-
I have used my older Mac Pro and now my new 2011 iMac fo play the many movies and TV shows I have dowloaded. Great results. But I also have a lot of Blu Ray disks. I am going to load windows 7 via Boot Camp for other reasns. After that is done, and e
-
I have to attach a pdf which i get from spool and also attach some files
hi , i have requirement where i have to send a pdf as attachment , this pdf is generated throught the spool request , along with this pdf i need to attach some files from the presentation server, i am using the fm SO_OBJECT_SEND, but the problem is i
-
Shift factor is not working with Depreciation Base method- 0004
Hello, When I am changing shift factor and variable depreciation portion in asset master data. Its not calculating depreciation as per shift factor. What can be the reason behind it. Even I have already maintained config in depreciation key also for
-
Incomplete print dIalog box when printing PDFs
During the past several weeks, whenever I try to print a PDF, the print dialog box (when Copies & Pages is selected in the pull-down menu) is blank ... I can't select how many copies or which pages to print. This only started happening recently, befo
-
NCR returns delivery with no value
Hi, I am using the process of returns in cross company. First I create the purchase order with a returns item checked. Then i create in migo the stocks movement. so far so good at this point. In vl04 i pick the purchase order and i want to make the d