ASP.NET basic knowledge (2)
The RadioButton control will be rendered as on the client side. Like the server-side control, it can also be grouped through the GroupName attribute.
Button control will be rendered on the client side as
LinkButton control will be rendered on the client side as
ImageButton control is a You can set the ImageUrl Button, which will be rendered on the client as
The same point: you can set the OnClientClick property to "return confirm('Are you sure you want to delete?')";
You can set the attributes NavigateUrl="" and Target="". If you set the ImageUrl attribute, it will be rendered into
Generally, the code for uploading files is written like this
if(FileUpload1.hasFile())
{
string uploadPath = Server.MapPath("~/upload/");
FileUpload1.SaveAs(uploadPath + FileUpload1.FileName);
}
1) HTML control
2) ASP.NET server control
3) with runat="server "HTML control
1) RequireFieldValidator: a required field, which can be used for non-empty verification on the server side. Commonly used properties are: ErrorMessage, ControlToValidate, InitialValue. When verifying on the server side, you can write if(this.IsValide) like this {…}
2) RangeValidator: Determine whether the value is between the given maximum value (MaximumValue) and minimum value (MinimumValue). Comparable data types include string, int, currency.
3) CompareValidator: Used to compare two Whether the relationship between the values meets the requirements or the specified type of data. Comparison operators include: <,>,=,!=. Common properties: ValueToCompare: which value to compare with, ControlToCompare: which control to compare with.
4) RegularExpressionValidator: Regular expression used to verify that data satisfies. Common properties: ValidationExpression: Define regular expressions.
5) CustomValidator: Custom validation for special situations.
6) Note: (1) Almost all validation controls must be verified on the client and server.
(2) Group the validation controls: ValidationGroup
(3) Whether to trigger the verification event: CauseValidation: false, which means the verification event is not triggered
(4) Modify whether the verification control takes place: Display is set to Dynamic or Static.
1) For example:
2) Repeater data control is used to bind the traversal display of data. Of course, we also It can be written by hand using foreach statement.
3) Other templates of the Repeater control
(1)
(2) or
wait.
(3)
(1) The automatically generated style should be extracted into the css style and not made inline;
(2) It is generally not necessary to use
(3) There must be a server-side control with the ID itemPlaceHolder in
(1) Determine the type of data row e.Item.ItemType == ListViewItemType.DataRow
(2) Get the corresponding RowView ListViewDataItem lvDataItem = (ListViewDataItem)e.Item; DataRowView rowView = ( DataRowView)lvDataItem.DataItem;
(3) When using FindControl, you should pay attention to the AlternatingItemTemplate issue.
The difference between ListView and GridView
(1) GridView can only be rendered into Table
(2) ListView can be rendered into both Table and
-
DropDownList control binds the SelectedValue property, such as: SelectedValue="<%#Eval('txtName')%>"
If there is a pure display page that does not involve interactive information such as adding, deleting, modifying, etc. on the front end of the page, you can disable ViewState. There are two methods:
(1) Page Disable ViewState as a whole: Add EnabelViewState="false" in the toptag
(2) Disable ViewState for the specified control: Add EnabelViewState="false" on the properties of the controlWebsite performance tuning
(1) Cache is the first means of website performance tuning;
(2) Index is the first means of database performance tuning;How to set page cache: Set< in the page header area
;%@ OutputCache Duration="20" VaryByParam="none" (This is variable and can be set as parameters: id;num;age, etc.)%> Data cache setting method, set properties for ObjectDataSource,
(1) EnableCaching="True"
(2) CacheDuration="20"Written at the back: Mr. Lu Xun has a saying, "Where is the genius? I spend all the time other people drink coffee on working and studying. ! "I strongly agree, it is a good lesson to be diligent in making up for your shortcomings. Well, that’s it for today!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











C#.NET is still important because it provides powerful tools and libraries that support multiple application development. 1) C# combines .NET framework to make development efficient and convenient. 2) C#'s type safety and garbage collection mechanism enhance its advantages. 3) .NET provides a cross-platform running environment and rich APIs, improving development flexibility.

C#.NETisversatileforbothwebanddesktopdevelopment.1)Forweb,useASP.NETfordynamicapplications.2)Fordesktop,employWindowsFormsorWPFforrichinterfaces.3)UseXamarinforcross-platformdevelopment,enablingcodesharingacrossWindows,macOS,Linux,andmobiledevices.

C# is widely used in enterprise-level applications, game development, mobile applications and web development. 1) In enterprise-level applications, C# is often used for ASP.NETCore to develop WebAPI. 2) In game development, C# is combined with the Unity engine to realize role control and other functions. 3) C# supports polymorphism and asynchronous programming to improve code flexibility and application performance.

C#.NETissuitableforenterprise-levelapplicationswithintheMicrosoftecosystemduetoitsstrongtyping,richlibraries,androbustperformance.However,itmaynotbeidealforcross-platformdevelopmentorwhenrawspeediscritical,wherelanguageslikeRustorGomightbepreferable.

C# and .NET adapt to the needs of emerging technologies through continuous updates and optimizations. 1) C# 9.0 and .NET5 introduce record type and performance optimization. 2) .NETCore enhances cloud native and containerized support. 3) ASP.NETCore integrates with modern web technologies. 4) ML.NET supports machine learning and artificial intelligence. 5) Asynchronous programming and best practices improve performance.

The programming process of C# in .NET includes the following steps: 1) writing C# code, 2) compiling into an intermediate language (IL), and 3) executing by the .NET runtime (CLR). The advantages of C# in .NET are its modern syntax, powerful type system and tight integration with the .NET framework, suitable for various development scenarios from desktop applications to web services.

How to deploy a C# .NET app to Azure or AWS? The answer is to use AzureAppService and AWSElasticBeanstalk. 1. On Azure, automate deployment using AzureAppService and AzurePipelines. 2. On AWS, use Amazon ElasticBeanstalk and AWSLambda to implement deployment and serverless compute.

C# and .NET runtime work closely together to empower developers to efficient, powerful and cross-platform development capabilities. 1) C# is a type-safe and object-oriented programming language designed to integrate seamlessly with the .NET framework. 2) The .NET runtime manages the execution of C# code, provides garbage collection, type safety and other services, and ensures efficient and cross-platform operation.
