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

Navigation control broken in SL3

6 Answers 103 Views
Navigation
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gerry
Top achievements
Rank 1
gerry asked on 20 Jul 2009, 06:25 PM
I am wanting to use the Navigation control in SL3 and turn on UserBrowserHistory=true.  However, I've found that unless my project has a reference to the old System.Web.Silverlight dll and has an <asp:Silverlight ... to reference Silverlight it will throw a script error.  In otherwords, if I use the recommended way of referencing Silverlight via <object ... the Navigation control will not work.  It throws a script error on page load if I have the UseBrowserHistory = true.  The reason is that the emitted javascript by Telerik is expecting a SIlverlight object.

Gerry

6 Answers, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 21 Jul 2009, 08:25 AM
Hello gerry,

The Telerik page navigation needs the ASP.NET Ajax libraries in order to use the browser history. You will need to host the Silvrelight application into a Ajax enabled ASP.NET page.

On another note our plans are to obsolete this component, since there is now a page navigation inside the SL3 framework. So if you are using SL3 it is recommended to convert to the Microsoft page navigation model.

Sincerely yours,
Valentin.Stoychev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
gerry
Top achievements
Rank 1
answered on 21 Jul 2009, 12:30 PM
Valentin,

I am aware of the SL3 navigation features but we have a bunch of pages written using the Telerik control and are wanting to port them.

The project is Ajax enabled.  Essentially if I convert my <asp:silverlight to an object tag it then throws a javascript error int he code emitted by Telerik.

RAD_AG_CLIENT_HistoryManager = function(silverlightControl) {

 

 

this.AG_HM = null;

 

 

this.AG_HM = silverlightControl.Content.RAD_AG_HistoryManager;

 

this.AG_HM.JavaScriptHistoryManager = this;

 

}


in the debugger it appears that silverlight is null.

Here is the object tag:
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
  EnableScriptCombine="False"  EnableHistory="True" >
 </telerik:RadScriptManager> 
 <object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
        style="height: 300px; width: 500px">
        <param name="source" value="/ClientBin/Navigation.xap" />
        <param name="minRuntimeVersion" value="3.0.40624.0" />
        <param name="autoUpgrade" value="true" />
        <param name="InitParams" value="" />
        <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.40624.0" style="text-decoration: none">
            <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight"
                style="border-style: none" />
        </a>
    </object>
    <iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
        border: 0px"></iframe>

Versus this tag:
 <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
  EnableScriptCombine="False"  EnableHistory="True" >
 </telerik:RadScriptManager> 
   <div style="height: 100%;">
    <asp:Silverlight ID="ManageDataFeeds"
     Source="~/ClientBin/Navigation.xap"
     InitParameters="" upo
     MinimumVersion="3.0.40624.0"
     Width="100%"
     Height="100%"
     runat="server" />
   </div>

So does the Telerik navigation code have a dependency upon using the <asp:silverlight tag on pages (and thus a dependency upon the older System.Web.Silverlight DLL?

Gerry
0
Bobi
Telerik team
answered on 22 Jul 2009, 03:26 PM
Hello gerry,

Can you please send us  a sample project in order to reproduce this issue or explain in more details the structure of your application?



Kind regards,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
gerry
Top achievements
Rank 1
answered on 22 Jul 2009, 06:25 PM
Boryana,

I submitted a ticket where I included a sample.  #299430

Thanks,
Gerry
0
gerry
Top achievements
Rank 1
answered on 23 Jul 2009, 01:55 PM
I thought I would post the solution here.  The Telerik navigation control required that you have an id on your object tag--it doesn't matter what it is but it must be there or else the injected Telerik script code with throw an error that appears unrelated to the objec tag.

e.g.
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" id="obj" ...

Gerry
0
Bobi
Telerik team
answered on 23 Jul 2009, 02:15 PM
Hello gerry,

You are right in order to use RadNavigation with Ajax browser history in Silverlight 3 all you need to do is just to add some id to the object tag and add EnableHistory="True" :

Tags
Navigation
Asked by
gerry
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
gerry
Top achievements
Rank 1
Bobi
Telerik team
Share this question
or