Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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

asp.net È¡µÃÓû§¿Ø¼þÀïµÄÊôÐÔ»ò¿Ø¼þ

×î½üÔÚÓÃÓû§¿Ø¼þʱ£¬ÒýÓû§¿Ø¼þµÄÒ³ÃæÓÐʱºò»áºÍÓû§¿Ø¼þ½øÐÐÊý¾ÝµÄ½»»¥£¬ÍøÉϺÃÏñºÜ¶àÈ˲»ÖªµÀºÎ»ñÈ¡
д¸öÀý×Ó˵Ã÷Ò»ÏÂ
 
È¡µÃÓû§¿Ø¼þÀïÃæµÄ¿Ø¼þ²¢½øÐи³Öµ
Óû§¿Ø¼þaspxÒ³´úÂë
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="HeadPanel.ascx.cs" Inherits="HeadPanel" %>
    <asp:Label ID="lb1" runat="server" Text=""></asp:Label> //ÔÚÓû§¿Ø¼þÀﶨÒå µÄÁ½¸ö¿Ø¼þ
<asp:Label ID="lb2" runat="server" Text=""></asp:Label>
csÒ³´úÂë
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class HeadPanel : System.Web.UI.UserControl
{
   public static string tmpSiteName = "Óû§¿Ø¼þ½øÐи³ÖµµÄ±êÌâ";
   public string tmpStr="ÕâÊÇÓû§±äÁ¿";
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}
  
 
ÒýÓÃÓû§¿Ø¼þaspxÒ³´úÂë
 
......

¡¶ASP.NET MVC ÈëÃÅϵÁн̡̳·

ʲôÊÇMVCģʽ
MVC£¨Model-View-Controller£¬Ä£ÐÍ—ÊÓͼ—¿ØÖÆÆ÷ģʽ£©ÓÃÓÚ±íʾһÖÖÈí¼þ¼Ü¹¹Ä£Ê½¡£Ëü°ÑÈí¼þϵͳ·ÖΪÈý¸ö»ù±¾²¿·Ö£ºÄ£ÐÍ£¨Model£©£¬ÊÓͼ£¨View£©ºÍ¿ØÖÆÆ÷£¨Controller£©¡£
ÄÇôMVCģʽºÍÎÒÃÇÊìϤµÄWebFormģʽÓÐʲô²»Í¬ÄØ£¿ËûµÄ¸÷¸ö²¿·ÖÓÖÊÇÔõÑù·Ö¹¤µÄÄØ£¿
ÎÒÃÇÏÈÀ´¿´Ò»ÏÂÆÕͨµÄWebFormģʽÏ£¬ÎÒÃÇÇëÇóÒ»¸öÀýÈçhttp://www.51mvc.com/blog/index.aspxµÄURL£¬ÄÇôÎÒÃǵÄWebForm³ÌÐò»áµ½ÍøÕ¾¸ùĿ¼ÏÂȥѰÕÒblogĿ¼ÏµÄindex.aspxÎļþ£¬È»ºóÓÉindex.aspxÒ³ÃæµÄCodeBehindÎļþ(.CSÎļþ)½øÐÐÂß¼­´¦Àí£¬ÆäÖлòÐíÒ²°üÀ¨µ½Êý¾Ý¿âȥȡ³öÊý¾Ý(ÆäÖеľ­¹ýÔõÑùµÄBLLµ½DALÕâÀï¾Í²»Ì¸ÁË)£¬È»ºóÔÙÓÉindex.aspxÒ³ÃæÀ´³ÊÏÖ¸øÓû§¡£¼òµ¥µÄʾÒâͼÈçÏÂËùʾ£º
 
Ò²¾ÍÊÇÒ»¸öURLÇëÇóµÄÊÇÔÚ·þÎñÆ÷Óë¸ÃURL¶ÔӦ·¾¶ÉϵÄÎïÀíÎļþ(ASPXÎļþ»òÆäËû)£¬È»ºóÓɸÃÎļþÀ´´¦ÀíÕâ¸öÇëÇó²¢·µ»Ø½á¹û¸ø¿Í»§¶Ë¡£
µ«ÊÇ£¬¶ÔÓÚMVCģʽ£¬ÕâÊÇÔõÑùµÄÒ»¸ö¹ý³ÌÄØ£¿
ÎÒÃÇÏÈÀ´½¨Ò»¸öASP.NET MVCµÄÏîÄ¿°É¡£VS2008ĬÈÏÊÇûÓÐASP.NET MVCµÄÏîÄ¿Ä£°åµÄ£¬Ê×ÏÈÎÒÃÇÐèÒªµ½http://www.microsoft.com/downloads/details.aspx?FamilyId=A24D1E00-CD35-4F66-BAA0-2362BDDE0766&displaylang=enÈ¥Ï ......

Asp.NET log4net µÄÓ÷¨

