Navigation control broken in SL3

7 posts, 0 answers
  1. gerry
    gerry avatar
    46 posts
    Member since:
    May 2007

    Posted 20 Jul 2009 Link to this post

    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
  2. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 21 Jul 2009 Link to this post

    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.
  3. DevCraft banner
  4. gerry
    gerry avatar
    46 posts
    Member since:
    May 2007

    Posted 21 Jul 2009 Link to this post

    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
  5. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 22 Jul 2009 Link to this post

    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.
  6. gerry
    gerry avatar
    46 posts
    Member since:
    May 2007

    Posted 22 Jul 2009 Link to this post

    Boryana,

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

    Thanks,
    Gerry
  7. gerry
    gerry avatar
    46 posts
    Member since:
    May 2007

    Posted 23 Jul 2009 Link to this post

    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
  8. Bobi
    Admin
    Bobi avatar
    513 posts

    Posted 23 Jul 2009 Link to this post

    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" :

    <asp:ScriptManager ID="ScriptManager1" runat="server"  EnableHistory="True" AsyncPostBackTimeout="0"  />
    <object id="someID" data="data:application/x-silverlight-2," type="application/x-silverlight-2"
                style="height: 300px; width: 500px">

     However note that if you do not need to use page history then you do not have to change anything and RadNavigation should work correctly.


    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.
Back to Top
DevCraft banner