Show a WebPart view in a visual studio site definition

Hi Guys ,
i developed a Site definition in VS. In this Definition i have a list instance  based on Promoted link template (type 170).Now i want to show in the Deafault.aspx a view of the promoted link but when i put the snipet
<WebPartPages:WebPartZone runat="server" FrameType="TitleBarOnly" ID="full" Title="loc:full">
<WebPartPages:XsltListViewWebPart runat="server"
ListUrl="Lists/List1"
IsIncluded="True"
JsLink="clientTemplate.js"
NoDefaultStyle="TRUE"
PageType="PAGE_NORMALVIEW"
Default="False"
ViewContentTypeId="0x">
</WebPartPages:XsltListViewWebPart>
</WebPartPages:WebPartZone>
the server respond me  : ..Type 'Microsoft.SharePoint.WebPartPages.WebPartZone' does not have a public
property named  'XsltListViewWebPart'. I added
<%
@RegisterTagprefix="WebPartPages"Namespace="Microsoft.SharePoint.WebPartPages"Assembly="Microsoft.SharePoint,
Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>
but it doesn´t work..
Any suggestion?

Hi gohberto,
Before <WebPartPages:XsltListViewWebPart> tag,you can add <zoneTemplate>
Here is a code snippet for your reference:
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main">
<ZoneTemplate>
<WebPartPages:XsltListViewWebPart runat="server" ListUrl="Lists/My List" [abbreviated...]>
<XmlDefinition>
<View Name="Some View" Type="HTML" Hidden="TRUE" TabularView="FALSE" DisplayName="" Url="View.aspx" Level="255" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png">
<Query>
<OrderBy>
<FieldRef Ascending="FALSE" Name="ID"/>
</OrderBy>
</Query>
<ViewFields>
<FieldRef Name="ID"/>
</ViewFields>
<RowLimit Paged="TRUE">1</RowLimit>
<Aggregations Value="Off"/>
<Toolbar Type="Standard"/>
</View>
</XmlDefinition>
<DataFields>
</DataFields>
</WebPartPages:XsltListViewWebPart>
</ZoneTemplate>
</WebPartPages:WebPartZone>
Here is a similar thread for your reference:
https://social.msdn.microsoft.com/Forums/sharepoint/en-US/7740935e-d4d7-46f8-9dac-09b9c46855c6/type-microsoftsharepointwebpartpageswebpartzone-does-not-have-a-public-property-named-webpart?forum=sharepointcustomizationlegacy
Best Reagrds
Zhengyu Guo
TechNet Community Support

