Jquery ×éºÏformÔªËØΪjson¸ñʽ,asp.net·´ÐòÁл¯
×÷Õߣº°½Ê¿Î° Email£ºikmb@163.com תÔØ×¢Ã÷×÷Õß
˵Ã÷£º 1¡¢js¸ù¾Ý±íµ¥ÔªËØclassÊôÐÔ£¬°Ñ±íµ¥ÔªËصÄnameºÍvalue×éºÏΪjson¸ñʽ;ÓÃ±íµ¥ÔªËØclassÊôÐÔ¿ÉÒÔÕë¶ÔÐÔµØ×éºÏJSONÊý¾Ý¡£
2¡¢ºó¶ËASP.NETÓÃJavaScriptSerializer·´ÐòÁл¯Îª¶ÔÏóʵÁС£
3¡¢ºÃ´¦£º¼ò»¯ÁËÇ°¶ËÊý¾Ý¶ÁÈ¡Óëºó¶ËÊý¾Ý¸³Öµ¡£
function GetJSONStr(class_name) {
var a = [];
//Îı¾¿ò
$("." + class_name).filter(":text").each(function(i) {
//alert(this.name);
//alert(this.value);
a.push({ name: this.name, value: this.value });
});
//ÏÂÀÁбí
$("." + class_name).filter("select").each(function(i) {
//alert(this.name);
//alert(this.value);
a.push({ name: this.name, value: this.value });
});
//µ¥Ñ¡¿ò
$("." + class_name).filter(":radio").filter(":checked").each(function(i) {
//alert(this.name);
//alert(this.value);
a.push({ name: this.name, value: this.value });
});
//¸´Ñ¡¿ò¿ªÊ¼
var temp_cb = "";
$("." + class_name).filter(":checkbox").filter(":checked").each(function(i) {
if (temp_cb.indexOf(this.name) == -1) {
temp_cb += this.name + ",";
}
});
var temp_cb_arr = temp_cb.split(",");
var cb_name = "";
var cb_value = "";
for (var temp_cb_i = 0; temp_cb_i < temp_cb_arr.length - 1; temp_cb_i++) {
cb_name = temp_cb_arr[temp_cb_i];
var cb_value_length = $("input[name='" + temp_cb_arr[temp_cb_i] + "']:checked").length;
$("input[name='" + temp_cb_arr[temp_cb_i] + "']:checked").each(function(i) {
if (i == cb_value_length - 1)
cb_value += this.value;
else
cb_value += this.value + ",";
});
//alert(cb_name);
//alert(cb_value);
a.push({ name: cb_name, value: cb_value });
}
//¸´Ñ¡¿ò½áÊø
//×éºÏΪJSON
var temp_json = "";
for (var json_i = 0; json_i < a.length; json_i++) {
if (json_i != a.length - 1) {
temp_json += '"' + a[json_i].name + '":"' + a[json_i].value + '
Ïà¹ØÎĵµ£º
<FRAMESET> <FRAME>
<NOFRAMES>
<IFRAME>
¡ö ¿ò¼Ü¸ÅÄî £º
Ëùν¿ò¼Ü±ãÊÇÍøÒ³»Ãæ·Ö³É¼¸¸ö¿ò´°£¬Í¬Ê±È¡µÃ¶à¸ö URL¡£Ö»¡¡Òª <FRAMESET> <FRAME> ¼´¿É£¬¶øËùÓпò¼Ü±ê¼Ç¡¡Òª·ÅÔÚÒ»¸ö×ÜÆðµÄ html µµ£¬Õâ¸öµµ°¸Ö»¼Ç¼Á˸ÿò¼Ü ÈçºÎ»®·Ö£¬²»»áÏÔʾÈκÎ×ÊÁÏ£¬ËùÒÔ²»±Ø·ÅÈë <BODY> ......
Ç°¶Îʱ¼äÒòΪһÌض¨ÐèÇóдÁËÏÂÃæ´úÂë¡£ÐèÇóÈçÏ£ºÔÚÓû§·ÃÎʱ¾Õ¾ËùÓÐaspxÒ³Ãæʱ£¬Ê×ÏÈÅжÏÓû§Session["login"]ÊÇ·ñ´æÔÚ£¬Èç¹û²»´æÔÚ£¬ËµÃ÷¸ÃÓû§Î´µÇ½£¬ÒªÈøÃÓû§Ìøתµ½Ö¸¶¨µÄÒ³Ãæ¡£ËùÒÔÏëдһ¸öSessionµÄ¹ýÂËÆ÷£¬Ë¼Ç°ÏëºóÓ¦¸Ãдһ¸ö¼Ì³ÐIHttpModuleµÄ´¦ÀíÀà¡£ÊÔÑéÁ˼¸ÖÖ·½Ê½·¢ÏÖÖ»Óн«·½·¨¼ÓÔÚ.AcquireRequestStateÖвŠ......
ʹÓà ConfigurationSettings ¶ÔÏóµÄ AppSettings ÊôÐÔ¼ìË÷ ASP.NET ÅäÖÃÐÅÏ¢¡£
ASP.NET ÔÊÐí¿ª·¢ÈËԱͨ¹ýÖ±½Ó¹«¿ªÅäÖÃÉèÖã¨ÒÔÇ¿ÀàÐÍÊôÐÔµÄÐÎʽ£©»òʹÓó£¹æÅäÖà API£¬´ÓÓ¦ÓóÌÐòÖзÃÎÊÅäÖÃÉèÖá£Ï ......
Ç°ÑÔ£º
Ç°¼¸ÈÕ£¬ÎÞÄÎÓÃJSÅжϿؼþµÄÓÐЧÐÔ£¬·¢ÏÖµÄÈ·ÊÇÒ»¼þ·ÑÁ¦¡¢·ÑÉñµÄÊÂÇ飡ÌرðÊÇÕë¶ÔÓʼþ¸ñʽ¡¢ÓÊÕþ±àÂëµÈµÄ¹ØÓÚÕýÔò±í´ïʽµÄJSÑéÖ¤£¨ÆäÖÐÉæ¼°ÕýÔò±í´ïʽµÄ±È½ÏµÈ£¬½Ï·³~£©¡£Æäʵ¶ÔÓÚÕâЩ³£ÓõĿؼþÓÐЧÐÔÑéÖ¤£¬ÔÚAsp.NetÖÐÓе¥¶ÀµÄÑéÖ¤¿Ø¼þ¿É¹©Ê¹Óá£ËûÃÇ¿ÉÒÔÂú×ãÒ»°ãµÄ£¬ÖîÈç·Ç¿Õ£¬·¶Î§¡¢±È½ÏµÈµÄÑé ......
WebPartManager
WebPartManager¿Ø¼þÊÇ Web ²¿¼þ¿Ø¼þ¼¯µÄºËÐĿؼþ£¬ÓÃÓÚ¹ÜÀíËùÓÐ Web ²¿¼þ¿Ø¼þ¡¢Web ²¿¼þ¹¦ÄÜºÍ Web ²¿¼þʼþ¡£
±ØÐëÏòʹÓà Web ²¿¼þ¿Ø¼þµÄÿ¸öÒ³Ìí¼ÓÒ»¸ö£¨½ö½öÒ»¸ö£©WebPartManager¿Ø¼þ¡£WebPartManager¿Ø¼þÖ»ÄÜÓÉͨ¹ýÉí·ÝÑéÖ¤µÄÓû§Ê¹Óá£
WebPartManger ÈÎÎñ
ϱíÁгöÁËÓÉ WebPartManager¿Ø¼þÖ´Ðе ......