Cache Management in ASP.NET
Introduction
Before explaining cache management in ASP.NET, let me clarify that different people use different terms for explaining the same concept i.e. managing data. Some people refer to it as state management and some others refer to it as cache management. I love to use the term cache management, may be because I like the word "cache". But conceptually there is no difference between these two. Now let's discuss different aspects of cache management (or state management) in ASP.NET.
Although cache management is not an issue in Windows applications, it has always been a challenge in the web environment. Since HTTP is a stateless protocol and a web server doesn't recognize users between different requests, it becomes very important for us to recognize a particular user between different requests and also store data so that it can be re-used between different requests. ASP.NET provides many features for storing data both in the client (browser) and the server (web server) sides, but sometimes we get confused with when to use what. In ASP.NET we come across features like Session, Application and Cache objects, but it is important for us to understand the difference between them in order to effectively use them in web applications.
Background
In this article, I will touch upon the different cache management options available in ASP.NET. In a web application, sometimes we require to store data in the server side to avoid costly data retrieval operation from data stores and time consuming data formatting logic to improve application performance as well as to re-use the same data in subsequent requests across users, applications and machines. So, to achieve this we need to store (cache) data in the server side.
Caching helps us to achieve three important aspects of QoS (Quality Of Service):
Performance - Caching improves application performance by minimizing data retrieval and formatting operations.
Scalability - Since caching minimizes data retrieval and forma
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔǰµÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕß¶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
1. javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
·½·¨Ò»£º1¡¢Ê×ÏȽ¨Á¢Ò»¸ö°´Å¥£¬ÔÚºǫ́½«µ÷Óûò´¦ÀíµÄÄÚÈÝдÈëbutton_clickÖÐ;
2¡¢ÔÚǰ̨дһ¸öjsº¯Êý£¬ÄÚÈÝΪdocument.getElementById("btn1").click();
3¡¢ÔÚǰ̨»òºǫ́µ÷ÓÃjsº¯Êý£¬¼¤·¢clickʼþ£¬µÈÓÚ·ÃÎʺǫ́c ......
ASP.NETÑéÖ¤Â루3ÖÖ£©
°Ñ×î½üÅöµ½µÄ Äܹ»ÓõÄÑéÖ¤Âë ¶¼·Å³öÀ´£¬×÷¸ö¼Ç¼
1.GSC_WebControlLibrary ÕâÊÇÔÚÍøÉÏÕÒµ½µÄÒ»¸ö¿Ø¼þ£¬·Ç³£ºÃÓᣵ«ÊÇЧ¹û²»ÊÇÌØ±ðºÃ£¨¼ûÏÂͼ¡£
£©ËäÈ»ÈÝÒ×ʹÓã¬ËùÓеÄÊôÐÔ¶¼¿ÉÒÔÏñ¿Ø¼þÒ»ÑùÉèÖ㬵«ÊÇ¿ÉÓÃÐÔ²»Ì«¸ß¡£Óû§²»ÄÜ×Ô¶¨Ò壬¶øÇÒ¿´ÆðÀ´Õâ¸öÑéÖ¤ÂëЧ¹û²»Ì«ºÃ¡£
Ч¹û£º
2.ÓÃÒ»¸öÒ³ÃæÉú ......
ÔÚsqlÀïÃæÐ½¨×Ô¶¨Ò庯Êý£¬´úÂëÈçÏ£º
CREATE function fun_getPY(@str nvarchar(4000))
returns nvarchar(4000)
as
begin
declare @word nchar(1),@PY nvarchar(4000)
set @PY=''
while len(@str)>0
begin
set @word=left(@str,1)
--Èç¹û·Çºº×Ö×Ö·û£¬·µ»ØÔ×Ö·û
set @PY=@PY+(case when unicode(@word) betw ......
ASP.NET MVC FrameworkÊÇ΢Èí¹Ù·½ÌṩµÄMVCģʽ±àдASP.NET WebÓ¦ÓóÌÐòµÄÒ»¸ö¿ò¼Ü.ÒÑÓÚ2009Äê3ÔÂ19ÈÕÕýʽ·¢²¼. MVC(Model-View-Controller)ÓÃÓÚ±íʾһÖÖÈí¼þ¼Ü¹¹Ä£Ê½.Ëü°ÑÈí¼þϵͳ·ÖΪÈý¸ö»ù±¾²¿·Ö:Ä£ÐÍ(Model),ÊÓͼ(View)ºÍ¿ØÖÆÆ÷(Controller). ¼ÈÈ»ÊÇÒ»¸öÓÅÐãµÄ¿ò¼Ü£¬ÄÇô¾ÍÖµµÃȥѧϰһ°Ñ£¬ÍøÉÏËÑË÷ÁËÐí¶à×ÊÁÏ£¬Ï£Íû¶ÔÓ ......