C # one of the classic learning notes for getting started with Web Applications

Recently I read Beginning C # Web Applications Wtith Visual Studio. Net. I feel that this book is well written in some details. I take notes to provide some useful things for future users. I will write some information today, which is completed

Get current url

For example: http: // localhost/newurl/WebForm1.aspx1. Method document. URL (case sensitive)The result is: http: // localhost/newurl/WebForm1.aspx.2. HttpContext. Current. Request. Url. ToString (),Result: http: // localhost/newurl/WebForm1.aspx3.

Asp.net to determine whether a session is valid

Copy codeThe Code is as follows:If (Session ["UserID"] = "" | Session ["UserID"] = null){Response. Redirect (".../Login. aspx? M = login has timed out. Please log in again! ");}I have always thought that this method is very bad and very bad, but I

Three methods for connecting. net to oracle

Method 1: connect directly using the. NET oracle driverInstall the Oracle client driver packageFind the Server installation path: E: \ oracle \ product \ 10.2.0 \ db_1 \ NETWORK \ ADMIN tnsnames. ora, and overwrite the file under the client

Differences between DBNull. Value, null, String. Empty in asp.net

First, "null" is in C # (VB. NET is Nothing), indicating the status of a referenced object variable "not referenced" Any entity (typical symptom is that if a method of this variable is called, an NullException exception will be thrown ). String.

Use and example of ASP. NET AdRotator

AdRotator. aspx: Create an AdRotator Server Control on the ASP. NET page and connect the ad XML file to the control. Use the following Server Control flag to completeCopy codeThe Code is as follows:Code for generating an advertisementCopy codeThe

The Asp.net GridView control enables you to edit cells for ease of use.

Recently, we made a function to reduce the number of pop-up pages for the convenience of users. You can click the "edit" button to edit the cell content of the current row without the pop-up page. The page is displayed as follows: Click the "edit"

Asp.net Gridview paging save Option

Copy codeThe Code is as follows:# Region // 'revision: 1.00 Created Date: 2013/08/02 Created ID: Una [#1300071] add multiple selection boxes/// /// Obtain the value of multiple selection boxes for Session failover/// Private void RememberOldValues ()

A small example of GridView control traversal in asp.net

Copy codeThe Code is as follows:Int intCount = this. GridView1.Rows. Count; // The total number of rows.For (int I = 0; I {Label1.Text = (HyperLink) GridView1.Rows [I]. Cells [0]. Controls [0]). Text. ToString (). Trim ();} For (I = 0; I {CheckBox

How to Use the Microsoft ajax Library (ajax. ajaxMethod)

Four things need to be done with ajax. ajaxMethod 1: add contacts in webCofig 2: add Copy codeThe Code is as follows:Protected void Page_Load (object sender, EventArgs e){Ajax. Utility. RegisterTypeForAjax (typeof (NewsDrop); // NewsDrop is the

Differences between HTML server controls and WEB server controls

When learning asp.net, there are always examples in the video. This is of course a good thing, but I will use Html server controls and Web server controls for a while. At first, the examples are quite confusing, I don't know how to choose this

Introduction to asp.net EXECUTENONQUERY () return values

The ExecuteNonQuery () method is used to Update data. Generally, it uses the Update, Insert, and Delete statements to operate on the database. The returned values of the methods mean: For Update, Insert, if the Delete statement is successfully

Hide the div sample code on the template page in the subpage

The requirements are as follows: 1. the right side of the template page contains a login div, which is displayed when you do not log on. After login, this div is hidden.2. display a welcome div, mainly to hide it through javascriptNote: you cannot

Sample Code output by ASP. net mvc from IHttp to page

Copy codeThe Code is as follows:MVCHandler: IHttpHandlerVoid IHttpHandler. ProcessRequest (HttpContext httpContext){This. ProcessRequest (httpContext );} Protected virtual void ProcessRequest (HttpContext httpContext){HttpContextBase base2 = new

Asp.net Textbox Server Control

Copy codeThe Code is as follows:Name: Gender: male female Password: Mobile Phone: Ontextchanged = "TextBox3_TextChanged"> Introduction: ImageUrl = "~ /Img/QQ20130909140346.png "Width =" 72px "/> The textChange Event code is as follows: Copy

Asp.net exports the word and pdf instance code according to the specified Template

Copy codeThe Code is as follows:/// /// Export the word file/// /// template path /// export file name /// pdf file name /// set of bookmarks in the template /// invoice entry list Public static void GenerateWord (string templateFile, string

Introduction to several methods for asp.net gridview column width Fixation

1,In the edit column, you can directly set the column width! If you don't want the cell content to increase the size of the cell, add a style., which means that each column is fixed to the style originally set and does not change. The excess part is

Solution for setting 404 page return 302HTTP status code in ASP. NET

Configure the 404 page in the configuration file as follows: Copy codeThe Code is as follows: When accessing the website, the error page can be displayed normally, but the HTTP status code is 302, which is unfriendly to SEO. Modify the following

C # Call dynamic unlha32.dll to decompress the package file with the Lha suffix

Copy codeThe Code is as follows:Public class LhaUtity{/// Obtain the DLL version[DllImport ("unlha32")]Private static extern UInt16 UnlhaGetVersion (); /// /// 'Obtain the DLL execution status/// /// Successful [DllImport ("unlha32")]Private static

Asp.net C # instance code for generating and parsing QR codes

The class library file is downloaded at the end of the file. [ThoughtWorks. QRCode. dll is the class library] You need to add:Copy codeThe Code is as follows:Using ThoughtWorks. QRCode. Codec; Using ThoughtWorks. QRCode. Codec. Data; Using

Total Pages: 1075 1 .... 525 526 527 528 529 .... 1075 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.