Feed on
Subscription

The plan distributing a page below Access



Specific did not say more,Stick a relevant source ~ only
Using System;Using System.Collections.Generic;Using System.Text;Using System.Data;Using System.Data.OleDb;Using System.Web;

/ **//// %26lt;summary%26gt;
/ / / name:The plan distributing a page below Access (process of copy Sql memory)
/ / / author:Cncxz(bug)
/ / / Blog:Http://cncxz.cnblogs.com
/ / / %26lt;/summary%26gt;Public Class AdoPager
{Protected String M_ConnString;Protected OleDbConnection M_Conn;
Public AdoPager()
{
CreateConn(string.Empty);
}Public AdoPager(string DbPath)
{
CreateConn(dbPath);
}
Private Void CreateConn(string DbPath)
{If (string.IsNullOrEmpty(dbPath) )
{String Str = System.Configuration.ConfigurationManager.AppSettings["dbPath"] As String;If (string.IsNullOrEmpty(str) )Str = "~/App_Data/db.mdb";M_ConnString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" , httpContext.Current.Server.MapPath(str));
}ElseM_ConnString = String.Format(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0}" , dbPath);
M_Conn = New OleDbConnection(m_ConnString);
}
/ **//// %26lt;summary%26gt;
/ / / open join
/ / / %26lt;/summary%26gt;Public Void ConnOpen()
{If (m_Conn.State! = ConnectionState.Open)M_Conn.Open();
}
/ **//// %26lt;summary%26gt;
/ / / close link
/ / / %26lt;/summary%26gt;Public Void ConnClose()
{If (m_Conn.State! = ConnectionState.Closed)M_Conn.Close();
}
Private String RecordID(string Query, int PassCount)
{
OleDbCommand Cmd = New OleDbCommand(query, m_Conn);String Result = String.Empty;Using (IDataReader Dr = Cmd.ExecuteReader() )
{While (dr.Read() )
{If (passCount%26lt;1)
{Result += " , "+ Dr.GetInt32(0);
}PassCount- - ;
}
}Return Result.Substring(1);
}


/ **//// %26lt;summary%26gt;
/ / / the record that gets current page to should show,Notice:The automatic number that the name must include to be ID in inquiry is listed,If do not accord with your requirement,Revise next one sources:)
/ / / %26lt;/summary%26gt;
/ / / %26lt;/param of %26lt;param Name=%26quot;pageIndex%26quot;%26gt; current page number%26gt;
/ / / %26lt;/param of capacity of page of %26lt;param Name=%26quot;pageSize%26quot;%26gt; cent%26gt;
/ / / the field %26lt;/param that %26lt;param Name=%26quot;showString%26quot;%26gt; shows%26gt;
/ / / %26lt;param Name=%26quot;queryString%26quot;%26gt; inquires string,Support inquires %26lt;/param jointly%26gt;
/ / / %26lt;param Name=%26quot;whereString%26quot;%26gt; inquires a condition,If be restricted conditionally criterion must with %26lt;/param of Where begin%26gt;
/ / / %26lt;/param of regulation of %26lt;param Name=%26quot;orderString%26quot;%26gt; sort%26gt;
/ / / %26lt;param Name=%26quot;pageCount%26quot;%26gt; comes out parameter:Total page counts statistical %26lt;/param%26gt;
/ / / %26lt;param Name=%26quot;recordCount%26quot;%26gt; comes out parameter:Always record statistical %26lt;/param%26gt;
/ / / %26lt;returns%26gt; lades the DataTable%26lt;/returns of the record%26gt;Public DataTable ExecutePager(int PageIndex, int PageSize, string ShowString, string QueryString, string WhereString, string OrderString, out Int PageCount, out Int RecordCount)
{If (pageIndex%26lt;1) PageIndex = 1;If (pageSize%26lt;1) PageSize = 10;If (string.IsNullOrEmpty(showString)) ShowString = "*";If (string.IsNullOrEmpty(orderString)) OrderString = "ID Desc";
ConnOpen();String MyVw = String.Format(" ({0} ) TempVw " , queryString);
OleDbCommand CmdCount = New OleDbCommand(string.Format(" Select Count(0) As RecordCount From {0} {1}" , myVw, whereString) , m_Conn);
RecordCount = Convert.ToInt32(cmdCount.ExecuteScalar());
If ((recordCount % PageSize)%26gt;0)PageCount = RecordCount / PageSize + 1;ElsePageCount = RecordCount / PageSize;
OleDbCommand CmdRecord;If (pageIndex==1)// the first page
{CmdRecord = New OleDbCommand(string.Format("select Top {0} {1} From {2} {3} Order By {4} " , pageSize, showString, myVw, whereString, orderString) , m_Conn);
}Else If (pageIndex%26gt;PageCount)// exceeds total page number
{CmdRecord = New OleDbCommand(string.Format("select Top {0} {1} From {2} {3} Order By {4} " , pageSize, showString, myVw, "Where 1=2" , orderString) , m_Conn);
}Else
{Int PageLowerBound = PageSize * PageIndex;Int PageUpperBound = PageLowerBound - PageSize;String RecordIDs = RecordID(string.Format("select Top {0} {1} From {2} {3} Order By {4} " , pageLowerBound, "ID" , myVw, whereString, orderString) , pageUpperBound);CmdRecord = New OleDbCommand(string.Format("select {0} From {1} Where Id In ({2}) Order By {3} " , showString, myVw, recordIDs, orderString) , m_Conn);

}
OleDbDataAdapter DataAdapter = New OleDbDataAdapter(cmdRecord);
DataTable Dt=new DataTable();DataAdapter.Fill(dt);
ConnClose();Return Dt;
}
}

