Feed on
Subscription

Program of ASP.NET application program and design (1)



Summary:How understanding plans and design program of ASP.NET application.The article is with process of application of Web of a knowledge base exemple,A few the commonnest elements in discussing to apply a program actually to establish practice.

    brief introduction

    this is article of a series,How do we use progressively and detailed introduction Microsoft ASP.NET and Microsoft Visual Studio.NET to come in this series article the process of Web application of design, implementation and deploy model,A few the commonnest elements in establishing practice in order to discuss actual application process.We arrange system of window of a few Web not just,Also not confine is decided at undertaking to back end database a few data are bound only.Data is bound decide and position of body of Web window is very significant,But it is very important also to have a lot of other issues.

    for example,Why to no matter use,plant target platform or language,All projects that pass good code include a few basic program measure,For example documentation of plan of target statement, user,The physical border that is used at label solution even and the architecture documentation with attrib border logic.In addition,In solution lifecycle inchoate be being included inside with respect to will safe program is a kind of first-rate habit.Of these content and good database model, elaborate design among package and concise user interface are designed one case,Can ensure you are final the applied process of aborning deploy is safe, reliable,And be the user is friendly.

    right now,A few readers may think the article belongs to the essay with those very high fundamental key,Target fixed position is in certain exceed plan of large company level,And this kind of plan applies to general coolie plant, lover or individual to develop an organization far from.Not be actually such!The is based on Web small-sized solution that although just found you oneself,the individual uses,Will conduce to the relaxed implementation that ensures technological process is final and deploy from the program that has perfecting at the beginning.And,Not be advanced programmer or ability of staff of Web development can use these technologies.No matter your technical level how,Also no matter you belong to reader of which kinds of target,I believe you can discover this a series of articles are very helpful to you,It provided substantial information for you,And (allow me to say so please) very interesting.

We will generate     a Web of knowledge base of give typical examples that calls DotNetKB uses a program,This process general is perforative and whole series article.In the article that serves as the first article,The design phase that we will introduce typical item,Include architecture of process of main program, application and implementation plan design.After learning the article,You will prepared all documentation,Meet ground of too impatient to wait hopes to begin to found a solution.

Work of     provision is very simple,We jump over this part content,Begin the first step directly " applied process plans " .

    program is main process of ASP.NET application

The first situation that     uses Visual Studio.NET to establish the program of ASP.NET application that is based on Web is to make primary applied process plan (AP) .Establishing a program is indispensable large to what build by many development staff solution not only,And although to the smallest application order,A perfect AP also is very important.Found AP to conduce to you beginning encode " before " can consider a few common issues carefully.Such,What you are applying program lifecycle is inchoate know challenge and solution completely,is not after be immersed in corner completely ability discovers a problem.Be in " Software Project Survival Guide " in one book,Author Steve McConnell points out:The cost that corrects wrong place flower in software project later period and the cost photograph that discover in inchoate phase and correct these wrong place to spend are compared,The 50 - 200 that former likelihood is latter times.

The project that     perfects plans to contain what content?Can contain a lot of content,But the basiccest is to should include a target to state with a series of user plan.Still have a lot of otherer useful data,Include process of plan of standard of demand documentation, encode, pay, test to wait.To the solution of simple give typical examples that we should build,The applied process statement with will main simple introduction and plan of a few users.Still will solve a few other problems at the same time.

    uses program statement

The project that article of     this series should build (call DotNetKB) it is a site of simple knowledge base Web,In this site,The user can raise all sorts of questions,Can receive authorization " expert " answer.Such,When the person that visit later is searching the solution of problem of common ASP.NET,Can undertake search and filtering to gotten result data.

    a this is the DotNetKB project to us main goal states.DotNetKB is an applied process that is based on Web,A series of problems that it can list the person that visit puts forward,The return that shows accredit expert is made to these problems.The person that visit can add new issue to the system,Can mix according to the theme of the problem, problem / or the key word in the answer will search and filter these problems.The person that visit still can press a theme or have sort to problem list by the date that is added in the system.

