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 + '
Ïà¹ØÎĵµ£º
ÉÏ´Îд¹ýһƪMVC·ÖÒ³µÄ
×Ô¼ºÓõÄÒ»¸öASP.Net MVC·ÖÒ³ÄóöÀ´·ÖÏíÏÂ
ÏÖÔÚ·¢Ò»¸ö¸Ä½ø°æ
ÀïÃæÓõ½µÄIPagedListÎÒ×Ô¼ºÒ²¼Ç²»ÇåÊÇ´ÓÄÄÀïCOPYÀ´µÄÁË¡£ºÇºÇ
ÕâÀïÎҾͲ»°ÑIPagedListµÄ´úÂëÌù³öÀ´ÁË£¬ÒªÊ¹µÄÏÂÔØDEMO×Ô¼ºÄðɡ£
ºǫ́¶ÔÊý¾ÝµÄ·ÖÒ³
public ActionResult Index([DefaultValue(1)]int p,[DefaultValue(10)]int pages ......
ÏÈÏÂÔØ.net framework2.0ºÍASPAJAXExtSetup.msi
È»ºó°²×° ¼´¿ÉÔËÐÐ
Èç¹ûÐèÒª¿ª·¢AJAX
ÔòÒª°²×°VSºÍAjaxControlToolkit
ÔÚVS¹¤¾ßÏäÖÐн¨±êÇ© ....
.Net Framework 3.5 »·¾³ÏÂÇëÔĶÁ v3.5 »·¾³ÏÂÈçºÎ²¼Öà AJAX »·¾³¡£
ÕâÀïËù˵µÄ»·¾³ÊÇÖ¸°´·þÎñÆ÷¶ËʵÏÖ·½Ê½½øÐеÄÅäÖá£Ó¦¸Ã˵ֻҪ°²×°ÁË ASP.NET AJAX Extensions ¾Í¿É ......
WebPartManager
WebPartManager¿Ø¼þÊÇ Web ²¿¼þ¿Ø¼þ¼¯µÄºËÐĿؼþ£¬ÓÃÓÚ¹ÜÀíËùÓÐ Web ²¿¼þ¿Ø¼þ¡¢Web ²¿¼þ¹¦ÄÜºÍ Web ²¿¼þʼþ¡£
±ØÐëÏòʹÓà Web ²¿¼þ¿Ø¼þµÄÿ¸öÒ³Ìí¼ÓÒ»¸ö£¨½ö½öÒ»¸ö£©WebPartManager¿Ø¼þ¡£WebPartManager¿Ø¼þÖ»ÄÜÓÉͨ¹ýÉí·ÝÑéÖ¤µÄÓû§Ê¹Óá£
WebPartManger ÈÎÎñ
ϱíÁгöÁËÓÉ WebPartManager¿Ø¼þÖ´Ðе ......
ÎÒÏë×öÒ»¸ö¶àÖ¸±ê¶¯Ì¬²éѯ£¬ÇëÎÊÄÄλÐÖµÜ×ö¹ý£¬°ï¸ö棡¾ßÌåÒªÇóÊÇ:ÎÒ¿ÉÒÔËæÒâÑ¡ÔñÊý¾Ý¿â±íÖеÄÈκÎÒ»¸ö»ò¶à¸ö×ֶΣ¬È»ºó°ÑËûÃDzéѯ³öÀ´£¡ÎÒ»á×öµ¥Ö¸±í²éѯµÄ£¬µ«ÏÖÔÚ¹¦ÄÜÒªÒªÇó¶àÖ¸±ê¶¯Ì¬²éѯ£¡»áµÄ°ï¸öæ°¡@£¡¸Ðл֮ÖÁ£¡
ÀýÈçÎÒÏë²éÊý¾Ý¿â±íÖÐµÄ Óû§±àºÅ ÐÕÃû »òÕßÓû§±àºÅ ÐÕÃû Ê¡·Ý ÊÕÈë ²¢°Ñ¶ÔÓ¦µ ......
Cookie (HttpCookieµÄʵÀý)ÌṩÁËÒ»ÖÖÔÚ Web Ó¦ÓóÌÐòÖд洢Óû§Ìض¨ÐÅÏ¢µÄ·½·¨¡£ÀýÈ磬µ±Óû§·ÃÎÊÄúµÄÕ¾µãʱ£¬Äú¿ÉÒÔʹÓÃCookie ´æ´¢Óû§Ê×Ñ¡Ïî»òÆäËûÐÅÏ¢¡£µ±¸ÃÓû§ÔٴηÃÎÊÄúµÄÍøվʱ£¬Ó¦ÓóÌÐò±ã¿ÉÒÔ¼ìË÷ÒÔÇ°´æ´¢µÄÐÅÏ¢¡£
ASP.NETÖеÄcookie£º´´½¨Cookie·½·¨ (1)
Response.Cookies["userName"].Value = “admin" ......