http://jqueryui.com/tabs/#ajax
通過AJAX內容在右側菜單
,那麼你可以這樣做
ajaxpostback.ashx?頁=第1頁
,然後你只打算返回內容
代碼示例
的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");
}
}