asp.net MVCÏ ʹÓÃjquery½øÐÐÒì²½Ìá½»µÄÁ½ÖÖ·½Ê½
ÓÉÓÚmvc¼Ü¹¹ºÍ´«Í³µÄ.net³ÌÐòÓÐËù²»Í¬£¬ËùÒÔ½øÐÐÒì²½Ìá½»µÄʱºò£¬¾ÍºÍ¹ýÈ¥µÄ·½·¨²ÎÊýÓÐËù²î±ð£¬ÏÂÃæÎҾͽéÉÜÏÂÁ½ÖÖ³£ÓõÄÌá½»·½Ê½ÔÚMVCÏÂÈçºÎµ÷Óá£
1.Ö±½ÓÌá½»Êý¾Ýµ½Action
¼ÙÉèÒ»¸ö·¢²¼BLOGµÄÒ³ÃæµÄ»Ø¸´¹¦ÄÜ£¬ÓÐÒ»¸öIDΪ'ReInfo'µÄdiv¸ºÔðÏÔʾ»Ø¸´µÄÏûÏ¢¡£
µã»÷Ìá½»°´Å¥ºó£¬qjµÄpost·½·¨½«Êý¾Ý´«µÝµ½/Blog/BlogReÕâ¸öAction£¬²ÎÊýÊÇReInfoºÍBlogId
È»ºó£¬Ö´ÐÐpostµÄµÚÈý¸öÄäÃû·½·¨½«¸Õ»Ø¸´µÄÊý¾ÝÌí¼Óµ½ReInfoÖÐ
´úÂëÈçÏ£º
<div id='ReInfo'></div>
<fckeditorv2:fckeditor id="FCKeditor1" runat="server" Width="580px"
EnableXHTML="true" EnableSourceXHTML="true" basepath="~/FCKeditor/"
height="500px"></fckeditorv2:fckeditor>
<script
type="text/javascript">
function getEditorHTMLContents() {
var oEditor =
FCKeditorAPI.GetInstance("FCKeditor1");
return
(oEditor.GetXHTML(true));
}
function UpdateMsg()
{
var Con = getEditorHTMLContents();
$.post("/Blog/BlogRe", { ReInfo:encodeURI(getEditorHTMLContents()) , BlogId:
"<%=b.BlogId %>" }, function(data) {
var $p =
$("<div></div>");
$p.append("<div>" +
getEditorHTMLContents() + "</div>");
$p.append("<br><b>" + data + "&
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔǰµÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕß¶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
ÑéÖ¤¿Ø¼þÓÃÓÚÑéÖ¤Óû§µÄÊäÈ룬ÀûÓÃÕâЩ¿Ø¼þ£¬¿ª·¢ÈËÔ±¿ÉÒÔÇáËɵÄʵÏÖ¶ÔÓû§ÊäÈëµÄÑéÖ¤¡£ASP.NETÌṩÁËÁùÖÖÑéÖ¤¿Ø¼þ¡£
1.Required Field Validator£ºÑéÖ¤ÊäÈëÊÇ·ñΪ¿ÕµÄ¿Ø¼þ¡£
Ö÷ÒªÊôÐÔ£º
Control To Validate£º±íʾҪ½øÐмì²éµÄ¿Ø¼þID¡£´ËÊôÐÔ±ØÐëÉèÖÃΪÊäÈë¿Ø¼þµÄID£¬·ñÔò»á·¢ÉúÒì³£¡£ÁíÍâ¸ÃIDËù´ú±íµÄ¿Ø¼þ± ......
Global.asax Îļþ£¬ÓÐʱºò½Ð×ö ASP.NET Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦ÓóÌÐò¸ùĿ¼Ï¡£ËäÈ» Visual Studio .NET »á×Ô¶¯²åÈëÕ⸠......
--aspxÎļþ
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="NetWork.aspx.cs" Inherits="NetWork" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<he ......
asp.net´íÎó´¦Àí·½·¨ ´ó²¿·Ö¶¼Óà try catch
ÎÒÃÇÒ²¿ÉÒÔÔÚÒ³Ãæ¶¨Òå protected void Page_Error(object sender, EventArgs e)·½·¨´¦Àí´íÎóÐÅÏ¢
{
//ÏÈ»ñÈ¡µ±Ç°·¢ÉúÒì³£
Exception ex = Server.GetLastError().GetBaseException();
if (ex is ArgumentOu ......