Exception when I add new News item
I'm using v4.0. I added 4 news items with no problem. I noticed I had no way to set the publish date so they all got out of order from my original site's news. So I updated the Created and Last Modified dates in the database. The order is now the way I want it.
So I attempt to go add a new item and get the following exception:
Hello Chris Joyce,
About precise setting of the published date - you can use the Schedule Publish/Unpublish Dialog in the More Actions Menu.
About the js error that your receive - do you use some third party controls in Sitefinity or have you copied some additional assemblies in the bin folder. Is this happening on a fresh installation from Project Manager?
Best wishes,
Nikolay Datchev
the Telerik team
hi,
after upgrading my project to 4.1 i get this:
|
Hi Andrei,
This sounds like some incompatibility of a customized ascx template and the .NET ASP.NET builder. Can you send us the markup of the template that you use - i guess it is customized database stored widget template for some of the public widgets- NewsView?
Regards,
Nikolay Datchev
the Telerik team
Nikolay,
You are right, it was a customized template to display a single news item. It worked perfectly in 4.0.
Once I have updated, it went wrong. I have messed about with the template since then and hence cannot
give you an exact copy. I am rebuilding it again from scratch with the latest internal build applied. Please
stay subscribed to this forum in case I have issues.
However, for now, one issue still remains. In the back-end template where news items are created, I get
some errors. See the attached image for details. All I did was to change the Label of the fields and the description.
Many thanks,
Andrei
Hello Andrei,
1) About the Resource problem. The error that you receive is related to a change in how we interpret localized labels in UI definitions. The way it was done was wrong, and now you should set resource key , rather than resource value. For example in a typical text field defintion:
var lastNameField = new TextFieldDefinitionElement(mainSection.Fields)
ID = "lastNameFieldControl",
DataFieldName = "Title",
DisplayMode = displayMode,
Title = Res.Get<SomeResources>().LastName,
should be changed to
var lastNameField = new TextFieldDefinitionElement(mainSection.Fields)
ID = "lastNameFieldControl",
DataFieldName = "Title",
DisplayMode = displayMode,
Title = "LastName",
If you don't need summary than you have to remove the code for the summary text field.
About hiding the url panel - generally if your item needs to have a public url - it makes sense to keep this panel so users can customize the public url - if not you can probably use the CssClass property on the section level with some class that has display:none style.
Greetings,
Nikolay,
Thanks for your reply. I must say though, I did nothing in code. All I did was to go to "
Nikolay,
Hi again. Ok, I am getting the following error:
The source code that generated this unhandled exception can only be
shown when compiled in debug mode. To enable this, please follow one of the
below steps, then request the URL: |
|
<%@ Control Language="C#" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
<%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" Assembly="Telerik.Sitefinity" %>
<
telerik:RadListView
ID
=
"DetailsView"
ItemPlaceholderID
=
"ItemContainer"
AllowPaging
=
"False"
runat
=
"server"
EnableEmbeddedSkins
=
"false"
EnableEmbeddedBaseStylesheet
=
"false"
>
<
LayoutTemplate
>
<
div
class
=
"sfnewsDetails"
>
<
div
class
=
"sfnewsLinksWrp"
>
<
sf:MasterViewHyperLink
class
=
"sfnewsBack"
Font-Size
=
"20px"
Text="<%$ Resources:NewsResources, AllNews %>" runat="server" />
</
div
>
<
div
>
<
table
style
=
"width:100%;text-align:left;font-size:x-large;border-top:1px solid Black;border-bottom:1px solid Black;"
>
<
tr
>
<
td
colspan
=
"2"
style
=
"font-weight:bold;"
>Text</
td
>
</
tr
>
<
tr
>
<
td
style
=
"font-weight:bold;"
>Some more text</
td
>
<
td
>
<
asp:Literal
Text
=
"Staff Notice: "
runat
=
"server"
/>
<
sitefinity:TextField
runat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("ReferenceCode")%>' />
</
td
>
</
tr
>
<
tr
>
<
td
>Quite a bit of text here</
td
>
<
td
>
<
asp:Literal
Text
=
"Issued: "
runat
=
"server"
/>
<
sf:FieldListView
ID
=
"PublicationDate1"
runat
=
"server"
Format
=
"PublicationDate.ToLocal():dd MMM yyyy"
/>
</
td
>
</
tr
>
</
table
>
</
div
>
<
asp:PlaceHolder
ID
=
"ItemContainer"
runat
=
"server"
/>
</
div
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
h1
class
=
"sfnewsTitle"
>
<
asp:Literal
Text='<%# Eval("Title") %>' runat="server" />
</
h1
>
<
div
style
=
"font-size:medium;"
>
<
asp:Literal
ID
=
"Literal1"
Text='<%# Eval("Content") %>' runat="server" />
</
div
>
<
div
style
=
"font-size:large;"
>
<
asp:Literal
ID
=
"signatureLine"
Text
=
'_______________________________'
runat
=
"server"
/>
<
sitefinity:TextField
runat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("Author")%>' />
<
sitefinity:TextField
runat
=
"server"
DisplayMode
=
"Read"
Value='<%# Eval("SourceName")%>' />
<
sf:FieldListView
ID
=
"PublicationDate"
runat
=
"server"
Format
=
"PublicationDate.ToLocal():dd MMM yyyy"
/>
</
div
>
</
ItemTemplate
>
</
telerik:RadListView
>
Nikolay,
Do not worry, I have sorted it out. I was adding my mark-up in the header it seems.
I have gone into Administration -> Interface Labels & Messages and changed all
the labels and descriptions from there and it looks fine now.
Now, everything from The news side seems to work fine.
Many thanks,
Andrei
Last question,
Can I add code in some way to a single news item template. I want to note in the database
who has viewed an item. Since the page on which the item is viewed is auto-generated, I can not
drop any code on it. So the other way I was thinking was to add some code to the template
or a reference to a ASCX control which would be loaded and the code within it, executed.
Any thoughts / recommendations?
Many thanks,
Andrei
Hello Andrei,
Please check this forum thread.
All the best,
Ivan Dimitrov
the Telerik team