Still have call give typical examples:Html code
%26lt;%@ Page Language=%26quot;C#%26quot; AutoEventWireup=%26quot;true%26quot; CodeFile=%26quot;Default.aspx.cs%26quot; Inherits=%26quot;_Default%26quot; %%26gt;

%26lt; ! DOCTYPE Html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "%26gt;

%26lt;html Xmlns=%26quot;http://www.w3.org/1999/xhtml %26quot;%26gt;
%26lt;head Runat=%26quot;server %26quot;%26gt;
%26lt;title%26gt; divides a page to demonstrate %26lt;/title%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;form Id=%26quot;form1%26quot; Runat=%26quot;server %26quot;%26gt;
%26lt;div%26gt;
%26lt;br /%26gt;
Turn to %26lt;asp:TExtBox ID=%26quot;txtPageSize%26quot; Runat=%26quot;server%26quot; Width=%26quot;29px%26quot;%26gt;1%26lt;/asp:TExtBox%26gt; page %26lt;asp:BUtton ID=%26quot;btnJump%26quot; Runat=%26quot;server%26quot; Text=%26quot;Go%26quot; OnClick=%26quot;btnJump_Click%26quot; /%26gt;%26lt;br /%26gt;
%26lt;asp:GRidView ID="GridView1" Runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" Width="90% "%26gt;
%26lt;FooterStyle BackColor=%26quot;#507CD1%26quot; Font-Bold=%26quot;True%26quot; ForeColor=%26quot;White%26quot; /%26gt;
%26lt;RowStyle BackColor=%26quot;#EFF3FB%26quot; /%26gt;
%26lt;EditRowStyle BackColor=%26quot;#2461BF%26quot; /%26gt;
%26lt;SelectedRowStyle BackColor=%26quot;#D1DDF1%26quot; Font-Bold=%26quot;True%26quot; ForeColor=%26quot;#333333%26quot; /%26gt;
%26lt;PagerStyle BackColor=%26quot;#2461BF%26quot; ForeColor=%26quot;White%26quot; HorizontalAlign=%26quot;Center%26quot; /%26gt;
%26lt;HeaderStyle BackColor=%26quot;#507CD1%26quot; Font-Bold=%26quot;True%26quot; ForeColor=%26quot;White%26quot; /%26gt;
%26lt;AlternatingRowStyle BackColor=%26quot;White%26quot; /%26gt;
%26lt;/asp:GRidView%26gt;

%26lt;/div%26gt;
%26lt;asp:LAbel ID=%26quot;Label1%26quot; Runat=%26quot;server%26quot; Text=%26quot;Label%26quot;%26gt;%26lt;/asp:LAbel%26gt;
%26lt;/form%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;


