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

Editor Custom Links (possible bug)

3 Answers 39 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Matthew Green
Top achievements
Rank 1
Matthew Green asked on 23 Feb 2010, 02:10 PM
I've had this working before, though cannot remember how long ago, certainly with the first version of Telerik Controls Q3 2009 but not under the current SP3 (2009.3.1314.35).

.... this works fine when adding a link this way.

 

<Links> 
   <telerik:EditorLink Name="test2" Href="/"></telerik:EditorLink> 
</Links> 

 

 

 


... the following in its most basic form seems to have stopped working, at least in my MVC project:
 
var test = new EditorLink(){ Name = "test", Href="/"};  
this.RadEditor.Links.Add(test);  
                 

Is this a new bug, also Rad Editor 2010 Q1 Beta is experiencing the same problems?
I will be creating another test project to test this as well.

3 Answers, 1 is accepted

Sort by
0
Matthew Green
Top achievements
Rank 1
answered on 23 Feb 2010, 02:36 PM
General Web Applications are fine it seems, just those built with ASP.NET MVC. This was working during the first Q3 2009 version and possibly the one before, its been a while since I have tried those variants.
0
Rumen
Telerik team
answered on 25 Feb 2010, 03:34 PM
Hi Matthew,

I tried to reproduce the problem but without success. For your convenience I have attached my ASP.NET MVC application with RadEditor and video demonstrating my test. Let me know if I am missing something.


Sincerely yours,
Rumen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Matthew Green
Top achievements
Rank 1
answered on 26 Feb 2010, 11:10 AM


Indeed your sample works fine  here. That lead to a couple cups of coffee, but i have tracked it down to a situation.

The problem is present when "using Form tags", and a slight confussion with the RadScriptManager.

asp:ScriptManager will throw an error if by any chance it has been placed outside a form tag (with a runat="server"), the RadScriptManager doesnt throw this error here, so it accepts and runs the application where it doesnt actually add the extra customlink items (when added from code rather than designer, the later work fine in any situation).

Example for your application using RadScriptManager (Site.Master): This will work fine
<body> 
    <form id="form1" runat="server"
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <div class="page"
        <div id="header"
            <div id="title"
                <h1> 
                    My MVC Application</h1> 
            </div> 
            <div id="logindisplay"
                <% Html.RenderPartial("LogOnUserControl"); %> 
            </div> 
            <div id="menucontainer"
                <ul id="menu"
                    <li> 
                        <%= Html.ActionLink("Home", "Index", "Home")%></li
                    <li> 
                        <%= Html.ActionLink("About", "About", "Home")%></li
                    <li> 
                        <%= Html.ActionLink("Broke", "Broke", "Home")%></li
                </ul> 
            </div> 
        </div> 
        <div id="main"
            <asp:ContentPlaceHolder ID="MainContent" runat="server" /> 
            <div id="footer"
            </div> 
        </div> 
    </div> 
    </form> 
</body> 

How to break: Now the following doesnt produce an physical errors, but just will not show the expected items within the custom links.
<body> 
    <%using(Html.BeginForm("test", "save")){ %> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
 
    <div class="page"
        <div id="header"
            <div id="title"
                <h1> 
                    My MVC Application</h1> 
            </div> 
            <div id="logindisplay"
                <% Html.RenderPartial("LogOnUserControl"); %> 
            </div> 
            <div id="menucontainer"
                <ul id="menu"
                    <li> 
                        <%= Html.ActionLink("Home", "Index", "Home")%></li
                    <li> 
                        <%= Html.ActionLink("About", "About", "Home")%></li
                    <li> 
                        <%= Html.ActionLink("Broke", "Broke", "Home")%></li
                </ul> 
            </div> 
        </div> 
        <div id="main"
            <asp:ContentPlaceHolder ID="MainContent" runat="server" /> 
            <div id="footer"
            </div> 
        </div> 
    </div> 
    <%} %> 
</body> 

Now i remember correctly. Adding the RadScriptManger to the end of the page will create the required action using either of the above formats in any page (ie doesnt need to be in the form tags, just after the declaration of the Editor in the HTML Runtime as its not using jQuery(document).ready for example that will run after the html view is ready).

That is where i had broken it. Tidying up by moving it to the top the page.

That is all i need to fix it, excellent.

Best Regards, Matthew Green
Tags
Editor
Asked by
Matthew Green
Top achievements
Rank 1
Answers by
Matthew Green
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or