The part that expert of     accredit can log onto to already set safe mechanism in using a program,Problem of check and approve,Add, edit and delete the one or more answer to a problem.Applied program manager still can build an expert to log onto attributive and entry configuration file,And add, edit and delete problem theme.

    in addition,Still provided information of a few basic statistic,The amount of the problem in including a system and answer,And the return measure of every expert and the page amount that already were visited up to now.

    no less than you see from inside the statement above in that way,This solution is very simple.When reading a target to state,A lot of other functions that you may begin to consider to be able to be added to this to use a program,In order to make applied process more powerful.A when this explained project goal states main basis,Avoid namely " the function spreads " .We are clear,If change the concept that is based on finally originally as a result,Simple think of a way will be brought about very giant and ill-natured result.Have an old maxim:" if do not know to want to go to why square,You may stop in a certain place " ,What it announces originally is summertime road trip,Its truth can be used at software project likewise.

The target of a few projects of     may need to contain more information in statement.And to our use,The target statement above accords with a requirement.The knowledge that we had a clarity to wanting finished applied program now,Need a few detailed information to describe an user next how as alternant as the system and the user needs to carry out what task to achieve a goal.We need a series of user program.

...

ASP.NET uses Webclient to get the means of settlement of page source code




When DataGrid including in     page,The settlement that uses Webclient to get page source code square

Main problem,When using Webclent to get page source code,Datagrid should be contained in the page,And should accuse when using the function distributing a page that takes oneself,The data that regular method can get the first page only,The data of other page is not taken,It is a means of settlement below.

...

A kind " you have no right to examine this webpage " reason and means of settlement



1, phenomenonA. With Localhost visit,NormalB. With IP address visit,Appear 403 mistakes

2, analysisA. Suspicion is ACL problem,Setting Everyone is controlled completely to be over,Problem still inextricabilityB. Visited "WebForm1.aspx" inadvertently,Revisit this homepage,OK and normal visitC. The Aspx that cannot visit so comes over from Asp changeover

3, conclusionA. Visit either comes over from Asp changeover,Turn into the webpage of Aspx,Did not include in the webpage that is like new Aspx " Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="IQTest.WebForm1" " part,Can appear 403 mistakesB. Means of settlement:Before the webpage that must assure to visit all Aspx that come over from Asp changeover,Visit either is included " Codebehind " page;Essential cause is Asp.net application process fails to start,The rejection that causes IIS is visited

With manage,Be reclaimed when overtime of Asp.net application process it is thus clear that,The page that submits later also can appear this 403 mistakes!

Note:Do not include " the Aspx page of Codebehind="index.aspx.cs" AutoEventWireup="false" Inherits="IQTest.WebForm1" can be visited normally....

C# will appoint a webpage to add the method of the favorite



    wanted to realize a small function yesterday,In adding some webpage that browsing to the favorite namely.A method is called to be done with JAVASCRIPT directly in the page previously decided,I am to want to come true with WINFORM now,Myself searched to did not see relevant method (what search possibly is not careful) .Wanted to decide him implementation calculated then.

...

The method of multilingual interface implements in ASP.Net 2.0



1 . Do an interface as before,Just notice,Come to all characters that need to have multilingual interface do with Label

2 . After finishing,In the pitch on in Solution Explorer this file,Choose Tools-%26gt;Generate Local Resource

...

Write a database to operate kind



Author:Willmove
Homepage:Http://www.amuhouse.com
E-mail: Willmove@gmail.com
State:Department author starts work formerly,Reprint ask give chapter and verse for.

It is to use SQL Server to regard tiring-room as the database commonly in ASP.NET.Order of average give typical examples of ASP.NET database operation is to use separate data to visit,Every page writes that is to say to receive a database repeatedly,Access data,The code that shuts a database.This kind of means brought a few corrupt practice,If your database was changed,one is,You must a page of a page go changing database join code.
The second malpractice is code redundant,A lot of code are reduplicative,Needless.
Because of this,The database that I try to agree through a kind operates kind of data that will realize ASP.NET to plant to visit.