The Codebehind code of give typical examplesUsing System;Using System.Data;Using System.Configuration;Using System.Web;Using System.Web.Security;Using System.Web.UI;Using System.Web.UI.WebControls;Using System.Web.UI.WebControls.WebParts;Using System.Web.UI.HtmlControls;Using System.Collections.Generic;
Public Partial Class _Default: System.Web.UI.Page
{Private AdoPager Mm_Pager;Protected AdoPager M_Pager
{Get{If (mm_Pager==Null)Mm_Pager = New AdoPager();Return Mm_Pager;
}
}Protected Void Page_Load(object Sender, eventArgs E)
{If(! IsPostBack)
LoadData();
}Private Int PageIndex = 1;Private Int PageSize = 20;Private Int PageCount = -1;Private Int RecordCount = -1;
Private Void LoadData()
{String StrQuery = "select A. * , b.KindText From TableTest A Left Join TableKind B On A.KindCode=b.KindCode ";String StrShow = "ID, subject, kindCode, kindText";

DataTable Dt = M_Pager.ExecutePager(pageIndex, pageSize, strShow, strQuery, "" , "ID Desc" , out PageCount, out RecordCount);
GridView1.DataSource = Dt;
GridView1.DataBind();
Label1.Text = String.Format(" in all {0} record,Every page {1} ,Page second {2}/{3}" , recordCount, pageSize, pageIndex, pageCount);
}

Protected Void BtnJump_Click(object Sender, eventArgs E)
{Int.TryParse(txtPageSize.Text, out PageIndex);
LoadData();
}
}


File of final attach project downloads an address:Http://www.cnblogs.com/Files/cncxz/AdoPager.rar...

How be in Web development column of caption of perfect control IE



IE and any at present the caption column of the browser,Should be by %26lt;title%26gt; this HTML label comes originally pilot,Of course now also still is.Just current ghost trend is,You had better not again refresh your webpage page,The aleatoric devastate that still needs to accept an user next.This namely dragon of the god in fokelore sees head do not see end,Technology of the Ajax when committing murder to be contrary to aeriformly at having a shadow!

Apt page headline shows in the caption column of the browser,The expression that is major of a webpage,Also can prop up to search index at the same time friendly.Of course if put appropriate clew information,Also meet very significant.So how " is dynamic of " come custom-built this caption content?

We know use ASP trends revises browser Title,It is such statement probably:

%26lt;title%26gt;%26lt;% = GenerateTitle %%26gt;%26lt;/title%26gt;

And in ASP.NET 1.1,Besides still can use the method above,We became much one looks " is very beautiful the method of " :

In Aspx Page:
%26lt;title Id=%26quot;cltTitle%26quot; Runat=%26quot;server%26quot;%26gt;%26lt;/title%26gt;
In CS File: Protected HtmlGeneralControl CltTitle;
. . . CltTitle.innerHtml = "birdshome's Homepage";

Arrived today ASP.NET 2.0 times,Besides two kinds of methods above,We are OK still easier modification %26lt;title%26gt; content:

Page.Title = "birdshome's Homepage";

Nevertheless the %26quot; trends %26quot; above is the content that carries modification %26lt;title%26gt; in the server,Actually to the browser the content inside %26lt;title%26gt; label is completely fixed.Below return to the subject,Careful for the control that says to carry column of pair of IE browser caption in the client:

To the page in IE window,In page DOM object,Document.title attribute is be gotten with the InnerHTML that will replace %26lt;title%26gt; element and install content of column of IE window caption.Look please below this give typical examples:

%26lt;html%26gt;
%26lt;body%26gt;
%26lt; ! - - Page Content- -%26gt;
%26lt;script Language=%26quot;javascript %26quot;%26gt;Document.body.onload = Function()
{Document.title = "birdshome's Homepage" ;
};
%26lt;/script%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;

To,The caption column that can have installed common IE window so simply namely.So it what this has is good that what this has say?If we put identical code into mode window,carry out at that time?Whether can be the caption column of mode window revised?Test result is dismay letting a person however,This paragraph of identical code,Was out of order in mode window.the DOM that mode window offers and common window are different?Actually the DOM of mode window and common window are identical,And different point is when mode window medium page lades after finishing,Document.title attribute is met really invalidation.This is why the reason with the invalid statement in incident of above Onload of code of give typical examples.The method that resolves this restriction is very simple,Should have not laded in the page namely Document.title is revised when finishing,Revise IE caption column to use such code because of this in mode window so:

%26lt;html%26gt;
%26lt;body%26gt;
%26lt; ! - - Page Content- -%26gt;
%26lt;script Language=%26quot;javascript %26quot;%26gt;Document.title = "birdshome's Homepage" ;
%26lt;/script%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;

