开发者

Replacing SharePoint menu with custom asp.net menu

开发者 https://www.devze.com 2023-03-03 19:20 出处:网络
I have a custom menu I built that I would like to deploy to my SharePoint Site\'s Master Page. I have the asp.net menu build as a c# project is VS2010, but have no idea how to deploy it to SharePoint

I have a custom menu I built that I would like to deploy to my SharePoint Site's Master Page.

I have the asp.net menu build as a c# project is VS2010, but have no idea how to deploy it to SharePoint. Once compiled, the project of course creates a dll file and has a few .config files.

Where can I place these files? I heard in the GAC but I am not sure where that specifically is (folder) on the server. Also, will I be required to Reference that dll in my project (point it to the GAC on the Sp2010 server)?

What is the standard, most accepted way of deploying a custom asp.net menu to a SharePoint Master Page?

Thanks

In Addition: After playing with this, I create a VERY simple asp.net menu in Visual Studio 2010. The following is the entirety of my default.aspx file:

<%@ Page Title="Home Page" Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<html4f><body><head runat="server"></head>
<form id="Form1" runat="server">
 <asp:Menu ID="Menu1" runat="server">
    <Items>
        <asp:MenuItem Text="Menu1" Value="Menu1">
            <asp:MenuItem Text="SubMenu1" Value="SubMenu1"></asp:MenuItem>
            <asp:MenuItem Text="SubMenu2" Value="SubMenu2"></asp:MenuItem>
        </asp:MenuItem>
        <asp:MenuItem Text="Menu2" Value="Menu2"></asp:MenuItem>
    </Items>
</asp:Menu>
</form>

Root web folder after publish:

Replacing SharePoint menu with custom asp.net menu

Bin folder:

Replacing SharePoint menu with custom asp.net menu

How do I add this to my SharePoint master page file? I now realize I need to add the dll's (all of them?) to the Sharepoint BIN folder for that particular site collection, as well as modify the web.config file, but I am unsure how to find out the information I need to do so开发者_如何学JAVA. The .config files require some "keys" and I am unsure how to find out the GUID for the dll's I am using? This should be a simple thing - add a menu to sharepoint, but finding I don't know what to search for in order to proceed. Thanks for any help you can offer.


Good morning,

This is pretty simple actually -

1) The DLL and whatever config files you need should go to the Bin folder of the site (c:\inetpub\wwwroot\wss\ViritualDirectories\\BIN).

2) Add the DLL to the GAC (This may or may not be required; if the control doesn't hit SharePoint, no security needed so GAC may not be required.

3) Add the control to the master page using @Register to include it in the page.

4) Add a "SafeControl" entry to the web.config file (required for SP to run the DLL) - you can see any one of the existing ones to see the format *

* If you are in a farm environment, updating the Web.config is not advisable by hand; in a farm (2+ servers), SharePoint likes to overwrite them.

Best Regards,

David M. Sterling

Author MOSS 2007 The Complete Reference

davidmsterling.blogspot.com

www.sterling-consulting.com

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号