Óû§¿ÉÒÔ´Óhttp://logging.apache.org/log4net/ÏÂÔØlog4netµÄÔ´´úÂë¡£½âѹÈí¼þ°üºó£¬ÔÚ½âѹµÄsrcĿ¼Ï½«log4net.slnÔØÈëVisual Studio .NET£¬±àÒëºó¿ÉÒԵõ½log4net.dll¡£Óû§ÒªÔÚ×Ô¼ºµÄ³ÌÐòÀï¼ÓÈëÈÕÖ¾¹¦ÄÜ£¬Ö»Ð轫log4net.dllÒýÈ빤³Ì¼´¿É.
web.config ÖеÄÅäÖãº
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
¼Óµ½ <configSections> ÀïÃæ.
<log4net debug="true">
      <appender name="LogFileAppender" type="log4net.Appender.FileAppender" >
          <param name="File" value="c:\Applog.txt" />
          <param name="datePattern" value="yyyy-MM-dd HH:mm" />
          <param name="AppendToFile" value="true" />
          <layout type="log4net.Layout.PatternLayout">
        ......

¡¶ASP.NET MVC°¸Àý½Ì³Ì¡·

 ±¾ÏµÁÐÎÄÕÂͨ¹ýÒ»¸öÐéÄâµÄ°¸Àý——¡¶MVC¹«¸æ·¢²¼ÏµÍ³¡·µÄ¿ª·¢¹ý³Ì£¬È«ÃæչʾÁËASP.NET MVCµÄ»ù±¾Ê¹Ó÷½·¨£¬Í¬Ê±ÔÚÌÖÂÛÁËÕâ¸ö¿ò¼ÜµÄ»ù±¾Ô­Àí¡£
      Õâ¸öÎÄÕÂϵÁеÄÄ¿µÄ¾ÍÊÇʹÅóÓÑÃǸüÇáËɵÄÈëÃÅASP.NET MVC¡£
      Õâ¸öϵÁлá°üº¬µÄÄÚÈÝÓУºASP.NET MVC»ù±¾Ó¦Óᢻù±¾Ô­Àí¡¢Â·ÓÉ´¦Àí¡¢±íµ¥´¦Àí¡¢ÓëASP.NET AJAX½áºÏ¡¢ÓëJQuery½áºÏ¡¢À¹½ØÆ÷µÈ¡£
 
ASP.NET MVC°¸Àý½Ì³Ì£¨»ùÓÚASP.NET MVC beta£©——µÚһƪ£º×¼±¸¹¤×÷
      ÕªÒª: ±¾ÎĽ«¼òÒª½éÉÜÕâ¸öÎÄÕÂϵÁеÄÄ¿µÄ¡¢ÐÎʽ¼°´óÌåÄÚÈÝ¡£²¢ÇÒÍê³É¿ªÊ¼Ñ§Ï°Õâ¸öϵÁÐÇ°Ëù±ØÒªµÄ×¼±¸¹¤×÷¡£
ASP.NET MVC°¸Àý½Ì³Ì£¨»ùÓÚASP.NET MVC beta£©——µÚ¶þƪ£ºµÚÒ»¸öÒ³Ãæ
      ÕªÒª: ±¾ÎÄÊ×ÏÈÒ»²½Ò»²½Íê³ÉDemoµÄµÚÒ»¸öÒ³Ãæ——Ê×Ò³¡£È»ºó¸ù¾ÝʵÏÖ¹ý³Ì£¬ËµÃ÷Ò»ÏÂÆäÖÐÓõ½µÄÓëASP.NET MVCÏà¹ØµÄ¸ÅÄîÓëÔ­Àí¡£
