asp.net 2.0

How to use XMLTextWriter to create an XML document in C#

You can create a XML document, by using the basic XmlTextWriter class. This class works like StreamWriter relative, except that it writes XML document instead of ordinary text file. You can follow the next process:

1. Create or open the file

2. Write to file, moving …

Learn more

How to use comments in XML document

You can also add comments to an XML document. Comments go just about anywhere and are ignored  for data processing purposes. Comments are bracketed by the <!– and –> character sequences. The following listing includes three valid comments:

 

<?xml version=”1.0″?>

<BooksList>

<!– This is an example . –>

<Book ISBN-13=” 978-0545139700” Title = Title>Harry Potter and …

Learn more

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 use Validation groups in ASP.NET 4.0

In more complex pages, you may want to perform validation separately, by using several distinct groups of controls, possibly in separate panels. ASP.NET 4.0 enables this scenario with a feature called validation groups. To create a validation group, you need to put the input controls and the CausesValidation button controls into the same logical group. You can do …

Learn more

How to use CustomValidator control in ASP.NET 4.0

You can use the CustomValidator control to execute your custom client-side and server-side validation routines. You can associate them with the control so that validation is performed automatically. If the validation fails, the Page.IsValid property is set to false, as occurs with any other validation control.

 

The client-side and server-side validation routines for the CustomValidator are declared similarly. They …

Learn more

How to use RegularExpressionValidator control in ASP.NET 4.0

The RegularExpressionValidator is one of ASP.NET’s most powerful validation controls. It validates text by determining whether it matches a specific pattern. All regular expressions consist of two kinds of characters:

– Literals – represent a specific defined character

– Metacharacters –  characters for special use.

When you are going to use RegularExpressionValidator you should develop regular expression …

Learn more

How to create a manual validation in ASP.NET 4.0

You can create a manual validation in one of the three ways:

– Use your own code to verify values. In this case, you will not use any of the ASP.NET validation controls.

– Disable the EnableClientScript property for each validation control. This allows an invalid page to be submitted, after which you can decide what …

Learn more