後臺C#代碼以下:jquery
<SPAN style=
"FONT-SIZE: 14px"
>
private
string
categoryId =
"0"
;
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!String.IsNullOrEmpty(Request.QueryString[
"categoryId"
]))
{
categoryId = Request.QueryString[
"categoryId"
];
}
Page.ClientScript.RegisterStartupScript(
this
.GetType(),
""
,
"load("
+categoryId+
")"
,
true
);
}
</SPAN>
|
前臺js代碼以下:ajax
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<SPAN style=
"FONT-SIZE: 14px"
>function load(categoryId) {
$.ajax({
type:
"get"
,
url:
'<%=ResolveUrl("~/Handler/Test.ashx") %>'
,
dataType:
"json"
,
data:
"categoryId="
+categoryId,
success: function (result) {
$.each(result, function (index, data) {
});
}
});
};
</SPAN>
|