This is a migrated thread and some comments may be shown as answers.

[Solved] LoadContentFrom partial view problem

3 Answers 114 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mike Pateras
Top achievements
Rank 1
Mike Pateras asked on 11 Jan 2010, 07:52 PM
I'm trying to create a model for a partial view to show in a PanelBar, but for some reason my data isn't making it to the partial view properly. In this code here: http://tinyurl.com/ya6ug52 I'm creating my model and passing it as a parameter to LoadContentFrom. When I hit the DropDown, the breakpoint in the controller method gets his, but while Model.URL has the correct data, Model.Dates is null.

What might cause this behavior?

3 Answers, 1 is accepted

Sort by
0
Mike Pateras
Top achievements
Rank 1
answered on 12 Jan 2010, 04:23 AM
I think I found the problem. The query string is being generated with an extra amp; in it, something like this:

?value1=somevalue&value2=whatever

So while the second parameter's value is there, and correct, it's not getting parsed properly. Is this a bug in the control?
0
Accepted
Georgi Krustev
Telerik team
answered on 13 Jan 2010, 03:54 PM
Hi Mike Pateras,

In order to avoid this erroneous behavior you will need to open UI/NavigationItemLinkRenderer.cs file and replace this code snippet:
public void Start(T item, string url)
       {
           if (item.Enabled)
           {
                                            item.LinkHtmlAttributes.Merge("href",  System.Web.HttpUtility.HtmlAttributeEncode(url), false);
           }
 
           item.LinkHtmlAttributes.PrependInValue("class", " ", UIPrimitives.Link);
           writer.AddAttributes(item.LinkHtmlAttributes);
           writer.RenderBeginTag(HtmlTextWriterTag.A);
       }

with this one:
public void Start(T item, string url)
{
    if (item.Enabled)
    {
        item.LinkHtmlAttributes.Merge("href", url, false);
    }
 
    item.LinkHtmlAttributes.PrependInValue("class", " ", UIPrimitives.Link);
    writer.AddAttributes(item.LinkHtmlAttributes);
    writer.RenderBeginTag(HtmlTextWriterTag.A);
}

The fix will be included in one of the upcoming releases.

Sincerely yours,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Mike Pateras
Top achievements
Rank 1
answered on 14 Jan 2010, 06:26 PM
Thank you.
Tags
PanelBar
Asked by
Mike Pateras
Top achievements
Rank 1
Answers by
Mike Pateras
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or