...

This week that in remembering memory course, often uses,This month,Function of the current year



1Dateadd(wk, datediff(wk, 0, getdate()) , - 1)
2Dateadd(wk, datediff(wk, 0, getdate()) , 6)
3
4Dateadd(mm, datediff(mm, 0, getdate()) , 0)
5Dateadd(ms, - 3, dateadd(mm, datediff(m, 0, getdate())+1, 0) )
6
7Dateadd(yy, datediff(yy, 0, getdate()) , 0)
8Dateadd(ms, - 3, DATEADD(yy, DATEDIFF(yy, 0, getdate())+1, 0) )...

What realize a file with ASP.Net is online compress reconcile compress



The problem that regular meeting of   our classics encounters batch to upload,Also can encounter the problem that uploads all files below a certain catalog the server to go up.So,How to solve this kind of problem?The technology previously uses the means such as ActiveX commonly,Here author uses SharpZlib to come true,Hear VS2005 already had compress reconcile compression solution,The author still uses VS2005 without time,Be forced to used VS2003 + SharpZlib to solve a problem so.

...

.Net middling sees problem and classify of means of settlement




VS2002 to VS2003,To today's VS2005,To us personnel of extensive research and development offerred huge to go to the lavatory,But inside also put in a lot of unusual mistakes,Now and then we can be its place faze,Also admit even Microsoft interior personage,Some unusual mistakes up to now have not repair,A few common VS unusual errors and means of settlement are below,These are me once had encountered,Arrange now at falling,I believe everybody is affirmative more or less also had encountered similar problem,Greeting everybody is participated in discuss.

...

The IP that.net does visits limitation



Do occasionally leave a message this when remember do so, specific train of thought is bad perhaps, be being done is cast a brick to attract jade-offer a few commonplace remarks by way of introduction so that others may come up with valuable opinions only, the hope has better method!

IP adds a page was to use a ListBox, textBox, two Button

And use the IP in current IP comparative database directly on other pages, code is as follows!

