views:

19

answers:

1

Hello,

I'm using JQuery UI 1.7/PACKT book. It said on p.63 that 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.

+1  A: 

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.

JasCav
What's the path? Is that the action?
Richard77
@Richard77 - Sorry, yes. That is the action. Updated the answer to reflect that.
JasCav
It's not working.
Richard77
@Richard77 - What's not working exactly? Are the tabs displaying? Are the links not working (but it looks like tabs)? More details would be appreciated.
JasCav