It is one included the give a demonstration that above revises method of browser caption column two kinds below,Save its for "abc.htm" file,Use IE opens you very can intuitionistic see distinction:

%26lt;html%26gt;
%26lt;body%26gt;
%26lt;button Onclick=%26quot;foo() %26quot;%26gt;
Open%26lt;/button%26gt;
%26lt;script Language=%26quot;javascript %26quot;%26gt;Document.body.onload = Function()
{Document.title = "birdshome's Homepage (rewrite)" + Unescape(H_A0);
};
Document.title = "birdshome's Homepage (first)" + Unescape(H_A0);
Function Foo()
{Window.showModalDialog("abc.htm");
}
%26lt;/script%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;

The caption column that is common IE window as a result can turn into quickly from "birdshome's Homepage (first)" "birdshome's Homepage (rewrite)" ,And the caption of the mode dialog box of open of use Open pushbutton will be "birdshome's Homepage (first)" all the time.From inside this give typical examples we can see,To common IE window,Its caption column is OK live in the page period always undertake modification arbitrarily.And the caption column of mode window,We can lade in its page only before finishing (before Onload incident sparks) ability is revised.Blame mode dialog box,Opend By ShowModelessDialog,The processing to caption column and just the same of mode dialog box.

The skill in saying a Document.title is used again finally,When if " dynamic " is carried to revise page Title in the server,we know,We are OK to %26lt;title%26gt;%26nbps; is written to produce successive blank space to input the effect between %26lt;/title%26gt; label.This skill is in mode window particularly useful,Come so the model of written characters of " - Web Page Dialog" that we can be fed up with that chooses title with successive blank space go outside column.After use Document.title attribute will revise page headline column,No matter be common window or mode window,%26quot;%26quot; and %26quot; %26quot;(blank space) cannot use,Former meeting is become directly string shows on caption column,Latter is added also have blank space of a " "(only more again) width effect.We should use another blank space again here,Entity will solve this problem.Code is as follows:

%26lt;html%26gt;
%26lt;body%26gt;
%26lt;script Language=%26quot;javascript %26quot;%26gt;Var HexA0s = "%A0 %A0 %A0 %A0";
Document.body.onload = Function()
{Document.title = "birdshome's Homepage (rewrite)" + Unescape(HexA0s);
};
%26lt;/script%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
Http://birdshome.cnblogs.com/archive/2006/06/23/control_browser_title.html...

ASP.NET 2.0 theme and skin realize website beautification



    theme and exterior are ASP.NET 2.0 medium add a function newly, of use ASP.NET 2.0 " theme and exterior " function,Can disclose style and layout information for independent file group,A general designation is " theme " .Next,Thematic applicable at any sites,The page in affecting a site and accuse the exterior.Such,Through changing a theme to be able to safeguard the style to the site easily to change,And need not to the site each page has an edition.Still can share a theme with other development staff.Apply ASP.NET 2.0 " theme and exterior " the function realizes beautiful to the website control easily.

ASP.NET offerred     a few in can using a program, mix to the page accuse the function that the exterior or style have be defininged oneself.Accuse a model of object of supportive Style,The modal attribute such as the scenery before be being used at color of setting font, frame, setting to mix, width, height.Accuse a complete still support to be able to set the pattern express with the cascade pattern that charges an attribute depart (CSS) .Can define modal information to accuse an attribute or CSS,This information is defined in the alone file group that also can be Theme in the name,So that apply at using a program all or partial page.Each accuse a style to be appointed to be Skin in the theme.

    " theme " ,It offerred a kind of simple and easy way,Can be a site to accuse mediumly at using the page of the program independently with the page definition style is installed.The advantage of many themes depends on,The pattern need not consider when designing a site,The page also need not be updated when using a type later or use program code.In addition,Still can obtain from exterior source from definition theme,So that apply modal setting at using a program.The advantage of a theme depends on,The style installs memory in a position,Can become independent to safeguard these settings at using the applied program of this theme.

The page that the give typical examples below     demonstrates is had same a theme,Apply this theme to appoint accuse a style to install.Notice,This page itself does not need to contain any modal information.When move this theme uses modal property automatically at this page accuse.

    builds project of a Web,Click " add new " ,Choice " thematic exterior " name for " Button.skin " , click " add " by twist,If the graph is shown 1 times


