Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

ASP.NET MVC½éÉÜ

The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace. MVC is a standard design pattern that many developers are familiar with. Some types of Web applications will benefit from the MVC framework. Others will continue to use the traditional ASP.NET application pattern that is based on Web Forms and postbacks. Other types of Web applications will combine the two approaches; neither approach excludes the other. MVC¼Ü¹¹Ä£ ......

ASP.NETÖг£ÓõÄÈýÊ®ÈýÖÖ´úÂë


 1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attributes.Add("onclick","return confirm('È·ÈÏ?')");
button.attributes.add("onclick","if(confirm('are you sure...?')){return true;}else{return false;}")
3.ɾ³ý±í¸ñÑ¡¶¨¼Ç¼
int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];
string deleteCmd = "Delete from Employee where emp_id = " + intEmpID.ToString()
4.ɾ³ý±í¸ñ¼Ç¼¾¯¸æ
private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e)
{
¡¡switch(e.Item.ItemType)
¡¡{
case ListItemType.Item :
case ListItemType.AlternatingItem :
case ListItemType.EditItem:
¡¡TableCell myTableCell;
¡¡myTableCell = e.Item.Cells[14];
¡¡LinkButton myDeleteButton ;
¡¡myDeleteButton = (LinkButton)myTableCell.Controls[0];
¡¡myDe ......

ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü


ASP.NET³ÌÐòÖг£ÓôúÂë»ã×Ü
1.×Ô¶¨ÒåÒì³£´¦Àí
//×Ô¶¨ÒåÒì³£´¦ÀíÀà
using System;
using System.Diagnostics;
namespace MyAppException
{
¡¡/// £¼summary£¾
¡¡/// ´ÓϵͳÒì³£ÀàApplicationException¼Ì³ÐµÄÓ¦ÓóÌÐòÒì³£´¦ÀíÀà¡£
¡¡/// ×Ô¶¯½«Òì³£ÄÚÈݼǼµ½Windows NT/2000µÄÓ¦ÓóÌÐòÈÕÖ¾
¡¡/// £¼/summary£¾
¡¡public class AppException:System.ApplicationException
¡¡{
¡¡¡¡public AppException()
¡¡¡¡{
¡¡¡¡¡¡if (ApplicationConfiguration.EventLogEnabled)LogEvent("³öÏÖÒ»¸öδ֪´íÎó¡£");
¡¡¡¡}
¡¡public AppException(string message)
¡¡{
¡¡¡¡LogEvent(message);
¡¡}
¡¡public AppException(string message,Exception innerException)
¡¡{
¡¡¡¡LogEvent(message);
¡¡¡¡if (innerException != null)
¡¡¡¡{
¡¡¡¡¡¡LogEvent(innerException.Message);
¡¡¡¡}
¡¡}
¡¡//ÈÕÖ¾¼Ç¼Àà
¡¡using System;
¡¡using System.Configuration;
¡¡using System.Diagnostics;
¡¡using System.IO;
¡¡using System.Text;
¡¡using System.Threading;
¡¡namespace MyEventLog
¡¡{
¡¡¡¡/// £¼summary£¾
¡¡¡¡/// ʼþÈÕÖ¾¼Ç¼À࣬ÌṩʼþÈÕÖ¾¼ÇÂ¼Ö ......

ASP.NET·ÀÖ¹SQL×¢È뺯Êý

ASP.NET·ÀÖ¹SQL×¢È뺯Êý:
using System;
using System.Text.RegularExpressions;
using System.Web;
namespace FSqlKeyWord
......{
    /**//**//**//// <summary>
    /// SqlKey µÄժҪ˵Ã÷¡£
    /// </summary>
    public class SqlKey
    ......{
        private HttpRequest request;
        private const string StrKeyWord = @"select|insert|delete|from|count(|drop table|update|truncate|asc(|mid(|char(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
        private const string StrRegex = @"[-|;|,|/|(|)|[|]|}|{|%|@|*|!|']";
        public SqlKey(System.Web.HttpRequest _request)
        ......{
            //
     &nbs ......

ASP.NET·ÀÖ¹SQL×¢È뺯Êý

ASP.NET·ÀÖ¹SQL×¢È뺯Êý:
using System;
using System.Text.RegularExpressions;
using System.Web;
namespace FSqlKeyWord
......{
    /**//**//**//// <summary>
    /// SqlKey µÄժҪ˵Ã÷¡£
    /// </summary>
    public class SqlKey
    ......{
        private HttpRequest request;
        private const string StrKeyWord = @"select|insert|delete|from|count(|drop table|update|truncate|asc(|mid(|char(|xp_cmdshell|exec master|netlocalgroup administrators|:|net user|""|or|and";
        private const string StrRegex = @"[-|;|,|/|(|)|[|]|}|{|%|@|*|!|']";
        public SqlKey(System.Web.HttpRequest _request)
        ......{
            //
     &nbs ......

asp.netÔÚÏßÈËÊýͳ¼Æ

ÓÐÈËÒ²ÎÊÁ˸öÔÚÏßͳ¼ÆµÄÎÊÌ⣬ÎҵļûÒâÊÇÕâÑùµÄ£º  
  ÔÚApplication_StartʼþÖмÓÈëÒÔÏ´úÂ룺  
  Application.Lock();  
  Application.["UserCount"]=0;  
  Application.Unlock();  
   
  Session_StartʼþÖмÓÈëÒÔÏ´úÂ룺  
  Application.Lock();  
  Application["UserCount']=Int32.Parse(Application["UserCount"].Tostring())+1;  
  Application.UnLock();  
   
  Session_EndʼþÖмÓÈëÒÔÏ´úÂ룺  
  Application.Lock();  
  Application["UserCount"]=Int32.Parse(Application["UserCount"].Tostring())-1;  
  Application.UnLock();  
   
   
  ÔÚÒªÏÔʾµÄµØ·½Ð´¸öº¯Êý¼ÓÈëÒÔÏ´úÂ룺  
  Response.Write(Application["UserCount"].Tostring());  
   
  Õâ¾ÍOKÁË ......

asp.netÑéÖ¤¿Ø¼þ²»Æð×÷ÓõĽâ¾ö°ì·¨

×î½üд³ÌÐòÒ»Ö±³öÎÊÌ⣬ÒÔǰһ¸öÕ¾Èý¼¸Ìì¾ÍÇáËɸ㶨£¬ÏÖÔÚÒ»¸öÄ£¿é¾­³£¸ã°ëÌ죬NND
ÏÂÎ翪·¢¿áÒ×»¯×±Æ·É̳Ç(http://www.koyee.net)Ò»¸ö±íµ¥Ìá½»¹¦ÄÜÄ£¿é£¬±¾µØÈκÎÎÊÌⶼûÓÐÁË£¬´«µ½·þÎñÆ÷Éϱ¾ÒÔΪûÊÂÁË£¬ºóÀ´Ò»¼ì²éËùÓеÄÑéÖ¤¿Ø¼þ¶¼²»Æð×÷ÓÃÁË£¬Ö±½Ó¶¼Ìá½»¹ýÈ¥ÁË£¬ÓôÃÆ£¬Ô­ÒÔΪ³ÌÐò±»¸Ä´íÁË£¬¼ì²é±¾µØ»¹ÊÇûÈκÎÎÊÌ⣬¼ÌÐøÓÖ´«ÁËÒ»±é£¬ÔÚ·þÎñÆ÷ÉÏ¿´»¹ÊDz»ÐУ»
Ò»ÏÂÎçɶҲû¸É£¬°Ù¶È¡¢¹È¸èµÄ²é£¬¼¼ÊõȺµÄÎÊ£¬ÅóÓѵÄÁÄ£¬×îÖÕ×ÜËãÊǽâ¾öÁË£¬°¥£¬Ò²ÈÃ×Ô¼ºÃ÷°×ÁËÒ»¸öµÀÀí£¬¾ÛɳÄܳÉËþ Ë®µÎÄÜʯ´© ÌúèÆ±ä³ÉÕë Öñ×Ó³ÉÑÀÇ©£»ºÜ¶àÊÂÇé²»ÊÇÎÒÃDz»Äܽâ¾ö£¬¶øÊÇÒòΪÎÒÃÇûÓнâ¾ö֮ǰ°ë;¶ø·Ï£¬Ö»ÒªÅ¬Á¦£¬Ò»ÇнÔÓпÉÄÜ¡£O(∩_∩)O~
˵×Å˵×ÅÓÖÅÜÌâÁË£¬ÑÔ¹éÕý´«£¬¹«²¼½â¾ö·½·¨£º£¨asp.netÑéÖ¤¿Ø¼þ²»Æð×÷ÓõĽâ¾ö°ì·¨£©
ÕâÖ÷ÒªÊÇ·þÎñÆ÷ûÓа²×°ÏàÓ¦µÄ ¿Í»§¶Ë ½Å±¾µÄÔ­Òò£¬ÔÚ·þÎñÆ÷ÉÏÔËÐР aspnet_regiis -c(»òÕßaspnet_iisreg -c ²»Í¬°æ±¾¿ÉÄܲ»Í¬ ) ÃüÁî¾Í¿ÉÒÔÁË£¬¡¾×¢£ºÒ»¶¨ÒªÔÚÃüÁîÌáʾϽøÈëC:\WINDOWS\Microsoft.NET\Framework\v2.0.50727ÀàËÆµÄĿ¼ÏÂÖ´ÐС¿
¡£´ó¼Ò¿´Ò»ÏÂhttp://www.koyee.netÕâ¸öÕ¾µÄ¶©µ¥Ìá½»Äǿ飬¾ÍÊÇÎÒ×öµÄ£¬ÏÖÔÚÒѾ­Ã»ÎÊÌâÁË¡£
·þÎñÆ÷ÉÏÃüÁîÖ´ ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [6128] [6129] [6130] [6131] 6132 [6133] [6134] [6135] [6136] [6137]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