asp.net¼òµ¥ÊµÏÖÒ³Ãæ»»·ô
ʵÏÖÒ³Ãæ»»·ô ¸øhtml form Ìí¼ÓÏàÓ¦µÄÑùʽ ´úÂëÈçÏÂ:
private string _StyleClass;
public string StyleClass
{
get { return _StyleClass; }
set { _StyleClass = value; }
}
private void StyleForm()
{
HtmlForm Form1 = this.FindControl("form1") as HtmlForm;
Form1.Attributes.Add("class", _StyleClass);
}
protected override void OnPreRender(EventArgs e)
{
//¿Ø¼þ³ÊÏÖµ÷Ó÷½·¨
StyleForm();
base.OnPreRender(e);
}
Ïà¹ØÎĵµ£º
Ç°ÑÔ
дÕâƪÎÄÕµÄÄ¿µÄ£¬ÊÇÏë×ܽáһЩ¶«Î÷£¬ÒÔ°ïÖúÅóÓÑÃǸüºÃµÄʹÓÃÕâ¸ö¿ò¼Ü¡£µ«ÊÇ£¬ÎÒÓÖ²»Ïñ°Ñ¹Ù·½ÁоٵÄÄÄЩÓÅÊÆ¡¢¹¦ÄÜ·Òë¹ýÀ´ÁоÙÔÚÕâÀï¡£ËùÒÔ£¬ÎÒÏë¸É´àÎҾʹ¿´Ó¸öÈ˹۵ãÉ϶ÔÕâ¸ö¿ò¼ÜÆÀÂÛһϰɡ£ËµµÄ²»ºÃµÄ£¬²»¶ÔµÄ»¹ÇëÅúÆÀÖ¸Õý¡£
ASP.NET MVC——ÂÝÐý½ø²½µÄ²úÎï
¶ÔÓÚ΢ÈíΪʲôҪÍƳöASP.NET MVC£¬ÎÒÃÇ ......
ÎÒ們ÔÚ開發網頁應ÓóÌʽ£¬時³£ÐèҪȥ½âÎö網Ö·(Request.Url)µÄÿ個Ƭ¶Î£¬進ÐÐһЩÅÐ斷¡£ÀýÈç說 "http://localhost:1897/News/Press/Content.aspx/123?id=1#toc
"£¬ÎÒ們ÏëҪȡµÃ網Ö·裡µÚÒ»層Ä¿錄µ ......
Global.asax Îļþ£¬ÓÐʱºò½Ð×ö ASP.NET Ó¦ÓóÌÐòÎļþ£¬ÌṩÁËÒ»ÖÖÔÚÒ»¸öÖÐÐÄλÖÃÏìÓ¦Ó¦ÓóÌÐò¼¶»òÄ£¿é¼¶Ê¼þµÄ·½·¨¡£Äã¿ÉÒÔʹÓÃÕâ¸öÎļþʵÏÖÓ¦ÓóÌÐò°²È«ÐÔÒÔ¼°ÆäËüһЩÈÎÎñ¡£ÏÂÃæÈÃÎÒÃÇÏêϸ¿´Ò»ÏÂÈçºÎÔÚÓ¦ÓóÌÐò¿ª·¢¹¤×÷ÖÐʹÓÃÕâ¸öÎļþ¡£
¸ÅÊö
Global.asax λÓÚÓ¦ÓóÌÐò¸ùĿ¼Ï¡£ËäÈ» Visual Studio .NET »á×Ô¶¯²åÈëÕ⸠......
ÎÒÔÚ×öͼÊé¹ÜÀíϵͳ£¬Óû§¹ÜÀíȨÏÞ£¬ÔÚasp¡£netÀ²»ÓÃsessionµÄ»°£¬Ó¦¸ÃÓÃʲô´úÂë
protected void Page_Load(object sender, EventArgs e)
{
try
{
& ......
--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 ......