...

Monthly pay counts the.net of ten thousand to develop interest of invite applications for a job to inscribe two



   One, the Net of on monthly pay ten thousand develops personnel problem

    has one team to grow 100 meters,Divide evenly fast advancement,Orderly with divide evenly fast from the team head motion returns team head next to team remaining part,Meantime team advanced 100 meters,The distance that asks orderly motion.
    spent 100 seconds in all suppose, the speed of the team is orderly speed for 1; V, orderly is S to the distance of team remaining part.
    walks along 100 M + 2 * S in all.

...

ASP.NET 2.0 shift develops use type of the introduction



Every ASP.NET shift accuses     offerred a certain number of style property,Use these attribute to be able to accuse from the definition present means.Of course you also can use StyleSheet to accuse will define modal information, be in next same of a page different accuse on the modal information that uses StyleSheet to accuse a definition. We had alluded in front you not only can use the type those who differ accuse on, the OK still to container applying that accuse on, assured to accuse a medium shift to accuse an user that has consistency to experience in container so so.
 
    StyleSheet accuses should place in the page, is not container accuses in. In fact, this is only can be placed a WEB shift outside accuses in container. Accuse to all pages and shift for, we can define a StyleSheet to accuse only. A StyleSheet is added to accuse in you hind, can define corresponding modal attribute through opening modal editor.

    is founded to be on page of a mobile WEB, from definition and application a StyleSheet accuses,We can undertake installing according to the measure that be as follows:

    1. Procrastinate drag a StyleSheet to accuse go up to mobile WEB page.

    2. Right key clicks StyleSheet to accuse," of the choice in playing the menu that go out is modular option " commands.Can appear at this moment a " is modular option " dialog box,Following plan institute are shown.This dialog box allows to you are founded and edit many styles and equipment to choose implement,Equipment is chosen implement introduce in detail in will the following bar.


...

A few methods that Aspx webpage stores with HTML form




The first kind is stencil is replaced:
Environment: MIcrosoft.NET Framework SDK V1.1
OS:WEdition of Chinese of Indows Server 2003
ASP.Net makes static HTML page
The FileSystemObject target that static page uses is made in what come true in Asp!
What involve this kind of operation in.Net is System.IO
It is program code is noted below: 碨hun  imperial order steals  ?! referenced others code

...

ASP.NET skill:The method of Aspx webpage duplicates when development



The Copy /paste with   simple   *.aspx webpage, what what use is same a CodeBehind , what often we do not want this! ! !

    we hope to make these two webpages are had commonly respective *.cs file.

    measure:

    ① builds a WebForm.

...

Small discuss the ViewState that optimizes ASP.NET application function piece



If you have,be used to in what source code of HTML of the current page that browse examines in IE,You perhaps regular meeting sees similar and the following code segment:

%26lt;input Type=%26quot;hidden%26quot; Name=%26quot;__VIEWSTATE%26quot; Value=%26quot;dDwtMzU5NzUyMTQ1O3Q8O2w8aTwwPjs+O2w8dDw7bDxpPDA+Oz47bDx0PDtsPG
...

...

The settlement of the problem that ASP.Net creates tiring-room scenario method



    develops Web application to be used via regular meeting with ASP.NET shoot a dialog box,Such usually I writing

Response.Write("" , %26quot;%26lt;script%26gt;alert(' plays a window!');%26lt;/script%26gt;%26quot;);

    but such writing a problem is played when the dialog box namely when going out, whole page is white,Plan in slow shift,Waited for you to nod after deciding good,This is why?

...

Little skill of ASP.NET 2.0 process designing two




   1, use App_offline.htm

    is in Asp.net 2.0,If you want COPY site,Undertake the site is safeguarded,Deploy,And undertake a large number of modification,Should stop your WEB to use a program likely,And to the user with a friendly means clew,For instance what " this website is being updated " the information that wait a moment,In ASP.NET 2.0,You can build to call App_offline.htm(big the ordinary form of a Chinese numeral to have nothing to do with) file of static HTM page,The content that modifies you to want to show temporarily among them,Below the root catalog of the application that puts its in you.Such,Any external if requesting,Be gone to by move on metropolis horse this page.This moment,Your website still can be visited,Just your application cannot be visited.Breathe out ah,In that way word,Can avoid very much newer website to bother a thing yes.

...
« 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 »