offline
- gogi100
![Male](https://www.mycity.rs/templates/simplified/images2/user-sex.gif)
- Građanin
- Pridružio: 26 Jan 2006
- Poruke: 233
|
Dakle po uputstvu sa sajta https://www.macaw.nl/artikelen...e-new-document-button-makeover pokusavam da kreiram application page koja ce biti otvorena kad se klikne na dugme. dugme sam kreirao i kad kliknem na njega dobijam u IE poruku
The method or operation is not implemented.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NotImplementedException: The method or operation is not implemented.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[NotImplementedException: The method or operation is not implemented.]
NOVODUGME.Layouts.NOVODUGME.TemplateSelector.SetTemplateLibraryFolders() +72
NOVODUGME.Layouts.NOVODUGME.TemplateSelector.Page_Load(Object sender, EventArgs e) +107
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
System.Web.UI.Control.OnLoad(EventArgs e) +132
Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.OnLoad(EventArgs e) +101
Microsoft.SharePoint.WebControls.LayoutsPageBase.OnLoad(EventArgs e) +49
System.Web.UI.Control.LoadRecursive() +66
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428
izgleda da SetTemplateLibraryFolders() metod nije implementiran
kod moje aspx strane je
<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.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" %>
<%@ Register TagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"%>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TemplateSelector.aspx.cs" Inherits="NOVODUGME.Layouts.NOVODUGME.TemplateSelector" DynamicMasterPageFile="~masterurl/default.master" %>
<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
<script language='javascript' type="text/javascript">
// Open template with the corresponding Office app
function OpenNewTemplate(strTemplate, strSaveLocation) {
var strProgID = "SharePoint.OpenDocuments";
createNewDocumentWithProgID(makeAbsUrl(strTemplate),makeAbsUrl(strSaveLocation), strProgID, false);
window.frameElement.commitPopup();
}
</script>
</asp:Content>
<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
<div>
<div id="Navigation" style="position: absolute; top: 0; left: 0; width: 30em">
<asp:TreeView ID="tvFolders" runat="server"></asp:TreeView>
</div>
<div id="Content" style="margin-left: 30em;">
<asp:ListView ID="lvTemplates" runat="server" GroupItemCount="5" DataKeyNames="Title">
<LayoutTemplate>
<table cellpadding="5" runat="server" id="tblTemplates">
<tr id="groupplaceholder" runat="server"></tr>
</table>
</LayoutTemplate>
<GroupTemplate>
<tr id="itemPlaceholderContainer" runat="server" style="height: 80px;">
<td id="itemPlaceholder" runat="server"></td>
</tr>
</GroupTemplate>
<ItemTemplate>
<td id="Td1" valign="top" align="center" style="width: 100px;" runat="server">
<asp:HyperLink ID="TemplateLink" runat="server" NavigateUrl='<%# Eval("Url") %>' Target="">
<asp:Image ID="IconImage" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' />
<br />
<%# Eval("Title") %>
</asp:HyperLink>
</td>
</ItemTemplate>
</asp:ListView>
</div>
</div>
</asp:Content>
<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Application Page
</asp:Content>
<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
My Application Page
</asp:Content>
cs fajl te strane je
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Administration;
using System.Collections;
using System.Data;
using Microsoft.SharePoint.Utilities;
using System.Web;
namespace NOVODUGME.Layouts.NOVODUGME
{
public partial class TemplateSelector : LayoutsPageBase
{
public readonly DataTable _dataTable = new DataTable();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// Instantiate the folder tree if first time on page
SetTemplateLibraryFolders();
}
// Add columns to the datatable
_dataTable.Columns.Add("ImageUrl", typeof(string));
_dataTable.Columns.Add("Title", typeof(string));
_dataTable.Columns.Add("Url", typeof(string));
// if there's no node selected, select the first node,which is the root.
var selectedNode = tvFolders.SelectedNode == null ?tvFolders.Nodes[0].Value :
tvFolders.SelectedNode.Value;
GetTemplatesInSelectedFolder(selectedNode);
// set the templates as the datasource for the template list view
lvTemplates.DataSource = _dataTable;
}
private void SetTemplateLibraryFolders()
{
throw new NotImplementedException();
}
private void GetTemplatesInSelectedFolder(string folderUrl)
{
using (SPSite site = new SPSite("http://test-net.dri.local"))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists.TryGetList("Templates");
if (list != null)
{
SPDocumentLibrary docLib = (SPDocumentLibrary)list;
SPFolder folder = web.GetFolder(folderUrl);
AddFilesToDataTable(web, folder);
}
}
}
}
private void AddFilesToDataTable(SPWeb docWeb, SPFolder folder)
{
foreach (SPFile file in folder.Files)
{
// get template icon
string docIcon = SPUtility.ConcatUrls("/_layouts/images/",SPUtility.MapToIcon(file.Web, SPUtility.ConcatUrls(file.Web.Url, file.Url),"",IconSize.Size32));
// absolute url of the template
string absUrl =(string)file.Item[SPBuiltInFieldId.EncodedAbsUrl];
// click action
string action;
if (!String.IsNullOrEmpty(HttpContext.Current.Request.QueryString["DocLib"]))
{
// get the list from the List query string
Guid? docLibId = new Guid(HttpContext.Current.Request.QueryString["DocLib"]);
SPList selectedLibrary = docWeb.Lists.GetList(docLibId.Value,true);
string docLibUrl = selectedLibrary.DefaultViewUrl;
// remove Forms[%] from the view url to get the
// correct document library url
docLibUrl = docLibUrl.Remove(docLibUrl.LastIndexOf("Forms",StringComparison.Ordinal));
action = string.Format("javascript:OpenNewTemplate('{0}', '{1}');",absUrl,SPContext.Current.Site.RootWeb.Url + docLibUrl);
AddDataToDataTable(docIcon, file.Name, action);
}
}
}
private void AddDataToDataTable(string docIcon,string title,string url)
{
DataRow row = _dataTable.NewRow();
row["ImageUrl"] = docIcon;
row["Title"] = title;
row["Url"] = url;
_dataTable.Rows.Add(row);
}
}
}
Moze li mi ko dati neko uputstvo kako da resim ovaj problem?
private void SetTemplateLibraryFolders()
{
throw new NotImplementedException();
}
sta da stavim u ovom metodu, ako je to problem?
|