asp.net Öиıädatagrid µÄÁпí
private void Page_Load(object sender, System.EventArgs e)
{
DataGrid1.Columns[0].HeaderText = "ÎÄÕ±êÌâ";
DataGrid1.Columns[1].HeaderText = "·¢²¼ÈÕÆÚ";
DataGrid1.Columns[0].HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
DataGrid1.Columns[1].HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
///' ֻΪ Header ÐÐÌí¼Ó¿í¶È
DataGrid1.Columns[0].HeaderStyle.Width = System.Web.UI.WebControls.Unit.Percentage(72);
DataGrid1.Columns[1].HeaderStyle.Width = System.Web.UI.WebControls.Unit.Percentage(28);
DataGrid1.Style.Add("table-layout", "fixed");
}
Ïà¹ØÎĵµ£º
--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 ......
1. C#ÓïÑÔ·½Ãæ
1.1 À¬»ø»ØÊÕ
¡¡À¬»ø»ØÊÕ½â·ÅÁËÊÖ¹¤¹ÜÀí¶ÔÏóµÄ¹¤×÷£¬Ìá¸ßÁ˳ÌÐòµÄ½¡×³ÐÔ£¬µ«¸±×÷ÓþÍÊdzÌÐò´úÂë¿ÉÄܶÔÓÚ¶ÔÏó´´½¨±äµÃËæÒâ¡£
¡¡1.1.1 ±ÜÃâ²»±ØÒªµÄ¶ÔÏó´´½¨
¡¡ÓÉÓÚÀ¬»ø»ØÊյĴú¼Û½Ï¸ß£¬ËùÒÔC#³ÌÐò¿ª·¢Òª×ñѵÄÒ»¸ö»ù±¾ÔÔò¾ÍÊDZÜÃâ²»±ØÒªµÄ¶ÔÏó´´½¨¡£ÒÔÏÂÁоÙһЩ³£¼ûµÄÇéÐΡ£
¡¡1.1.1.1 ±ÜÃâÑ»·´´½¨¶ÔÏ ......
asp.net´íÎó´¦Àí·½·¨ ´ó²¿·Ö¶¼Óà try catch
ÎÒÃÇÒ²¿ÉÒÔÔÚÒ³Ã涨Òå protected void Page_Error(object sender, EventArgs e)·½·¨´¦Àí´íÎóÐÅÏ¢
{
//ÏÈ»ñÈ¡µ±Ç°·¢ÉúÒì³£
Exception ex = Server.GetLastError().GetBaseException();
if (ex is ArgumentOu ......
·µ»ØÉÏÒ»Ò³µÄÕâ¸ö¶«¶«ÔÚÎÒÃÇ×öÏîÄ¿µÄʱºòÒ»°ãÊÇÓÃÓÚÌîдÍê±íµ¥ºóÈ·ÈϵÄʱºò£¬ÓжÔÔÀ´ÊäÈëµÄÊý¾Ý½øÐÐÐÞ¸Äʱ
Óõģ¬»òÕßÊÇÒòΪÍøվΪÁË·½±ãä¯ÀÀÕ߶øÓÐÐÄÌí¼ÓµÄÒ»¸ö¶«¶«£¬Ò»°ãÕâÖÖ¹¦ÄܵÄʵÏÖÔÚASP.netÖж¼ÊÇÓÃÒ»¸öbuttonµÄ¿Ø¼þÀ´ÊµÏֵģ¬ÊµÏֵķ½·¨ÓкÜ
¶à£¬½ñÌìÇ¡ºÃÔÚ×öÏîĿʱÅöµ½ÒªÓÃÕâ¸ö¶«¶«£¬ÎҾͰÑÄÜʵÏÖ" · ......
ASP.NET¿Ø¼þ¿ª·¢»ù´¡Ö®ÀàÐÍת»»Æ÷1.ÈÏʶĬÈÏÊôÐÔä¯ÀÀÆ÷Ö§³Ö
ÈÃÎÒÃÇÔÙÈÏʶһÏÂÊôÐÔ,´ó¼ÒÖªµÀÿ¸öÊôÐÔ¶¼ÊÇÓÐÀàÐ͵Ä,×îÊìϤ¾ÍÊÇstring,intÕâЩÀàÐÍÁË,VS2005ÊôÐÔä¯ÀÀÆ÷¶ÔÕâЩÊôÐÔÀàÐͽøÐÐÁËʶ±ð,
ÈçÏÂÀý×Ó
(1)table¿Ø¼þµÄHeightÊôÐÔ,µ±ÄãÉèÖÃÊôÐÔΪ×Ö·û´®Ê±,ÔòÌáʾ´íÎóÐÅÏ¢
(2)µ±ÊôÐÔÀàÐÍΪColorÊôÐÔʱ,ÊôÐÔä¯ÀÀÆ÷ ......