ASP.NET MVC°¸Àý½Ì³Ì£¨»ùÓÚASP.NET MVC beta£©——µÚÈýƪ£ºASP.NET MVCÈ«¾Ö¹Û
      ÕªÒª: ±¾ÎĶÔASP.NET MVCµÄÈ«¾ÖÔËÐлúÀí ......

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨Ð¡½á

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨Ð¡½á
·¢²¼Ê±¼ä£º2009-11-25 11:13:03
¡¡¡¡1.Response.Redirect("http://www.yayiba.com",false);
¡¡¡¡Ä¿±êÒ³ÃæºÍÔ­Ò³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
ÌøתÏòеÄÒ³Ã棬ԭ´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨±»µ÷ÓÃʱ£¬Ëü»á´´½¨Ò»¸öÓ¦´ð£¬Ó¦´ðÍ·ÖÐÖ¸³öÁË
״̬´úÂë302£¨±íʾĿ±êÒѾ­¸Ä±ä£©ÒÔ¼°ÐµÄÄ¿±êURL¡£ä¯ÀÀÆ÷´Ó·þÎñÆ÷ÊÕµ½¸ÃÓ¦´ð£¬ÀûÓÃÓ¦´ðÍ·ÖеÄÐÅÏ¢·¢³öÒ»¸ö¶ÔÐÂURLµÄÇëÇó¡£Õâ¾ÍÊÇ˵£¬
ʹÓÃResponse.Redirect·½·¨Ê±Öض¨Ïò²Ù×÷·¢ÉúÔÚ¿Í»§¶Ë£¬×ܹ²Éæ¼°µ½Á½´ÎÓë·þÎñÆ÷µÄͨÐÅ£¨Á½¸öÀ´»Ø£©£ºµÚÒ»´ÎÊǶÔԭʼҳÃæµÄÇëÇó,
µÃµ½Ò»¸ö302Ó¦´ð£¬µÚ¶þ´ÎÊÇÇëÇó302Ó¦´ðÖÐÉùÃ÷µÄÐÂÒ³Ã棬µÃµ½Öض¨ÏòÖ®ºóµÄÒ³Ãæ¡£
¡¡¡¡2.Server.Transfer("Default2.aspx?name=zhangsan",true);
Ä¿±êÒ³ÃæºÍÔ­Ò³Ãæ¿ÉÒÔÔÚͬһ¸ö·þÎñÆ÷ÉÏ¡£
ÌøתÏòеÄÒ³Ã棬ԭ´°¿Ú±»´úÌæ¡£
²¨ÇòÂÛ̳ ä¯ÀÀÆ÷ÖеÄURLΪԭ·¾¶²»±ä¡£
ĬÈÏÇé¿öÏ£¬Server.Transfer·½·¨²»»á°Ñ±íµ¥Êý¾Ý»ò²éѯ×Ö·û´®´ÓÒ»¸öÒ³Ãæ´«µÝµ½ÁíÒ»¸öÒ³Ã棬µ«Ö»Òª°Ñ¸Ã·½· ......

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨Ð¡½á

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨Ð¡½á
·¢²¼Ê±¼ä£º2009-11-25 11:13:03
¡¡¡¡1.Response.Redirect("http://www.yayiba.com",false);
¡¡¡¡Ä¿±êÒ³ÃæºÍÔ­Ò³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
ÌøתÏòеÄÒ³Ã棬ԭ´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨±»µ÷ÓÃʱ£¬Ëü»á´´½¨Ò»¸öÓ¦´ð£¬Ó¦´ðÍ·ÖÐÖ¸³öÁË
״̬´úÂë302£¨±íʾĿ±êÒѾ­¸Ä±ä£©ÒÔ¼°ÐµÄÄ¿±êURL¡£ä¯ÀÀÆ÷´Ó·þÎñÆ÷ÊÕµ½¸ÃÓ¦´ð£¬ÀûÓÃÓ¦´ðÍ·ÖеÄÐÅÏ¢·¢³öÒ»¸ö¶ÔÐÂURLµÄÇëÇó¡£Õâ¾ÍÊÇ˵£¬
ʹÓÃResponse.Redirect·½·¨Ê±Öض¨Ïò²Ù×÷·¢ÉúÔÚ¿Í»§¶Ë£¬×ܹ²Éæ¼°µ½Á½´ÎÓë·þÎñÆ÷µÄͨÐÅ£¨Á½¸öÀ´»Ø£©£ºµÚÒ»´ÎÊǶÔԭʼҳÃæµÄÇëÇó,
µÃµ½Ò»¸ö302Ó¦´ð£¬µÚ¶þ´ÎÊÇÇëÇó302Ó¦´ðÖÐÉùÃ÷µÄÐÂÒ³Ã棬µÃµ½Öض¨ÏòÖ®ºóµÄÒ³Ãæ¡£
¡¡¡¡2.Server.Transfer("Default2.aspx?name=zhangsan",true);
Ä¿±êÒ³ÃæºÍÔ­Ò³Ãæ¿ÉÒÔÔÚͬһ¸ö·þÎñÆ÷ÉÏ¡£
ÌøתÏòеÄÒ³Ã棬ԭ´°¿Ú±»´úÌæ¡£
²¨ÇòÂÛ̳ ä¯ÀÀÆ÷ÖеÄURLΪԭ·¾¶²»±ä¡£
ĬÈÏÇé¿öÏ£¬Server.Transfer·½·¨²»»á°Ñ±íµ¥Êý¾Ý»ò²éѯ×Ö·û´®´ÓÒ»¸öÒ³Ãæ´«µÝµ½ÁíÒ»¸öÒ³Ã棬µ«Ö»Òª°Ñ¸Ã·½· ......

asp.net Gridview TextBox »Ø³µµÄÎÊÌâÔõô½â¾ö?

Ê×ÏȽ¨Á¢¿Ø¼þGridView1£¬×¢ÒâàÞ
Ò³ÃæEnableEventValidation="false"±ØÐëµÄ¡£
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" AutoGenerateColumns="false" runat="server">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Panel ID="Panel1" DefaultButton="Button1" runat="server">
<asp:TextBox ID="TextBox1" Text='<%#Eval("StrValue")%>' runat="server" />
<asp:Button ID="Button1" UseSubmitBehavior="false" runat="server" Text="Button" OnClick="Button1_Click" />
</asp:Panel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</div>
</form>
ÎÒΪÁËʹÎÒµÄGridViewÓÐÊý¾Ý²âÊÔ£¬ËùÒÔÐÂÔöÁËtestÀ࣬¥Ö÷ÍêÈ«ÓÃÊý¾Ý¿âÀ´ÌṩÊý¾Ý¡£
public class test
{
private string strValue;
public string StrValue
{
get
{
return strValue; ......
×ܼǼÊý:2672; ×ÜÒ³Êý:446; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [16] [17] [18] [19] 20 [21] [22] [23] [24] [25]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