一个aspx页面能否在aspx页面的JavaScript方法可以在另一个ASPX包括
function Somefunction(){
$.ajax({
async: false,
type: 'GET',
data: { "UserID": userID },
url: 'SomeHelperCode.ashx?Surveys=' + "",
success: display
});
}
aspx页面可以被包含在其他的aspx的JavaScript方法?
SomeHelperCode.ashx:
public void ProcessRequest(HttpContext context) {
if(context.Request.QueryString.AllKeys.Contains("Surveys")){
JavaScriptSerializer jss = new JavaScriptSerializer();
string serialized;
//..... serialize an object.....
context.Response.ContentType = "text/html";
context.Response.Write(serialized);
}
}
为什么不把它们放在'.js'文件中并将它们包含在你想要的页面中? –
我真的很难找出这个问题是什么。你能澄清/重写吗? –
对不完整的信息抱歉:第一次使用SO。 我的问题是如果'anotherDisplay'在另一个aspx页面中,我们如何包含在上面给出的JavaScript/aspx文件? – TygerEye