Limitative IP adds page HTML code
%26lt;%@ Page Language=%26quot;C#%26quot; AutoEventWireup=%26quot;true%26quot; CodeFile=%26quot;ip.aspx.cs%26quot; Inherits=%26quot;admin_ip%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; does not have frontispiece %26lt;/title%26gt;
%26lt;link Href=%26quot; . . / Images/news.css" Rel="stylesheet" Type="text/css" /%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;form Id=%26quot;form1%26quot; Runat=%26quot;server %26quot;%26gt;
%26lt;div%26gt;
%26lt;asp:SQlDataSource ID=%26quot;SqlDataSource1%26quot; Runat=%26quot;server%26quot; ConnectionString=%26quot;%26lt;%$ ConnectionStrings:bOok %%26gt; %26quot;
ProviderName=%26quot;%26lt;%$ ConnectionStrings:bOok.ProviderName %%26gt;%26quot; SelectCommand=%26quot;SELECT [ip] FROM [ip] %26quot;%26gt;
%26lt;/asp:SQlDataSource%26gt;
%26lt;table Align=%26quot;center%26quot; Style=%26quot;border-right: #0066cc 1px Dotted; Border-top: #0066cc 1px Dotted; Border-left: #0066cc 1px Dotted; Border-bottom: #0066cc 1px Dotted "%26gt;
%26lt;tr%26gt;
%26lt;td Rowspan=%26quot;2%26quot; Style=%26quot;width: 100px; Border-right: #33ccff 1px Groove; Border-top: #33ccff 1px Groove; Border-left: #33ccff 1px Groove; Border-bottom: #33ccff 1px Groove; "%26gt;
%26lt;asp:LIstBox ID="iplxb" Runat="server" DataSourceID="SqlDataSource1" DataTextField="ip "
DataValueField=%26quot;ip%26quot; Height=%26quot;194px%26quot; Width=%26quot;153px%26quot;%26gt;%26lt;/asp:LIstBox%26gt;%26lt;/td%26gt;
%26lt;td Style=%26quot;width: 100px; Border-right: #33ccff 1px Groove; Border-top: #33ccff 1px Groove; Border-left: #33ccff 1px Groove; Border-bottom: #33ccff 1px Groove; "%26gt;
Fill in IP address of the standard arrives different outcome inside this casing,Click next add by button!%26lt;br /%26gt;
%26lt;asp:REgularExpressionValidator ID="RegularExpressionValidator1" Runat="server" ControlToValidate="iptb "
Format of address of Display="Dynamic" ErrorMessage=" IP is incorrect " ValidationExpression="([0-9]{2, 3})([. ] ) ([0-9]{1, 3})([. ] ) ([0-9]{1, 3})([. ] ) ([0-9]{1, 3})%26quot;%26gt;%26lt;/asp:REgularExpressionValidator%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td Style=%26quot;width: 100px; Border-right: #33ccff 1px Groove; Border-top: #33ccff 1px Groove; Border-left: #33ccff 1px Groove; Border-bottom: #33ccff 1px Groove; "%26gt;
%26lt;asp:LInkButton ID=%26quot;LinkButton1%26quot; Runat=%26quot;server%26quot; OnClick=%26quot;LinkButton1_Click%26quot;%26gt; deletes the travel %26lt;/asp:L of pitch onInkButton%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;tr%26gt;
%26lt;td Style=%26quot;width: 100px; Border-right: #33ccff 1px Groove; Border-top: #33ccff 1px Groove; Border-left: #33ccff 1px Groove; Border-bottom: #33ccff 1px Groove; "%26gt;
%26lt;asp:TExtBox ID=%26quot;iptb%26quot; Runat=%26quot;server%26quot; Width=%26quot;150px%26quot;%26gt;61.139.33.22%26lt;/asp:TExtBox%26gt;%26lt;/td%26gt;
%26lt;td Style=%26quot;width: 100px; Border-right: #33ccff 1px Groove; Border-top: #33ccff 1px Groove; Border-left: #33ccff 1px Groove; Border-bottom: #33ccff 1px Groove; "%26gt;
%26lt;asp:BUtton ID=%26quot;Button1%26quot; Runat=%26quot;server%26quot; OnClick=%26quot;Button1_Click%26quot; Text=%26quot; increases %26quot; Width=%26quot;80px%26quot; /%26gt;%26lt;/td%26gt;
%26lt;/tr%26gt;
%26lt;/table%26gt;

%26lt;/div%26gt;
%26lt;/form%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
Limitative IP adds page CS codeUsing System;Using System.Data;Using System.Configuration;Using System.Collections;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;
Public Partial Class Admin_ip: System.Web.UI.Page
{Protected Void Page_Load(object Sender, eventArgs E)
{
Server.Execute("chklog.aspx");
}Protected Void Button1_Click(object Sender, eventArgs E)
{
Iplxb.Items.Add(iptb.Text);Odb.insert("insert Into Ip (ip) Values ('" + Iptb.Text + "')");
}Protected Void LinkButton1_Click(object Sender, eventArgs E)
{For (int I = 0; I%26lt;Iplxb.Items.Count; I++ )
{If (iplxb.Items[i].Selected)
{Odb.insert("delete From Ip Where Ip='"+iplxb.SelectedItem.Text+"'");Iplxb.Items.Remove(iplxb.SelectedItem.Text);
}
}
}
}
The page that is needed to restrict IP calls the code of the pageProtected Void Page_Load(object Sender, eventArgs E)
{String Ip = Request.UserHostAddress.ToString();
If (Convert.ToInt32(odb.scr("select Count(*) From [ip] Where Ip='" + Ip + "'") )%26gt;0)
Response.Write(" Is am sorry,Your IP is visited by limitation,Seek advice from administrator "); please
}
}...
« 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 »