开发者

Jquery Tab: Can I use Html.ActionLink to fetch server data?

I'm using JQuery UI 1.7/PACKT book. It said on p.63 t开发者_JAVA百科hat the content of a page can be loaded just by using this statement

<li><a href="tabContent.html">AJAX Tab</a></li>

How can I obtain something with Html.ActionLink()

Thanks for helping.


If you are using the jQuery UI Tabs, Html.ActionLinks will work exactly the same way. The key is to ensure that you have your unordered list items within a div tag with an id of "tabs."

Something like this:

<div id="tabs">
    <ul>
        <li><%= Html.ActionLink("Tab Name 1", "Action1", new { Controller = "ControllerName" })%></li>
        <li><%= Html.ActionLink("Tab Name 2", "Action2", new { Controller = "ControllerName" })%></li>
    </ul>
</div>

Just include this within your .aspx file that you want the tabs to appear, and make sure to include the jquery and jquery-ui scripts, and it should work for you. You can read about the various Html.ActionLink parameters by following the link. That should help you understand the ActionLink better.

Hope that helps! Please let me know if you need any additional clarification.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