Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Style Tag causes error in Web Part was not expected

$
0
0

Hi,

I have a very basic Web Part (have scripted almost everything out of it) but if I try to add a <style> tag to the page or link to a stylesheet it throws the following error message. I have no issues with other web parts on the page, and have removed all of them to just have this one web part so I can try to debug it, but no luck so far.

Server Error in '/' Application.
--------------------------------------------------------------------------------

<div xmlns=''> was not expected.
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.InvalidOperationException: <div xmlns=''> was not expected.

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:


[InvalidOperationException: <div xmlns=''> was not expected.]
   Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderDocumentSetSearch.Read13_WebPart() +160

[InvalidOperationException: There is an error in XML document (3, 2).]
   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) +1479
   System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader) +166
   Microsoft.SharePoint.WebPartPages.WebPart.ParseXml(XmlReader reader, Type type, String[] links, SPWeb spWeb) +188

[WebPartPageUserException: One of the properties of the Web Part has an incorrect format. Microsoft SharePoint Foundation cannot deserialize the Web Part.  Check the format of the properties and try again.]
   Microsoft.SharePoint.WebPartPages.WebPart.ParseXml(XmlReader reader, Type type, String[] links, SPWeb spWeb) +24300977
   Microsoft.SharePoint.WebPartPages.WebPart.AddParsedSubObject(Object obj) +24315472
   PacAl.AccountsPayable.WebParts.DocumentSetSearch.DocumentSetSearch.__BuildControlTree(DocumentSetSearch __ctrl) +88
   PacAl.AccountsPayable.WebParts.DocumentSetSearch.DocumentSetSearch.OnInit(EventArgs e) +29
   System.Web.UI.Control.InitRecursive(Control namingContainer) +143
   System.Web.UI.Control.AddedControl(Control control, Int32 index) +271
   System.Web.UI.WebControls.WebParts.WebPartManagerControlCollection.AddWebPartHelper(WebPart webPart) +305
   System.Web.UI.WebControls.WebParts.WebPartManagerControlCollection.AddWebPart(WebPart webPart) +1937758
   System.Web.UI.WebControls.WebParts.WebPartManagerInternals.AddWebPart(WebPart webPart) +63
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.AddWebPartWithRetry(WebPart webPart) +746
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts) +7123
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.LoadWebParts() +146
   Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) +288
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnInitComplete(EventArgs e) +11070270
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1674


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.5472; ASP.NET Version:2.0.50727.5456

Any ideas why this might be happening?

Thanks,

Grant.


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>