Using System;
Using System. collections. generic; using System. componentModel; using System. data; using System. drawing; using System. text; using System. windows. forms; namespace ClientControl {// 1. define the delegate public delegate void
1. Use CustomSource as the prompt setAdd the following code to the window loading function. Assume that unitNameList is the obtained string list to be added to the drop-down list.
AutoCompleteStringCollection collection = new
Public string GetPYString (string str){String tempStr = "";Foreach (char c in str){If (int) c >=33 & (int) c {// Reserved letters and symbolsTempStr + = c. ToString ();}Else{// Accumulate the pinyin initialsTempStr + = GetPYChar (c. ToString
1. controls that do not participate in the POSTBACK mechanism, do not use server controls, try to use static HTML tags2. Use RELEASE configuration during compilation3. Remember to set DEBUG to FALSE when the application is officially put into use.4.
When it comes to ASP. NET caching, that is: cache as early as possible; cache should be implemented at every layer of the application. Add cache support to the data layer, business logic layer, UI, or output layer. Memory is currently very
SqlConnection conn = new SqlConnection ("DataSource = LocalHost; Initial Catalog = DataBaseName; UserId = UserName; PassWard = 123456 ");Conn. Open ();Conn. Close ();Conn. Dispose ();Difference between Close and Dispose:Close only closes the
I wrote an article titled ASP. net mvc verification, the only regret is that when using the Data Annotation Validators Method for verification, if the database is an automatically generated file such as Entityframework, there is no way to use the
Here we create a simple ASP. net mvc practice application to CRUD the News table of the News Database.I. preparations:Create a News Database News table in SQLServer, add the NewsData. dbml file to the Models folder, and drag the News table to the
In ASP. net mvc, we can use the HandleErrorAttribute feature to specify how to handle the exception thrown by the Action. if HandleErrorAttribute is set for an Action, MVC displays the Error view when an exception is thrown ~ /Views/Shared directory.
In general, Response. the Redirect method is switched on the server side, so unless Response. write (" ") the specified URL address cannot be opened in a new window. However, if you carefully analyze it and set the target attribute of the form
Anti-SQL injection is a system project. in project development, the system should consider the problem of SQL injection. Generally, the following four points can better control SQL injection:
Strictly verify all user input, including URL parameters.
When a browser that does not disable cookies requests a web site, the current page uses the Session status. A cookie with a unique identifier will be returned to the browser as the page returns, the Session status can be used to continue tracking
The general scheme for uploading large Web files is to process them at the HttpModule level. There are a lot of technical documents online, so it is not cumbersome.
To use this solution, you must set some configuration items in Web. config and run
AjaxPro has never been used before. Try it today!Download AjaxPro.2.dllHttp://www.codeplex.com/AjaxPro1. In our web site, add reference and AjaxPro.2.dll2. Configure web. configAdd the following nodes under the system. web node:View plaincopy to
During web development, some systems require the same user to log on only once at the same time, that is, if a user has logged on, if you log on again before exiting, you must report an error.
A common solution is to determine whether the user
ASP. net mvc transmits the environment parameters required for the execution process by encapsulating context objects.
Public class ControllerContext
{
Public virtual ControllerBase Controller {get; set ;}
Public virtual HttpContextBase HttpContext
Controller. View () is used to "display" a specific "template result page", which is also the execution result of most actions.Public abstract class Controller: ControllerBase,IActionFilter, IAuthorizationFilter, IDisposable, IExceptionFilter,
Controller. TempData is the temporary data storage point during Redirect operations.
Reference content is as follows:Public class TestController: Controller{Public ActionResult Index (){TempData ["a"] = "abcd ";Return RedirectToAction
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service