Search Results

Search found 5 results on 1 pages for 'tinky05'.

Page 1/1 | 1 

  • Sharepoint : Access denied when editing a page (because of page layout) or list item

    - by tinky05
    I'm logged in as the System Account, so it's probably not a "real access denied"! What I've done : - A custom master page - A custom page layout from a custom content type (with custom fields) If I add a custom field (aka "content field" in the tools in SPD) in my page layout, I get an access denied when I try to edit a page that comes from that page layout. So, for example, if I add in my page layout this line in a "asp:content" tag : I get an access denied. If I remove it, everyting is fine. (the field "test" is a field that comes from the content type). Any idea? UPDATE Well, I tried in a blank site and it worked fine, so there must be something wrong with my web application :( UPDATE #2 Looks like this line in the master page gives me the access denied : <SharePoint:DelegateControl runat="server" ControlId="PublishingConsole" Visible="false" PrefixHtml="&lt;tr&gt;&lt;td colspan=&quot;0&quot; id=&quot;mpdmconsole&quot; class=&quot;s2i-consolemptablerow&quot;&gt;" SuffixHtml="&lt;/td&gt;&lt;/tr&gt;"></SharePoint:DelegateControl> UPDATE #3 I Found http://odole.wordpress.com/2009/01/30/access-denied-error-message-while-editing-properties-of-any-document-in-a-moss-document-library/ Looks like a similar issue. But our Sharepoint versions are with the latest updates. I'll try to use the code that's supposed to fix the lists and post another update. ** UPDATE #4** OK... I tried the code that I found on the page above (see link) and it seems to fix the thing. I haven't tested the solution at 100% but so far, so good. Here's the code I made for a feature receiver (I used the code posted from the link above) : using System; using System.Collections.Generic; using System.Text; using Microsoft.SharePoint; using System.Xml; namespace MyWebsite.FixAccessDenied { class FixAccessDenied : SPFeatureReceiver { public override void FeatureActivated(SPFeatureReceiverProperties properties) { FixWebField(SPContext.Current.Web); } public override void FeatureDeactivating(SPFeatureReceiverProperties properties) { //throw new Exception("The method or operation is not implemented."); } public override void FeatureInstalled(SPFeatureReceiverProperties properties) { //throw new Exception("The method or operation is not implemented."); } public override void FeatureUninstalling(SPFeatureReceiverProperties properties) { //throw new Exception("The method or operation is not implemented."); } static void FixWebField(SPWeb currentWeb) { string RenderXMLPattenAttribute = "RenderXMLUsingPattern"; SPSite site = new SPSite(currentWeb.Url); SPWeb web = site.OpenWeb(); web.AllowUnsafeUpdates = true; web.Update(); SPField f = web.Fields.GetFieldByInternalName("PermMask"); string s = f.SchemaXml; Console.WriteLine("schemaXml before: " + s); XmlDocument xd = new XmlDocument(); xd.LoadXml(s); XmlElement xe = xd.DocumentElement; if (xe.Attributes[RenderXMLPattenAttribute] == null) { XmlAttribute attr = xd.CreateAttribute(RenderXMLPattenAttribute); attr.Value = "TRUE"; xe.Attributes.Append(attr); } string strXml = xe.OuterXml; Console.WriteLine("schemaXml after: " + strXml); f.SchemaXml = strXml; foreach (SPWeb sites in site.AllWebs) { FixField(sites.Url); } } static void FixField(string weburl) { string RenderXMLPattenAttribute = "RenderXMLUsingPattern"; SPSite site = new SPSite(weburl); SPWeb web = site.OpenWeb(); web.AllowUnsafeUpdates = true; web.Update(); System.Collections.Generic.IList<Guid> guidArrayList = new System.Collections.Generic.List<Guid>(); foreach (SPList list in web.Lists) { guidArrayList.Add(list.ID); } foreach (Guid guid in guidArrayList) { SPList list = web.Lists[guid]; SPField f = list.Fields.GetFieldByInternalName("PermMask"); string s = f.SchemaXml; Console.WriteLine("schemaXml before: " + s); XmlDocument xd = new XmlDocument(); xd.LoadXml(s); XmlElement xe = xd.DocumentElement; if (xe.Attributes[RenderXMLPattenAttribute] == null) { XmlAttribute attr = xd.CreateAttribute(RenderXMLPattenAttribute); attr.Value = "TRUE"; xe.Attributes.Append(attr); } string strXml = xe.OuterXml; Console.WriteLine("schemaXml after: " + strXml); f.SchemaXml = strXml; } } } } Just put that code as a Feature Receiver, and activate it at the root site, it should loop trough all the subsites and fix the lists. SUMMARY You get an ACCESS DENIED when editing a PAGE or an ITEM You still get the error even if you're logged in as the Super Admin of the f****in world (sorry, I spent 3 days on that bug) For me, it happened after an import from another site definition (a cmp file) Actually, it's supposed to be a known bug and it's supposed to be fixed since February 2009, but it looks like it's not. The code I posted above should fix the thing.

    Read the article

  • Asp Dot Net : IHttpModule + m_context.Server.Transfer = session state error

    - by tinky05
    I have an IHttpModule that implements IRequiresSessionState. The session state is at "on" on the page directive and I also added it to the web.config. In the method "OnBeginRequest" in the IHttpModule, I make a Server.Transfer but I get the error : Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. When I access the page directly or with a Response.Redirect, there is no error. Any idea?

    Read the article

  • ASP Dot Net : How to repeat HTML parts with minor differences on a page?

    - by tinky05
    It's a really simple problem. I've got HTML code like this : <div> <img src="image1.jpg" alt="test1" /> </div> <div> <img src="image2.jpg" alt="test2" /> </div> <div> <img src="image3.jpg" alt="test3" /> </div> etc... The data is comming from a DB (image name, alt text). In JAVA, I would do something like : save the info in array in the back end. For the presentation I would loop through it with JSTL : <c:foeach items="${data}" var="${item}> <div> <img src="${item.image}" alt="${item.alt}" /> </div> </c:foreach> What's the best practice in ASP.net I just don't want to create a string with HTML code in it in the "code behind", it's ugly IMO.

    Read the article

  • Asp.Net : IHttpModule + m_context.Server.Transfer = session state error

    - by tinky05
    I have an IHttpModule that implements IRequiresSessionState. The session state is at "on" on the page directive and I also added it to the web.config. In the method "OnBeginRequest" in the IHttpModule, I make a Server.Transfer but I get the error : Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. When I access the page directly or with a Response.Redirect, there is no error. Any idea? Update : The error occur in a page extending System.Web.UI.Page in the method InitializeCulture() which is an override.

    Read the article

1