http://jqueryui.com/tabs/#ajax
右侧菜单中通过 ajax 的内容
然后你可以做类似的事情
ajaxpostback.ashx?page=page1
然后你只返回预期的内容
代码示例
Javascript
<script type="text/javascript">
$(function () {
$("#tabs").tabs();
});
HTML
<div id="tabs">
<ul>
<li><a href="#tabs-1">Preloaded</a></li>
<li><a href="Handler1.ashx?page=1">Tab 1</a></li>
<li><a href="Handler1.ashx?page=2">Tab 2</a></li>
<li><a href="Handler1.ashx?page=3">Tab 3 (slow)</a></li>
<li><a href="Handler1.ashx?page=4">Tab 4 (broken)</a></li>
</ul>
<div id="tabs-1">
<p>
Nunc tristique tempus lectus.</p>
</div>
处理程序
public void ProcessRequest(HttpContext context)
{
if (string.Compare(context.Request.QueryString["page"].ToString(), "1") == 0)
{
context.Response.ContentType = "text/plain";
context.Response.Write("1");
}
else if (string.Compare(context.Request.QueryString["page"].ToString(), "2") == 0)
{
context.Response.ContentType = "text/plain";
context.Response.Write("2");
}
else
{
context.Response.ContentType = "text/plain";
context.Response.Write("rest");
}
}