ASP.NET MVC ¶àÓïÑÔ½â¾ö·½°¸
ASP.NET MVC ¶àÓïÑÔ½â¾ö·½°¸()
¾ÍÒ»¸öÍøÕ¾µÄ¶àÓïÑÔÌØÐÔÀ´Ëµ£¬ÎÒÈÏΪ·ÖΪÁ½¸ö·½Ã棺
1¡¢HTML½çÃæÉÏÏÔʾµÄÎÄ×ÖÐèÒª¶àÓïÑÔ
2¡¢HTML½çÃæÉÏJSÊä³öµÄÎÄ×ÖÐèÒª¶àÓïÑÔ
ÔÀ´ÔÚHTML²¿·ÖÖ±½ÓдµÄÎÄ×Ö¶¼²»ÄÜÖ±½ÓдҪÊä³öµÄÎÄ×Ö£¬¶øÊÇÒª²ÉÓñê¼ÇµÄ·½·¨À´Ìæ»»¡£JSÒ²ÊÇͬÀí¡£
ÄÇôÔÚMVCÏÂÔõôÄÜ͸Ã÷µÄʵÏÖ¶àÓïÑÔÄØ£¿Ëùν͸Ã÷µÄʵÏÖÊÇÖ¸£¬³ÌÐòÔ±ÔÚ¿ª·¢³ÌÐòµ±ÖУ¬²»ÐèÒª¹ý¶àµÄ¿¼ÂǶàÓïÑÔµÄÎÊÌ⣬ֱ½Óµ÷ÓÃÒ»¸ö·½·¨¾ÍÄÜʵÏÖ¶àÓïÑÔ£¬¶øÇÒËùÒªÓõ½µÄÓïÑÔÎļþÿ¸öÓïÑÔÒ»¸öÎļþ¾Í¹»ÁË£¬¼¯ÖзÒëÕâ¸öÓïÑÔ¾ÍÍê³ÉÁ˶àÓïÑԵŦÄÜ¡£
ÀýÈç
<html>
<head>
</head>
<body>
¶àÓïÑÔÊä³öµÄÎÄ×Ö //ÕâÀï¾Í²»ÄÜÖ±½ÓдÖÐÎÄÁË£¬Ò»¸öºÃ·½·¨ÊÇ Ö±½ÓÓà <%= Html.Lang("string1") %> À´½øÐÐÊä³ö
</body>
</html>
ÕâÀï<%= Html.Lang("clickme") %> ÊÇ¶Ô HTMLHelper ½øÐÐÁËÀ©Õ¹£¬Ôö¼ÓÁËÒ»¸ö Lang µÄ·½·¨£¬²ÎÊýÊÇÐèÒª·ÒëµÄ×ÊÔ´×Ö·û´®µÄName¡£
ÔõôΪ HTMLHelper ½øÐÐÀ©Õ¹?ÏÂÃæÕâ¸öÀà¾ÍÊÇÔö¼ÓÁ˵ÄÀ©Õ¹Àà
Code
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Globalization;
using System.Web.Compilation;
using System.Web.Mvc;
using System.Web.Routing;
namespace System.Web.Mvc {
public static class LocalizationHelpers {
/// <summary>
Ïà¹ØÎĵµ£º
µÚ1ÖÖ.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing ......
µÚÒ»ÖÖ£º
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// CookieOper µÄժҪ˵à ......
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<!--
<add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0 ......
function _doPostBack(){};
if(typeof("__doPostBack")=="function")
{
_doPostBack=__doPostBack;
__doPostBack=_doPostBackNew;
}
document.attachEvent("onmousemove",_onmousemove);
var _isPosting=false;
var _divMask=null;
function _onmousemove()
{
if(_divMask)
with(_divMask.runtimeStyle)
......