Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

»ùÓÚIPagedList µÄ Asp.Net MVC ·ÖÒ³

ÉÏ´Îд¹ýһƪMVC·ÖÒ³µÄ
×Ô¼ºÓõÄÒ»¸öASP.Net MVC·ÖÒ³ÄóöÀ´·ÖÏíÏÂ
ÏÖÔÚ·¢Ò»¸ö¸Ä½ø°æ
ÀïÃæÓõ½µÄIPagedListÎÒ×Ô¼ºÒ²¼Ç²»ÇåÊÇ´ÓÄÄÀïCOPYÀ´µÄÁË¡£ºÇºÇ
ÕâÀïÎҾͲ»°ÑIPagedListµÄ´úÂëÌù³öÀ´ÁË£¬ÒªÊ¹µÄÏÂÔØDEMO×Ô¼ºÄðɡ£
ºǫ́¶ÔÊý¾ÝµÄ·ÖÒ³
public ActionResult Index([DefaultValue(1)]int p,[DefaultValue(10)]int pagesize)
        {
            var model = Database.List.OrderByDescending(z=>z.Id).ToPagedList(p-1,pagesize);
            return View("Index",model);
        }
 
¸öÈË×î½ü±È½Ïϲ»¶Ê¹ÓÃDefaultValue
µ±È»Ò²¿ÉÒÔд³É
public ActionResult Index(int? p,int? pagesize)
        {
            p = p ?? 1;
            pagesize = pagesize ?? 10;
            var model = Database.List.OrderByDescending(z=>z.Id).ToPagedList(p-1,pagesize);
            return View("Index",model);
        }
ÕâÀïToPagedList Õâ¸öÀ©Õ¹·½·¨ÀïµÚÒ»¸ö²ÎÊýÊÇindex
ÀÁµÃÈ¥¸Ä³ÉpageÁË£¬ËùÒÔ¾ÍÓÃÁË p-1
ǰ̨Öе÷ÓÃ
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcDemo.IPagedList<MyModel>>" %>
 
    <%= Html.PagerBar(ViewData.Model) %>
    <table>
        <thead>
        <tr>
            <th>Id</th>
            <th>ÐÕ?Ãû?</th>
            <th>ÓÊ&


Ïà¹ØÎĵµ£º

ASP.NETÖжÁÈ¡excelÄÚÈÝ,²¢ÏÔʾÔÚ½çÃæÉÏ

ÏîÄ¿Öо­³£»áÓõ½°ÑexcelµÄÎļþÄÚÈݵ¼Èëµ½Êý¾Ý¿âÖеÄ,¸Õ¸Õ»¨Á˵ãʱ¼ä,×öÁ˸öÀý×Ó,»ù±¾ÉÏÄÜʵÏÖµ¼ÈëExcelºóÏÔʾµÄ¹¦ÄÜ°É,µ¼ÈëµÄexcelÎļþµÃÊÇxls,¼´ÊÇ2003µÄ.
    ´úÂë˼·ÈçÏÂ:Òª¶ÁÈ¡µÄexcelÎļþ±ØµÃµÃÊÇÔÚ±¾µØÓ²ÅÌ,ËùÒÔÒ»°ãÀ´Ëµ¶¼ÊÇÈÃÔ¶³ÌÓû§Ñ¡Ôñ×Ô¼ºÓ²ÅÌÉϵÄExcelÎļþ,È»ºó°ÑÓû§Ñ¡ÔñµÄÎļþÉÏ´«µ½±¾µØ· ......

Asp.Net ʹÓÃJMail ʵÏÖÓʼþȺ·¢

Õâ¸öÐèÒªµ½ gougou ÉÏÕÒһϠJMail °²×°ÅäÖÃÒ»ÏÂ
°²×°
[¸úʹÓñð¸ö×é¼þÒ»Ñù£¬ÔÚʹÓÃJmailÓʼþ×é¼þ֮ǰҪÏÈ°²×°»ò×¢²á¸Ã×é¼þJmail.dll¡£
¾ßÌå×¢²á·½·¨£¬ÊÇÏÈ°ÑJmail.dllÎļþ¿½±´µ½Ó²Å̵ÄijһĿ¼Ï£¨ÈçC:\Jmail\Jmail.dll£©
È»ºóÖ´ÐÐÃüÁîRegsvr32 C:\Jmail\Jmail.dll¼´¿É]
ÉÏÔ´Âë
using System;
using System.Data;
......

ASP.NETÊý¾Ý°ó¶¨_µÚÈýƪ_ÓÃObjectDataSource¿Ø¼þ°ó¶¨

+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:GridView ID="GridView1" runat="server" DataSourceID="ObjectDataSource1"
  AutoGenerateColumns="true" DataKeyNames="EMPNO">
</asp:GridView>   
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetEmp" TypeName="O ......

ASP.NETÊý¾Ý°ó¶¨_µÚËÄƪ_ÓÃSqlDataSource¿Ø¼þ°ó¶¨_01

+++ Ò³Ãæ´úÂëÈçÏ£º
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" DataKeyNames="username" DataSourceID="SqlDataSource1"
    PageSize="3">
    <Columns>
    ......

ASP.NET System.Web.HttpContextÀàCurrentÊôÐÔ

1¡¢.NetµÄHTTPÇëÇó
.NETÓëASPµÄÔËÐлúÖÆÓкܴó²»Í¬.
ASPµÄÇëÇóÓëÏìÓ¦ÊÇ,ASPÒ³Ãæ±»ÇëÇó,È»ºóÖðÐнâÊÍ.ÊÇ»ùÓÚ¹ý³ÌµÄ.×î¶àÊÇ°üº¬ÁËÎļþ,ÐèÒªÏÈÒýÈëÎļþ°ÕÁË.
¶ø.Net,ÔÚÒ³Ãæ±»ÇëÇóºó,Ê×ÏÈÊǼÓÔØHTTP Module,Õâ²»ÊDZ¾ÎĵÄÖصã.È»ºóÔÙ¼ÓÔØHTTP
Handler.ÕâÒ²²»ÊDZ¾ÎĵÄÖصã.¼ÓÔصÄÕâÁ½Ïî,¶¼ÐèÒªÔÚWebconfigÎļþÖÐÅäÖÃ.´ó¼ÒÖªµÀ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