Aspnet

Your visual blueprint for creating Web applications on the .NETframework At maranGraphics, we believe in producing great computer books one book at a time. maranGraphics has been producing high-technology products for over 25 years, which enables us to offer the computer book community a unique communication process. Our computer books use an integrated communication process, which is very different from the approach used in other computer books. Each spread is, in essence, a flow chart the...

Migrate Jscript To Jscriptnet Syntax

JScript.NET code implementation is much closer to the JScript implementation than VB.NET is to VBScript. Because JScript was more of an Object-Oriented language than VBScript. Jscript will resemble to the C syntax that is used in this book than the VB syntax. The big difference that you will notice is in the variable declaration. When converting an ASP page (*.asp) to an ASP.NET page (*.aspx) that has JScript in the server-side code, the first thing you will do is change the file extension to...

Return Sql Data From A Web Service

Having the ability to access databases from a Web Service enables you to build applications that require data from various sources. Originating data from a SQL data store is one way to provide interoperability between applications. The SQL data can be central data storage for any application that can connect and issue commands against the SQL data store. This shared data is one way to enable applications to interact with each other. There are a number of steps that you have to take to provide...

Web Development Basics

Browse Your Default Web Site Explore a Web Site Open a Template File Save a File to the Default Web Site Create an HTML Create an ASP Page Create an ASP.NET Web Page Add an Event Handler to an ASP.NET Page Write Your First C Application Compile a C Application Format Your Code Declare a Variable Initialize a Variable Access Properties Make Decisions Using Conditional Work with Arrays Control Logic Using Iterative Concatenate a String Convert a Variable Enumerate a Collection Declare and Use...

Basics

The following example represents a class definition that does several different types of conversions. The first conversion changes the data type from a number to a string. The second conversion demonstrates a conversion from a string to a number. Finally, the dates are converted into different formats. string strExample 1.2 string strDate This is how to convert a string to number double dblValue Double.Parse(strExample) This is how numerics are converted to strings string strDoubleValue...

Create An Html 40 Button

F you are working with a user that has a Web browser that supports the HTML 4.0 < button> element, you can use the HTMLButton control to create a button with some nice features. Note that the < button> element is defined in the HTML 4.0 specification therefore, it is supported only in Microsoft Internet Explorer version 4.0 and above (Other popular browsers like Navigator and Opera, currently do not support the < button> element). With HTML 4.0, you can use some client-side events...

Using Aspnet Components

If you want to cache the page per user session, you can cache based on the users cookie. Authentication cookies are used to map a user to a session. Open two instances of Internet Explorer and note the generated times for each instance and note they are not sharing the same cached page. See ASPPageCache_ex1.aspx on the CD for a page that demonstrates this directive. < OutputCache Duration 60 VaryByHeader Cookie > You can bypass a cached page each time the user submits different Form or...

Change The Home Directory In

The location where the files for your Web site are stored is called the home, or root, directory. You can specify which directory on your Web server is the home directory. Any files that are in any of the subdirectories of the home directory will be available as well. Make sure that this home directory, along with any of its subdirectories, has proper file system security applied. If someone bypasses the security of IIS, you must make sure that they only have read access permissions to the...

D A Placeholder For Controls

You can use the Placeholder Web server control to hold other controls on your ASP.NET Web pages. This is a convenient way to specify where on your page you want to put controls. It is especially useful if you want to create all of your form controls programmatically. You can use the Placeholder Web server control almost anywhere on your ASP.NET Web page. It does not have to be on a server form, but if you are adding controls for a form, you should make sure that it is between the < form>...

Debug Your Aspnet Applications

Enable Page-Level Debugging Enable Custom Error Handling Handle Errors Programmatically Use a Page-Level Trace Use an Application-Level Trace Using Windows Authentication Using Forms Authentication Authorize Users Set Up Encoding Using CultureInfo Using Localize with the Page Control Create and Use Resources Use Resource Manager Information Work with Multiple Server-Side Work with Script Using Render Functions Using Page Directives Migrate VBScript to VB.NET Syntax Migrate JScript to...

Create A Threetier Web Form

A business tier enables you to encapsulate business rules or logic into components. These business tier components enable you to automate business processes that your company uses. With Web applications, you can break your code out into three tiers Data, Business, and Presentation. This allows you to consolidate all data access code into one component, all of the code related to business logic into another component, and all of the code for the user interface in the Web page. Like the Data...

Send An Email Using Aspnet

You can send e-mail from your ASP.NET Web pages with the System.Web.Mail namespace to respond to a request that a user makes on your site. E-mail gives you a convenient means to send users feedback, such as receipts, confirmation notes, and other information that a user likes to have for future reference. You can also use e-mail to work with other systems for example, an encrypted e-mail containing order information can be sent from your Web site to another system for processing. To send e-mail...

Set Up Encoding

You can use encoding to create a site that supports multiple languages. Encoding refers to the way that the data within your file is stored. Certain languages, such as Japanese, have large character sets and therefore require an encoding type that would support all of the characters in the language. Encoding is important because it determines how the data from your Web server is sent to and from the Web browser, along with how the files are stored on your Web server. Response encoding refers to...

Declare And Use Methods

Methods are members of an object or class that implement a computation or action. You can use methods to hold a section of code that may be used more than one time. Methods are built into classes using method declarations. Many objects in the .NET Framework classes contain useful methods. For example, the .NET Framework DateTime class has several methods that can be used, such as the ToLongDateString method, which converts a Date or DateTime to a long version of a Date (for example Thursday,...