asp.net 4.0

How to use XML attributes

If you know basic principles from the article How to create a XML document, you can use attributes to add extra information to an element. Instead of putting information into a sub-element, you can use an attribute. In the XML community, deciding whether to use sub-elements or attributes—and what information should go into an attribute—is a …

Learn more

How to create a XML document

When you are planning to create your own XML document, you need to remember and follow some rules:

– XML documents must start with an XML declaration like <?xml version=”1.0″?>. This signals that the document contains XML and indicates any special text encoding. However, many XML parsers work fine even if this detail …

Learn more

How to set the maximum size of a file upload in ASP.NET

By default, ASP.NET will reject a request that’s larger than 4MB, but you can change this maximum by modifying the maxRequestLength setting in the web.config file. This sets the largest allowed file in kilobytes. The web server will refuse to process larger requests.

The following sample setting configures the server to accept files up to 10MB:

 

<?xml …

Learn more

How to upload files to the Web server with FileUpload control in VB

ASP.NET includes a control named FileUpload that allows website users to upload files to the web server. The FileUpload control manages the posted file data, by examining it, disregarding it, or saving it to a back-end database or a file on the web server.   The FileUpload control represents the <input  type = “file”> HTML tag and …

Learn more

How to upload files to the Web server with FileUpload control in C#

ASP.NET includes a control named FileUpload that allows website users to upload files to the web server. The FileUpload control manages the posted file data, by examining it, disregarding it, or saving it to a back-end database or a file on the web server.   The FileUpload control represents the <input  type = “file”> HTML tag and …

Learn more

MVC 3 application structure in Visual Studio 2010

When you create a new ASP.NET MVC 3 application with Visual Studio 2010, it automatically adds several files and directories to the project, as shown in the next picture.

Visual Studio 2010 basic MVC3 application

ASP.NET MVC 3 projects by default have six top-level directories and two files, shown in the next table:

Items
Description

App_Data directory
This directory is used to …

Learn more

How to use LINQ Skip While clause in VB.NET

Web developers use optional LINQ Skip While clause to bypass elements from the beginning of a query result until the supplied expression returns false. After expression returns false, the query returns all the remaining elements and the expression is ignored for the remaining result.

The Skip While clause can be used to exclude elements from …

Learn more

How to use LINQ Skip clause in VB.NET

Web developers use optional LINQ Skip clause when they want to bypass, specified by the count parameter, elements at the beginning of a results list and return the remaining elements. Web developers can combine the Skip clause with the Take clause to return a range of data from any segment of a query, by passing the …

Learn more

How to use MVC 3 dialog options with Visual Studio 2010

After creating a new MVC 3 application (described in the article How to create a basic MVC 3 application with Visual Studio 2010), you’ll be presented with an intermediate dialog with some MVC-specific options for how the project should be created, as shown in the next picture. The options you select from this dialog can set …

Learn more