Similar Messages

  • How to change the default text "There are no items to show in this view" in the visual webpart

    Hi,
    I am using a visual webpart and in that if there are no items in the list it is showing the default text "There are no items to show in this view." I want to change this default text. 
    I checked the forums here there are multiple ways are shown but no one is working for me.
    Kindly help me to change this text.
    Thanks in advanced.

    It seems you're retrieving items inside a specific you.. why not having a <div> inside you're visual web part and check to see if the count of items retrieved is > 0 then insert that in the div, otherwise, insert your custom message and not rendering
    the web part itself. What you're describing is the default message from SharePoint which comes from default views, and this can be changed from xslt in SP 2010 or in JSLink in SP 2013, here's a link how to do so in JSLink :
    http://www.idubbs.com/blog/2015/jslink-csr-to-override-there-are-no-items-to-show-in-this-view/ .
    But as said, since you're doing a visual web part, keep your stuff in the visual web part and check for the count of items before adding the rendered data to your div.  
    Mohamed Derhalli
    SharePoint Consultant
    Blog: SharePoint Thoughts
       Twitter:
    LinkedIn:
      

  • Windows 7 Oracle 10.2.0.3.0 ODAC 1020221 Visual Studio 2005 Package L. Fail

    The operation system on my laptop is Windows 7 Home edition 32 bits. On the latop Oracle 10.2.0.3.0.
    That works perfectly.
    Also installled Visual Studio 2005 Professional.
    If I install ODAC1020221 on the laptop Orale Explorer is available in the View menu of Visual Studio 2005.
    If I start Oracle Explorer in the view menu of Visual Studio, Visual Studio comes with the Package Load Failure
    Package 'Oracle Developer Tools for isual Studio.NET' has failed to load properly (GUID= {D601BB95-E404-4A8E-9F24-5C1A462426CE}
    Starting gacutil has no positive result
    Who can help me that it will work so i can use ODP.NET with Visual Studio.
    Kind Regards Frank Hagen

    The operation system on my laptop is Windows 7 Home edition 32 bits. On the latop Oracle 10.2.0.3.0.
    That works perfectly.
    Also installled Visual Studio 2005 Professional.
    If I install ODAC1020221 on the laptop Orale Explorer is available in the View menu of Visual Studio 2005.
    If I start Oracle Explorer in the view menu of Visual Studio, Visual Studio comes with the Package Load Failure
    Package 'Oracle Developer Tools for isual Studio.NET' has failed to load properly (GUID= {D601BB95-E404-4A8E-9F24-5C1A462426CE}
    Starting gacutil has no positive result
    Who can help me that it will work so i can use ODP.NET with Visual Studio.
    Kind Regards Frank Hagen

  • Error with windows phone 7.1 in visual studio 2010 ultimate

    System.ArgumentNullException
    Value cannot be null.
    Parameter name: parentContext
       at Microsoft.Windows.Design.Metadata.ReflectionMetadataContext..ctor(IMetadataContext parentContext)
       at MS.Internal.Host.ProjectMetadataContext..ctor(IMetadataContext platformMetadata, AssemblyReferenceProvider referenceProvider)
       at MS.Internal.Host.ProjectMetadataContext.FromReferences(AssemblyReferenceProvider referenceProvider)
       at MS.Internal.Designer.VSDesigner.GetMetadataForDesignerContext(DesignerContext designerContext)
       at MS.Internal.Host.PersistenceSubsystem.Load()
       at MS.Internal.Host.Designer.Load()
       at MS.Internal.Designer.VSDesigner.Load()
       at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.Load()
       at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedDesignerFactory.Load(IsolatedView view)
       at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
       at MS.Internal.Host.Isolation.IsolatedDesigner.BootstrapProxy.LoadDesigner(IsolatedDesignerFactory factory, IsolatedView view)
       at MS.Internal.Host.Isolation.IsolatedDesigner.Load()
       at MS.Internal.Designer.DesignerPane.LoadDesignerView(Boolean isReload)
    this error occurs all the time i tried to open a windows phone aplication and i dont no wtf is this?

    Hi PedroMartins221,
    From your error message looks like it is a VS designer issue, I would recommend you do the same as Ken suggested, besides keep your windows update and reboot the device machine should help.
    Another possibility is maybe you update with Silverlight 5.0, as I can see from a old post:
    https://social.msdn.microsoft.com/Forums/en-US/5964a4c7-7a5b-4d09-a672-268d37aad1ff/windows-phone-7-designer-view-error-in-visual-studio-2010-ultimate?forum=vswpfdesigner uninstall Silverlight 5 might help.
    Give a try and let's see if this helps.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Can Visual Studio 2013 installed on Windows 7 cause Bug check in NTFS driver?

    Hello!
    I installed Visual Studio 2013 on Windows 7. Shortly after that Bug check of NTFS started periodically happen.
    Does VS install any drivers and therefore may be the cause of the bug check?
    Thank you

    Hi,
    Visual Studio 2013's target platform include Windows 7 Service Pack 1, Windows 8, Windows 8.1, Windows Server 2008 R2 SP1, Windows Server 2012, Windows Server 2012 R2.
    For more information, please view this article:
    Visual Studio 2013 Compatibility
    http://www.visualstudio.com/products/visual-studio-2013-compatibility-vs
    For further help, I would like to suggest you ask MSDN Visual Studio Forum:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=vssetup&filter=alltypes&sort=lastpostdesc
    Note: add your exact error message or symptoms.
    Karen Hu
    TechNet Community Support

  • All "Site Content and Structure" default views incorrectly showing "There are no items to show in this view"

    Hi All,
    On my SharePoint Online site (Office 365) all my “Site Content and Structure” default views are showing “There are no items to show in this view”. For example the “Checked out To Me” view shows “There are no items to show in this view” (shown in screenshot
    below). I know this is incorrect and should show at least ten items that have been checked out to me for over two months. I am also a member of the Site Collection Administration and Owner groups.
    What I am trying to do is view all the "Checked Out items" within a Site Collection including it's sub-sites.
    Is there a feature that needs to be activated to get the correct information from the “Site Content and Structure” default views?
    I hope you can help
    Colin

    Hi Colin,
    As I understand, all “Site Content and Structure” default views are showing “There are no items to show in this view” in your SharePoint online site.
    Check things below:
    1. Go to site content and structure logs in site setting to check if there is correct information.
    2. Create a new site collection to check if there are items in Site Content and Structure.
    3. Switch another computer to check if it can work.
    If the issue still exists, I recommend you to post it in the O365 forum.
    http://community.office365.com/en-us/f/default.aspx
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Best regards,
    Sara Fan
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How To: Use Visual Studio, IIS Express, and Adobe Edge Inspect to view local projects

    You CAN view a Visual Studio project with Adobe Inspect. The work around takes a little bit of time.
    This involves using IIS Express to run your Visual Studio project, which is mainly a setting in Visual Studio, a Firewall change, a few command line and IIS Express config change.  It isn't actually all that bad, but will make your life A LOT easier.
    Here are the steps. (Note these are steps I used for Visual Studio 2012 and your project is part of a solution project.  Windows 7 or Windows 8)
    1. If IIS in not turned on, turn it on.How to: Enable Internet Information Services (IIS) - this should install IIS Express as well.
    2. In Visual Studio, find the port that Visual Studio will be using for your project by Running your web project (Debug), and note/write down/save the port number that shows up in the browser when the project launches. (ex.  http://localhost:12345)
    3. Add a NetShare Reservation (process for this will be different for Windows XP)
    Go to your Command Line (CMD) in Windows and in c:\Windows\system32> type in
    netsh http add urlacl url=http://yourIPaddress:yourPortNumber user=everyone
    (ex. netsh add urlacl url=http://12.34.56.78:12345 user=everyone)
    Hit Enter key. You should be a successful add reservation message
    3. Go to your Windows Explorer (File system) and go to c:/Users/YourName/MyDocuments (or Documents)/IISExpress/config/ and open 'applicationhost.config'
    In the 'applicationhost.config' file find your site in the <sites> section.
    Example:
    <sites>
    <site name="WebSite1" id="1" serverAutoStart="true">
                    <application path="/">
                        <virtualDirectory path="/" physicalPath="C:\MyProjects\TestSite" />
                    </application>
                    <bindings>
                        <binding protocol="http" bindingInformation=":12345:localhost" />
                    </bindings>
                </site>
    </sites>
    In this section ADD 2 new lines to the <bindings> section. Note add your own IP address and your own Computer Name
    <binding protocol="http" bindingInformation="*:12345:12.34.56.78" />
    <binding protocol="http" bindingInformation=":12345:MyComputerName" />
    Save the config file.
    4. Open up your Windows Firewall and go to 'Advanced Settings'. Here you want to create an Inbound Rule.
    Right click on Inbound Rule and select New Rule
    - Rule Type select 'Custom'
    - Program leave this
    - Protocol and Ports > Protocol Type select 'TCP' then Local Port select 'Specific Port' and fill in the port number you got from VS.  Leave Remote Port alone.
    - Scope
    There are a few ways of doing this. Typically you would go the the Remote IP address and select 'These IP addresses: and select ADD > select 'Predefined set of computers' and choose Local Subnet.  IF this does not work leave Remote IP addresses > Any IP address option selected instead.
    - Action leave this
    - Profile select Domain and Private
    - Name put IISExpressWeb for the name
    Select 'Finish'
    5. Go to Visual Studio. (Note if you have multiple projects in your solution, choose your start up project. Right click on your project in Solution Explorer in VS and select 'Set as Start Up Project' )
    Right click on your start up project again and you should see an option to 'Use IISExpress'
    In the DEBUG dropdown (from the main menu bar at the top) select 'YourProjectName Properties'. Mine was the last one in the list with a wrench icon next to it.
    This should open an new tab in your project, You should see a left hand list of option and a right hand column of options.
    In the left column select 'Web' and in this tab select Use Local IIS Web server and select 'Use IIS Express' and type in your IP Address and port number (same as before) in the Project Url text box.
    Save.
    NOW, you should be able to run your project in Visual Studio and use Adobe Edge Inspect on your device and view new results in Chrome. You can develop from there.
    If you still can not see it working, please be sure your device is on the same SubNet or Wireless network as your computer.  If you are in a large network but the domains can still see each other, the Firewall Setting detailed above to allow Any IP Address in your Scope section.

    Hi CMosqueda,
    Thank you for taking time to share this information with other users.
    Thanks,
    Preran

  • Visual Studio Projects Not Showing FileVesion Leading Zeroes in File Properties

    I created a simple Visual Studio 2013 windows form application setting the AssemblyInfo.cs file as show below.
    // You can specify all the values or you can default the Build and Revision Numbers
    // by using the '*' as shown below:
    // [assembly: AssemblyVersion("1.0.*")]
    [assembly: AssemblyVersion("1.0.0.0227")]
    [assembly: AssemblyFileVersion("1.0.0.0227")]
    [assembly: AssemblyInformationalVersion("0.0.0.0227")]
    I built the application and went to the Windows File Explorer and brought up the file properties. What I see is that the product version showing the leading zeros, but the file version field does not show the leading zeros.
    It appears to be a bug either with Visual Studio or with Windows. Which one is it and is there a fix?

    Hi Sarah,
    We can't see the screenshot. Do you mean you use Windows Explorer to browse to the AssemblyInfo.cs file and check the property?
    If you change the product version or the file version from the AssemblyInfo.cs file, you need to firstly rebuild the assembly, then if you go to the debug/release folder, check the property of the assembly file, the Details tab will show you the corresponding
    changes of these properties. It's the assembly property but not the cs file property.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Visual Studio Community 2013 does not show database explorer

    I am a Newbie who wants to learn web development. it seems in older version of visual studio, when you add a database item in solution explorer there is a database explorer.
    but now in my visual studio 2013, if i add a database item, there is no database explorer to let me browse table or others below. Why? I installed SQL express and Visual Studio on windows 8.1 x64
    Also any pointers to free tutorial on the internet that lets me learn and practise working with database in a web application?

    Hello Lenny,
    Can you see Server Explorer in your VS? What about show us a sceenshot so that we can understand your problem.
    I do not have VS 2013 Community right now but in my point of view you should have related components. I will also install VS Community later and share you some info.
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Visual Studio Tabs - Show Title instead of Work Item Number?

    When opening individual work items in Visual Studio, the tab in the document well just says "Task 100485" or "Bug 38374".  Is there a way to instead have it show the Title of the work item?  Just showing the number isn't really
    helpful when quite a few are kept open.

    Hi Brian,  
    Thanks for your post.
    We show view the work item Title in each opened work item form in VS. As the work item’s tab has fixed width in VS, so if show the work item Title in each work item’s tab in VS, it will costs the wide width, if work item’s title is long, maybe two or three
    work item tabs can show in VS at the same time.
    As far as I know there’s no default way to change work item’s tab show work item Title in VS. For this scenario, please
    submit it to User Voice site at: http://visualstudio.uservoice.com/forums/121579-visual-studio. Microsoft engineers will evaluate them seriously.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why does Visual STudio 2012 References keep showing Exclamation mark (which means assembly is missing) even after I specify the exact path?

     Our web application at work requires Visual Studio 2012
    For one of the projects within the Visual Studio 2012 Web Application Solution, we need the System.Web.Mvc in the References.
    I already have the following in the packages folder:
    {blah...blah..Visual Studio Solution path..blah}\packages\Microsoft.AspNet.Mvc.5.1.1\lib\net45\System.Web.Mvc.dll
    I keep adding it, but the References still shows the Exclamation mark ( which means missing) next to the System.Web.Mvc
    Why does it keep showing the Exclamation mark ( which means missing) , even after I specify the exact path to the System.Web.Mvc.dll ?

    Hi cslewis33,
    Thank you for posting in MSDN forum.
    Based on your issue, if you want to add the System.Web.Mvc reference for a web application in VS2012. As far as l know that the System.Web.Mvc dll is default be located like this path:" C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Mvc.dll.
    So if you create the web app using c# language, I suggest you can right-click your Reference under the we application -> Add Reference->select the System.Web.Mvc in the Assemblies tab.
    If the above suggestion still could not help you, I suggest you can consult this issue directly to the ASP.NET forum:http://forums.asp.net/ , maybe you will get better support.
    Thanks for your understanding.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why Visual Studio 2013 express edition always show repair or uninstall when I open it??

    I don`t know why my Visual Studio 2013 express edition always show repair or uninstall when I open it??
    I install it yesterday and it worked fine, but today when I open it, its says repair or uninstall all the time.... Anyone know why?
    Hellpppp

    Hi,
    I think your VS may have been corrupted. I suggest you click "repair" to repair your VS.
    If it can't solve your issue, please use ISO file to reinstall it.
    If you used a web installer, please download the ISO file from the website.
    http://search.microsoft.com/en-in/DownloadResults.aspx?q=Visual+Studio+Express+2013
    Before you reinstall it,please use this tool
    http://support.microsoft.com/kb/841290 to verify hash of the ISO. Any discrepancy would indicate that the file was corrupted.
    The sha1 value of ISO could be found in "Install Instructions".
    If you have made sure your ISO file have no problem, please reinstall it.
    If you have any further question, please feel free to let me know.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Visual Studio 2013 hangs/freezes when trying to click the designer view

    my Visual Studio 2013 update 1 hangs/freezes when trying to click the designer view, after clicking "Design" I can not click "split" neather "Source". What can I do ? I already tried to set the "HTML (Web Forms) Editor
    " as "Default"... thanks for support.
    In VS2010 the same worked fine.
    I "Run as Administrator".
    ty for help

    Hi,
    I assume that you are not using VS2013 Express version. In order to get the reason about the hang issue, please use devenv /log to gather activity.xm log and find HR error from this log.If it shows some package corrupt, try to repair your VS.
    Here are my general suggestions:
    Please try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.
    Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. Also you can try these command lines:
    devenv.exe /resetskippkgs and devenv.exe /resetuserdata 
    Try to create a new user account. This can help isolate user profile corruption related causes.
    If the suggestions above are no help, please reinstall your VS.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Visual Studio 2010 Upgrade - Unable to view some reports

    I converted an application that had been developed in VS2005 so that it would run in VS2010.  The application contains several Crystal Reports.  Now when I debug the application I can only view some of the reports.  With the others I get an exception with the message "Unable to find the report in the manifest resources.  Please build the project and try again." 
    The ones that work and the ones that don't all have the Build Action set to Embedded Resource.  I have tried removing a report from the project and then adding it back, but that made no difference.  A new report displayed fine. 
    Does anyone have any ideas about what could cause some of the reports to throw this exception?

    OK, here is the link to the thread I am replying to Visual Studio 2010 Upgrade - Unable to view some reports
    And here is what I posted to start the thread that I am replying to:
    I converted an application that had been developed in VS2005 so that it would run in VS2010. The application contains several Crystal Reports. Now when I debug the application I can only view some of the reports. With the others I get an exception with the message "Unable to find the report in the manifest resources. Please build the project and try again."
    The ones that work and the ones that don't all have the Build Action set to Embedded Resource. I have tried removing a report from the project and then adding it back, but that made no difference. A new report displayed fine.
    Does anyone have any ideas about what could cause some of the reports to throw this exception?
    As you can see, I have described the exception that occurs when I try to view some, but not all, or the reports while debugging.  I have also tried deleting a report and adding it back in but it made no difference.
    Is this enough information?

  • Visual studio 2012 the name "initializeControl" does not exist in the namespace in visual WebPart

    Hi All,
    I'm trying to create a visual webpart in SharePoint 2013 using Visual Studio 2012 and I am seeing that the file ascx.g.cs
    is missing and i have this error in file ascx.cs : the name "initializeControl" does not exist in the namespace.
    And like i said i use VS2012 Ultimate
    Can anyone Help me please!!!
    thanks.

    In most scenarios this is caused by some error in code preventing Visual Studio from generating the designer file. You could try to undo the latest changes and see whether the item is being generated or not. Additionally you could try checking if the custom
    tool is still associated with the Visual Web Part SPI in the Properties Window.
    w: http://blog.mastykarz.nl | t:
    @waldekm | c: http://mavention.codeplex.com | c:
    http://mavention.nl

Maybe you are looking for

  • Converting Decimal to Interger value in a Column

    Hi Folks, We have a requirement with column name as Customers having two calculated column values with total and % of Customers in pivot table view.                      Total Number of Customers         % of Customers Customers:             500.00  

  • Need info on communication from server to flex

    Hi Can anyone let me know how asynchronous communication from server to flex UI takes place?? What are all mechanisms I can be able to use?? How can I do that??/ Thanks in Advance Aruna.S.N.

  • How to raplace resource files in jar file by other files?

    Can I replace resource files (ex: some jpeg file which is in the jar file) when midlet execute on the phone. Is it possible? Usualy, we use getResourceAsStream(filename) to get resource data as stream. Is there some API function like 'setResource(fil

  • Got lost on Setting up a PHP development environment for Dreamweaver

    I am following Dave Powers article on building a dynamic website. I am using Mac 10.6.7 and Dreamweaver CS5. I have downloaded Dave's example file and tried putting it on the desktop that didn't work. Next I tried dragging it into the website folder.

  • Best way to apply a new ACL to an interface that has a ACL already applied

    Hello All: I am in the process of cleaning up an ASA 5510 that I have inherited and have a question about applying a new ACL to an interface that is working correctly now with another ACL. The main purpose is I want to change the name of the ACL an c