asp.netϺǫ́³£Ó÷ÖÒ³½â¾ö·½°¸µÄ˼¿¼
SQL
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
--°¢»áéªsosuo8.com¸ù¾ÝÍøÂçÉϵĴúÂë½øÐÐÁËÐ޸ģ¬°æȨ¹éÔ×÷ÕßËùÓÐ2009-4-5
--°¢»áéª×öÁËÒ»´ÎÉý¼¶£¬2009-9-27
--ÐÞ¸ÄÊä³ö×ܼǼÊý
ALTER PROCEDURE [dbo].[pagination]
@tblName nvarchar(1000), -- ±íÃû
@fldName nvarchar(1000), -- ÐèÒª·µ»ØµÄÁÐ
@orderfldName nvarchar(255), -- ÅÅÐòµÄ×Ö¶ÎÃû
@PageSize int, -- Ò³³ß´ç
@PageIndex int, -- Ò³Âë
@OrderType bit, -- ÉèÖÃÅÅÐòÀàÐÍ, ·Ç 0 ÖµÔò½µÐò
@strWhere nvarchar(1500), -- ²éѯÌõ¼þ (×¢Òâ: ²»Òª¼Ó where)
@isCount bit--ÉèÖÃÊÇ·ñ·µ»Ø¼Ç¼×ÜÊý£¬0²»·µ»Ø¡¢1·µ»Ø
AS
declare @strSQL nvarchar(4000) -- Ö÷Óï¾ä
declare @strTmp nvarchar(110) -- ÁÙʱ±äÁ¿
declare @strOrder nvarchar(400) -- ÅÅÐòÀàÐÍ
--declare @timediff datetime --ºÄʱ
begin
--select @timediff = Getdate()
--if @strWhere !=''
if @isCount = 1
exec('select count(*) from ' + @tblName + ' where '+@strWhere)
Else
if @OrderType != 0
begin
set @strTmp = '<(select min'
set @strOrder = ' order by ' + @orderfldName +' desc'
--Èç¹û@OrderType²»ÊÇ0£¬¾ÍÖ´ÐнµÐò£¬Õâ¾äºÜÖØÒª£¡
end
else
begin
set @strTmp = '>(select max'
set @strOrder = ' order by ' + @orderfldName +' asc'
end
if @PageIndex = 1
begin
if @strWhere != ''
set @strSQL = 'select top ' + str(@PageSize) +' '+@fldName+ ' from ' + @tblName + ' where ' +
Ïà¹ØÎĵµ£º
×î½üÅöµ½Ò»ÎÊÌ⣬ÐèÒªÔÚASP.NetºÍJavaScriptÖд«µÝÊý¾Ý¡£¾ßÌåµÄÐèÇóÊÇÕâÑùµÄ£¬Ò³Ãæpostbackºó½«»áload JS£¬µ«ÊÇÐèÒª¼Çס֮ǰij¸ö״̬£¬Õâ¸ö״̬ÊÇÖ¸JSµÄ״̬£¬Ò²¾ÍÊÇ˵load JSºó£¬»¹Òª¼Çס֮ǰµÄ״̬£¬¶ø²»Êǻص½Ä¬ÈϵÄ״̬¡£
Ò»¿ªÊ¼ÏëÁ˺ܶà°ì·¨£¬µ«¶¼²»³É¹¦£¬ºóÀ´ÎÊÁËÎÊͬÊ£¬·¢ÏÖ¿ÉÒÔͨ¹ýÒþ²ØµÄ±íµ¥ÔªËØÀ´´«µÝÊý¾Ý£¬ËùÒ ......
ÏÂÃæÒª½â¾öµÄÎÊÌâÈçÏ£º
1.ÈçºÎÔÚJavaScript·ÃÎÊC#º¯Êý?
¡¡¡¡2.ÈçºÎÔÚJavaScript·ÃÎÊC#±äÁ¿?
¡¡¡¡3.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptµÄÒÑÓбäÁ¿?
¡¡¡¡4.ÈçºÎÔÚC#ÖзÃÎÊJavaScriptº¯Êý?
¡¡¡¡ÎÊÌâ1´ð°¸ÈçÏ£º
¡¡¡¡javaScriptº¯ÊýÖÐÖ´ÐÐC#´úÂëÖеĺ¯Êý£º
¡¡¡¡·½·¨Ò»£º
&nbs ......
ÔÚASP.NETÍøÕ¾¿ª·¢ÖпÉÄÜ»áÓöµ½Òª¸ü»»Êý¾Ý¿â£¬È罫Aceess»»ÎªSQL Server £¬ÓÉÓÚAceessÒýÓÃSystem.Data.OleDbÃüÃû¿Õ¼ä£¬SQL ServerÒýÓÃSystem.Data.SqlClientÃüÃû¿Õ¼ä¡£ÔÚÒ»°ã³ÌÐò´úÂëÖÐÎÒÃÇÐèÒª¸ü¸ÄÁ¬½Ó×Ö·û´®£¬ADO.NETÊý¾Ý·ÃÎÊÃüÁî¶ÔÏó£¬×îÂé·³µÄÊDz»Í¬Êý¾Ý¿âÓи÷×Ô²»Í¬SqlÃüÁî¡£ÎÒÃÇ¿ÉÒÔʹÓóéÏ󹤳§Ä£Ê½ÊµÏÖASP.NET·ÃÎʲ ......
ĸ°æÒ³Ãæ
-- н¨Ò»Ä¸°æÒ³Ãæ
-- ÔÚÊʵ±Î»ÖüÓÈë´úÂ룺
<asp:ContentPlaceHolder ID="ContentPlaceHolder3" runat="server">
...ÕâÖ®¼äµÄÄÚÈÝÈç¹ûûÓÐContentÄÚÈÝ£¬½«»áµÃµ½ÏÔʾ£»
...Èç¹ûÓÐContentÄÚÈÝ£¬½«»á±»ContentÄÚÈÝÌæ»»µô
</asp:ContentPlaceHolder>
ContentÒ³Ãæ
-- н¨Ò»WEB´°Ìå
-- ÔÚÊʵ± ......
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.Attribute ......