Listview with ActionLink Statement

3 posts, 0 answers
  1. Peter
    Peter avatar
    7 posts
    Member since:
    May 2008

    Posted 04 Mar 2012 Link to this post

    Hi
    I'm using Kendo Mobile UI combined with MVC elements.
    All is working well, but In the Kendo Mobile UI Listview Element like (on a  page Kendo.cshtml):

    <ul data-role="listview" data-style="inset" data-type="group">
    <li>
    <ul>
    <li data-icon="globe"><a>@Html.ActionLink("Test Button (works)", "Button", "Home")</a></li>
    <li data-icon="globe">@Html.ActionLink("Test Button (not working)", "Button", "Home")</li>
    </ul>
    </li>
    </ul>


    On my iPhone I get:
    A) a Listview element which is underlined with no data icon and no arrow ">" (incorrect style)
    B) a Listview element with data icon and arrow ">" (correct style)

    Both Links are loading the same Button.cshtml file.
    The Page is simple and shows the event handling of buttons like the button event example of kendo mobile UI
    But only A) one loads the page correctly so that the event are properly handled.
    B) loads the page but the events are not fired.

    So, at the moment I have to select A) for correct behaviour but "bad" style

    What is the correct statement for an action link in a listview showing the dataicon and the arrow
    AND the correct behaviour?

    Regards, Peter
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 05 Mar 2012 Link to this post

    Hello,

     This statement creates nested <a> elements which is not supported by any browser:

    <a>@Html.ActionLink("Test Button (works)", "Button","Home")</a> 

    Html.ActionLink renders an <a> element on its own.

    Kind regards,
    Atanas Korchev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Petyo
    Admin
    Petyo avatar
    2439 posts

    Posted 05 Mar 2012 Link to this post

    Hello,

    As Atanas already mentioned, the second approach is the correct one. However, I am not sure to which events you refer with the following sentence:

    B) loads the page but the events are not fired.

    Can you please clarify a bit? 

    I also prepared one simple jsFiddle to demonstrate the case. Feel free to modify it in order to demonstrate the problem. 

    Regards,
    Petyo
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top