Archive for November, 2008

Visual Web Developer Enhancements

Tuesday, November 18th, 2008

New Design View and CSS Design Tools

The Web page designer now lets you work in Design view, Source view, or Split view, which displays Design view and Source view at the same time.

Visual Studio now provides tools that make it easy to work with cascading style sheets (CSS). You can design the layout and style content in Design view by using new UI tools such as the CSS Properties window. You can also change positioning, padding, and margins directly in Design view by using WYSIWYG visual-layout tools.

For more information, see the following topics:

* Working with CSS Overview

* Walkthrough: Creating and Modifying a CSS File

IntelliSense for JScript and ASP.NET AJAX

Visual Studio 2008 and Visual Web Developer Express Edition now offer significantly improved IntelliSense for coding in ECMAScript (JScript or JavaScript), and for writing client script for AJAX-style Web applications that use the Microsoft AJAX Library. IntelliSense is available for client script in script elements and for referenced .js script files.

Additionally, IntelliSense displays XML code comments. XML code comments are used to describe the summary, parameter, and return details of your client script. ASP.NET AJAX also uses XML code comments to provide IntelliSense for ASP.NET AJAX types and members. IntelliSense is also supported for external script file references that use XML code comments.

For more information, see the following topics:

* JScript IntelliSense Overview

* Walkthrough: JScript IntelliSense

Web Application Projects

Web applications projects, released earlier as an add-on for Visual Studio 2005, are now integrated into Visual Studio and By using the Web application project model, you can compile a Web site into a single assembly in the Bin folder and explicitly define project resources.

The Web application project model uses the same project, build, and compilation semantics as Web projects in Visual Studio .NET 2003. This enables you to easily migrate Visual Studio .NET 2003 Web sites to the current version of Visual Studio or Visual Web Developer Express Edition.

Web application projects do not replace the Web site project type introduced in Visual Studio 2005. Instead, they provide another project model to provide more options for how you deploy and maintain Web applications.

For more information, see the following topics:

* Web Application Projects Overview

* How to: Create New Web Application Projects

Multi-targeting Web Applications

Visual Studio now enables you to target a Web application to a specific version of the .NET Framework. You can use one instance of the Visual Studio to develop Web applications for .NET Framework versions 2.0, 3.0 (Windows Vista), and 3.5. In Visual Web Developer Express Edition, you can only create applications that target the 3.5 version of the .NET Framework. However, you can later change the .NET Framework to target versions 2.0, 3.0, and 3.5 by changing the related project property.

For more information, see the following topics:

* .NET Framework Multi-Targeting Overview

* How to: Target a Specific .NET Framework

Designer and IntelliSense Support for LINQ

A new set of features in Visual Studio 2008 support Language-Integrated Query (LINQ) and extend the powerful query capabilities into the language syntax of C# and Visual Basic. LINQ introduces standard, easily-learned patterns for querying and transforming data, and can be extended to support any kind of data source. The designer provides a visual representation of data classes that enables you to quickly create and edit classes that map to objects in a database. IntelliSense support provides information for LINQ language syntax and for using the LinqDataSource control in Source view. For more information, see LinqDataSource Web Server Control Overview
Support for Creating and Consuming WCF Services in a Web Project

In Visual Studio, you can add ASP.NET Web services (.asmx files) and WCF Web services (.svc files) to a project. Client applications that are written in managed code typically access these Web services through a proxy class. For example, these applications use the proxy class that Visual Studio generates when you use the Add Web Reference dialog box. AJAX applications can access Web services from the browser by using proxy classes that are automatically generated in client script. For more information, see ASP.NET Application Services Overview.
Support for ASP.NET AJAX Extender Controls

AJAX extender controls enhance the client capabilities of standard Web server controls in ASP.NET Web applications. You can provide a richer Web-based user experience by binding one or more extenders to Web server controls such as TextBox controls, Button controls, and Panel controls.

Visual Studio supports all ASP.NET AJAX extender controls. This includes extender controls that you create and those that you add from sources such as the ASP.NET AJAX Control Toolkit, which is available on the ASP.NET Web site.

Posted by

What’s New in ASP.NET and Web Development

Tuesday, November 18th, 2008

The .NET Framework version 3.5 Service Pack 1 includes enhancements for ASP.NET in targeted areas. Visual Studio 2008 and Microsoft Visual Web Developer Express Edition also include enhancements and new features for improved Web development.

The most significant advances are improved support for developing AJAX-enabled Web sites and support for Language-Integrated Query (LINQ). The advances include new server controls and types, a new object-oriented client type library, and full IntelliSense support in Visual Studio 2008 and Microsoft Visual Web Developer Express Edition for working with ECMAScript (JavaScript or JScript).

The following sections of this topic describe the changes in ASP.NET and Visual Web Developer.

* ASP.NET Enhancements in SP1
* ASP.NET Enhancements in version 3.5
* Visual Web Developer Enhancements

ASP.NET Enhancements in SP1

The following sections provide information about enhancements and new features in Visual Studio 2008 and Visual Web Developer Express Edition.

Dynamic Data

ASP.NET Dynamic Data is a framework that lets you create data-driven ASP.NET Web applications easily. It does this by automatically discovering the data model at run time and determining UI behavior from it. A scaffolding framework instantly provides a functional Web site for viewing and editing data. This scaffolding can then be easily customized using metadata, templates, or by creating standard ASP.NET pages to override the default behavior. At the same time existing applications can easily integrate pieces of the scaffolding logic with their existing pages.
URL Routing

URL routing in ASP.NET enables you to use URLs that do not have to map to specific files in a Web site. Because the URL does not have to map to a file, you can use URLs in a Web application that are descriptive of the user’s action and therefore more easily understood by users. In URL routing, you define URL patterns that contain placeholders for values that are used when you handle URL requests. At run time, the pieces of the URL that follow the application name are parsed into discrete values, based on a URL pattern that you have defined.
EntityDataSource Control

The EntityDataSource control supports data binding scenarios based on the Entity Data Model (EDM). The EDM specification represents data as sets of entities and relationships. The EDM is used by the Entity Framework in object-relational mapping and in other scenarios such as ADO.NET Data Services. Users accustomed to the design-time model of ASP.NET data binding controls will find the programming surface of the EntityDataSource control similar to that of other data source controls.

The EntityDataSource control manages create, read, update, and delete operations with a data source on behalf of data-bound controls on the page. The EntityDataSource works with editable grids, forms with user-controlled sorting and filtering, dually bound drop-down list controls, and master-detail pages. The EntityDataSource control is able to obtain query parameter values from page controls, query parameters appended to the page URI, cookies, and other ASP.NET parameter objects.

New ASP.NET AJAX Extensions

The new extensions for ASP.NET AJAX in SP1 give you more control over browser history when you use the Back button. They also enable multiple client scripts to be automatically combined into one composite script. This speeds script load time by greatly reducing the required number of round trips to the server.

JScript Formatting

Code formatting capabilities has been extended to support JScript in Visual Studio and Visual Web Developer Express Edition. You can choose to format code manually for a document or selection, or to be automatically formatted as you type.
ASP.NET Enhancements in version 3.5

The .NET Framework version 3.5 includes enhancements for ASP.NET in the following areas:

* New server controls, types, and a client-script library that work together to enable you to develop AJAX-style Web applications.

* Extension of server-based forms authentication, roles management, and profile services as Web services that can be consumed by Web-based applications.

*A new EntityDataSource control that exposes the Entity Data Model through the ASP.NET data source control architecture.

*A new ListView data control that displays data and that provides a highly customizable UI.

* A new LinqDataSource control that exposes Language-Integrated Query (LINQ) through the ASP.NET data source control architecture.

*  A new merge tool (Aspnet_merge.exe) that merges precompiled assemblies to support flexible deployment and release management. This feature is not available in Visual Web Developer Express Edition.

The .NET Framework version 3.5 is also integrated with IIS 7.0. You can now use ASP.NET services such as forms authentication and caching for all content types, not just ASP.NET Web pages (.aspx files). This is because ASP.NET and IIS 7.0 use the same request pipeline. The unified request processing pipeline means that you can use managed code to develop HTTP pipeline modules that work with all requests in IIS. In addition, IIS and ASP.NET modules and handlers now support unified configuration. For more information, see ASP.NET Application Life Cycle Overview for IIS 7.0.
AJAX Development

The .NET Framework version 3.5 enables you to create Web applications that feature next-generation user interfaces with reusable client components. You can develop Web pages by using a server-based approach, a client-based approach, or a combination of both, according to your requirements. The AJAX server-based and client-based programming models feature the following:

* Server controls that support server-based AJAX development. This includes the ScriptManager, UpdatePanel, UpdateProgress, and Timer controls. These controls enable you to create rich client behavior with little or no client script, such as partial-page rendering and displaying update progress during asynchronous postbacks.

*The Microsoft AJAX Library, which supports client-based, object-oriented development that is browser independent. In addition to supporting the new AJAX-enabled server controls, the client library enables you to develop custom client components that extend DOM elements or that represent a DOM element.

* Server classes that enable you to develop server controls that map to custom client components whose events and properties are set declaratively. Server types that support this functionality include controls that derive from the ExtenderControl or ScriptControl base classes, or that implement the IExtenderControl or IScriptControl interfaces.
* Support for script globalization and localization by using client script. Globalization enables you to display dates and numbers based on a culture value (locale). Localization enables you to specify localized content (text, images, and so on) in client components for UI elements or exception messages.

* Access to Web services and to ASP.NET authentication, roles management, and profile application services.

The .NET Framework version 3.5 enables you to easily enable asynchronous partial-page updates in a page, which avoids the overhead of full-page postbacks. You can just put existing controls and markup inside UpdatePanel controls. Postbacks from inside an UpdatePanel control become asynchronous postbacks and refresh only the part of the page that is inside the panel, which creates a more fluid user experience. You can display the progress of the partial-page update by using UpdateProgress controls.
Learning About AJAX Development in ASP.NET

The documentation provides extensive information to help you learn how to develop AJAX-style Web applications in ASP.NET. To start, follow the sequence of topics described in Adding AJAX and Client Capabilities Roadmap.
Web Services and Application Services

The .NET Framework version 3.5 enables you to create both ASP.NET (.asmx) and WCF-based Web services that you can call from Web pages in client script by using the Microsoft AJAX Library. You can also call server-based application services that are exposed as Web services, which includes forms authentication, roles management, and profiles. These application services can be consumed in WCF-compatible applications, which includes AJAX-enabled Web pages and Window Forms clients. As a result, applications that are built with these ASP.NET or WCF technologies can share information that is made available by application services. For more information, see Web Services in ASP.NET AJAX and Using ASP.NET Web Services.
ListView Data Control

The ListView control combines many aspects of existing data controls. The ListView control is useful for displaying data in any repeating structure, similar to the DataList and Repeater controls. Unlike those controls, the ListView control supports edit, insert, and delete operations as well as sorting and paging. The paging functionality is provided for ListView by the new DataPager control.

The ListView control is a highly customizable control that enables you to use templates and styles to define the control’s UI. Like the Repeater, DataList, and FormView controls, templates in the ListView control are not predefined to render specific UI in the browser. For more information, see ListView Web Server Control Overview.
DataPager Control

The DataPager control is used to page through data that is displayed by a control that implements the IPageableItemContainer interface, such as the ListView control. The DataPager control supports built-in paging UI. You can specify the paging UI by using the NumericPagerField object, which lets users select a page by page number. You can also use the NextPreviousPagerField object, which lets users navigate through pages one page at a time, or to jump to the first or last page. Alternatively, you can create custom paging UI by using the TemplatePagerField object.
LinqDataSource Control

The LinqDataSource control exposes Language Integrated Query (LINQ) through the ASP.NET data source control architecture. You use the LinqDataSource control when you are creating a Web page that retrieves or modifies data and you want to use the programming model that is provided by LINQ. You can simplify the code in a Web page by enabling the LinqDataSource control to automatically create the commands for interacting with the data. By using the LinqDataSource control, you can reduce the amount of code that you must write to perform data operations when compared to performing the same operations in the SqlDataSource control or the ObjectDataSource control. When you use the LinqDataSource control, you also benefit by learning only one programming model to interact with different types of data sources.

You can use declarative markup to create a LinqDataSource control that connects to data from either a database or a data collection such as a collection. In the markup, you can specify the criteria for displaying, filtering, ordering, and grouping data. When the data source is an SQL database table, you can also configure a LinqDataSource control to update, insert, and delete data. You do not have to write the SQL commands to perform these tasks. The LinqDataSource class provides an event model that enables you to customize display and update behavior. For more information, see LinqDataSource Web Server Control Overview.

Posted by

Virus Detection and Prevention Tips

Saturday, November 15th, 2008

* Do not open any files attached to an email from an unknown, suspicious or untrustworthy source.

* Do not open any files attached to an email unless you know what it is, even if it appears to come from a dear friend or someone you know. Some viruses can replicate themselves and spread through email. Better be safe than sorry and confirm that they really sent it.

* Do not open any files attached to an email if the subject line is questionable or unexpected. If the need to do so is there always save the file to your hard drive before doing so.

* Delete chain emails and junk email. Do not forward or reply to any to them. These types of email are considered spam, which is unsolicited, intrusive mail that clogs up the network.

* Do not download any files from strangers.

* Exercise caution when downloading files from the Internet. Ensure that the source is a legitimate and reputable one. Verify that an anti-virus program checks the files on the download site. If you’re uncertain, don’t download the file at all or download the file to a floppy and test it with your own anti-virus software.

* Update your anti-virus software regularly. Over 500 viruses are discovered each month, so you’ll want to be protected. These updates should be at the least the products virus signature files. You may also need to update the product’s scanning engine as well.

* Back up your files on a regular basis. If a virus destroys your files, at least you can replace them with your back-up copy. You should store your backup copy in a separate location from your work files, one that is preferably not on your computer.

Posted by

What is antivirus software?

Saturday, November 15th, 2008

Antivirus software is a computer program that detects, prevents, and takes action to disarm or remove malicious software programs, such as viruses and worms. You can help protect your computer against viruses by using antivirus software.

Computer viruses are software programs that are deliberately designed to interfere with computer operation, record, corrupt, or delete data, or spread themselves to other computers and throughout the Internet.

To help prevent the most current viruses, you must update your antivirus software regularly. You can set up most types of antivirus software to update automatically.

Here are two types of antivirus protection from Microsoft:

For continuous protection, try Windows Live OneCare, which automatically scans your computer for viruses. You can use it free for 90 days.

For on-demand protection, Windows Live OneCare safety scanner allows you to visit a Web site and scan your computer for viruses and other malicious software for free using Windows Live OneCare safety scanner.

Posted by

php Syntax and data types

Saturday, November 15th, 2008

PHP only parses code within its delimiters. Anything outside its delimiters is sent directly to the output and is not parsed by PHP. The most common delimiters are <?php and ?>, which are open and close delimiters respectively. <script language=”php”> and </script> delimiters are also available. Short tags can be used to start PHP code, <? or <?= (which is used to echo back a string or variable) and the tag to end PHP code, ?>. These tags are commonly used, but like ASP-style tags (<% or <%= and %>), they are less portable as they can be disabled in the PHP configuration. For this reason, the use of short tags and ASP-style tags is discouraged.The purpose of these delimiters is to separate PHP code from non-PHP code, including HTML. Everything outside the delimiters is ignored by the parser and is passed through as output.

Variables are prefixed with a dollar symbol and a type does not need to be specified in advance. Unlike function and class names, variable names are case sensitive. Both double-quoted (”") and heredoc strings allow the ability to embed a variable’s value into the string.PHP treats newlines as whitespace in the manner of a free-form language (except when inside string quotes), and statements are terminated by a semicolon.PHP has three types of comment syntax: /* */ serves as block comments, and // as well as # are used for inline comments.The echo statement is one of several facilities PHP provides to output text (e.g. to a web browser).

In terms of keywords and language syntax, PHP is similar to most high level languages that follow the C style syntax. If conditions, for and while loops, and function returns are similar in syntax to languages such as C, C++, Java and Perl.

Data types

PHP stores whole numbers in a platform-dependent range. This range is typically that of 32-bit signed integers. Unsigned integers are converted to signed values in certain situations; this behavior is different from other programming languages. Integer variables can be assigned using decimal (positive and negative), octal, and hexadecimal notations. Real numbers are also stored in a platform-specific range. They can be specified using floating point notation, or two forms of scientific notation.PHP has a native Boolean type that is similar to the native Boolean types in Java and C++. Using the Boolean type conversion rules, non-zero values are interpreted as true and zero as false, as in Perl and C++. The null data type represents a variable that has no value. The only value in the null data type is NULL.Variables of the “resource” type represent references to resources from external sources. These are typically created by functions from a particular extension, and can only be processed by functions from the same extension; examples include file, image, and database resources.Arrays can contain elements of any type that PHP can handle, including resources, objects, and even other arrays. Order is preserved in lists of values and in hashes with both keys and values, and the two can be intermingled.PHP also supports strings, which can be used with single quotes, double quotes, or heredoc syntax.

Posted by

Objects oriented concepts in php

Saturday, November 15th, 2008

Basic object-oriented programming functionality was added in PHP 3.Object handling was completely rewritten for PHP 5, expanding the feature set and enhancing performance. In previous versions of PHP, objects were handled like primitive types.The drawback of this method was that the whole object was copied when a variable was assigned or passed as a parameter to a method. In the new approach, objects are referenced by handle, and not by value. PHP 5 introduced private and protected member variables and methods, along with abstract classes and final classes as well as abstract methods and final methods. It also introduced a standard way of declaring constructors and destructors, similar to that of other object-oriented languages such as C++, and a standard exception handling model. Furthermore, PHP 5 added interfaces and allowed for multiple interfaces to be implemented. There are special interfaces that allow objects to interact with the runtime system. Objects implementing ArrayAccess can be used with array syntax and objects implementing Iterator or IteratorAggregate can be used with the foreach language construct. There is no virtual table feature in the engine, so static variables are bound with a name instead of a reference at compile time.

If the developer creates a copy of an object using the reserved word clone, the Zend engine will check if a __clone() method has been defined or not. If not, it will call a default __clone() which will copy the object’s properties. If a __clone() method is defined, then it will be responsible for setting the necessary properties in the created object. For convenience, the engine will supply a function that imports the properties of the source object, so that the programmer can start with a by-value replica of the source object and only override properties that need to be changed.

Posted by

Why PHP?

Saturday, November 15th, 2008

You may be wondering why you should choose PHP over other languages such as Perl or even why you should learn a scripting language at all. I will deal with learning scripting languages first. Learning a scripting language, or even understanding one, can open up huge new possibilities for your website. Although you can download pre-made scripts from sites like Hotscripts, these will often contain advertising for the author or will not do exactly what you want. With an understanding of a scripting language you can easily edit these scripts to do what you want, or even create your own scripts.

Using scripts on your website allows you to add many new ‘interactive’ features like feedback forms, guestbooks, message boards, counters and even more advanced features like portal systems, content management, advertising managers etc. With these sort of things on your website you will find that it gives a more professional image. As well as this, anyone wanting to work in the site development industry will find that it is much easier to get a job if they know a scripting language.

Posted by

What Is PHP?

Saturday, November 15th, 2008

Up until recently, scripting on the internet was something which very few people even attempted, let alone mastered. Recently though, more and more people have been building their own websites and scripting languages have become more important. Because of this, scripting languages are becomming easier to learn and PHP is one of the easiest and most powerful yet.

PHP stands for Hypertext Preprocessor and is a server-side language. This means that the script is run on your web server, not on the user’s browser, so you do not need to worry about compatibility issues. PHP is relatively new (compared to languages such as Perl (CGI) and Java) but is quickly becomming one of the most popular scripting languages on the internet.

Posted by

Introduction to Visual Web Developer 2005 Express Edition

Tuesday, November 11th, 2008

Visual Web Developer 2005 Express Edition is part of the Microsoft Visual Studio 2005 family, and is the best development tool for building data driven web applications with ASP.NET 2.0. As part of the Express family, Visual Web Developer provides a seamless upgrade path to Visual Studio Standard, Professional, and Team System.

Visual Web Developer is tuned to the specific needs of the Web developer through a new Web profile that exposes a menu and window layout optimized for Web development. The environment includes a best-of-breed HTML source editor, an improved visual page designer, a new project system, better support for working with data, and full XHTML standards support.  Collectively, these features enable you to develop data-driven Web applications faster and easier than ever before. Below we’ll dive in and explore a few of the many Web development improvements coming with Visual Web Developer.

Better Source Code Editing

Visual Web Developer has an improved HTML source editor which enables you to write and modify your pages faster. The source editor provides full Intellisense throughout your files and has new features for navigating and validating your markup.

Intellisense Everywhere
Intellisense — the popup code hints which appear while you type — has a dramatic impact on your productivity as a developer. While support for Intellisense in Visual Studio .NET 2003 is excellent today, support for Intellisense in Visual Web Developer gets even better.

In Visual Web Developer, Intellisense pops up everywhere. For example, you can take full advantage of Intellisense within the script blocks in single file ASP.NET pages. In addition, Visual Web Developer also supports Intellisense for ASP.NET Page Directives and for inline CSS style attributes within a page.
HTML Formatting Options
Visual Web Developer enables you to precisely control the format of all HTML and ASP.NET Server Control markup generated using the WYSIWYG designer.  You can now configure the tag casing, attribute quotation, indention style and word wrap characteristics of every html or server control tag in a page.  You can set these formatting options as defaults for all markup, as well as optionally override each formatting option on a per tag/control basis.  This provides you with the flexibility to fully control exactly how you want your markup to be generated.

HTML format settings can be exported and imported from Visual Web Developer to enable markup style standardization across multiple developers on a team.  Visual Web Developer also enables developers to easily apply HTML formatting rules to existing markup source (to handle those cases when you need to update existing HTML source with new formatting rules).

Tag Navigator
The HTML source editor within Visual Web Developer ships with a new �Tag Navigator� feature that enables developers to easily track their location and navigate within a complicated HTML document. The Tag Navigator displays the current “path” within the source of an HTML page by displaying a list of all the HTML tags which contain the tag where your cursor is currently located. Clicking on any of the nodes enables developers to optionally change the source level selection, and quickly move up and down a deep HTML hierarchy.

Imagine, for example, that you are editing the source of an HTML page with multiple nested HTML tables. Editing nested tables can be challenging since it is easy to get lost within the jumble of nested table rows and cells. However, by taking advantage of the Tag Navigator, you can avoid getting lost since the Tag Navigator continuously displays your current path within the hierarchy of table elements.

Tag Outlining
Tag Outlining enables you to work more effectively with large HTML documents. With Tag Outlining, you can right-click any HTML tag in the source editor and select Collapse Tag to hide the entire contents of the tag. Collapsing different regions of the HTML source code contained in a page makes it easier to focus on the particular region of the page which you need to edit.

Posted by

What’s New in ASP.NET 2.0?

Tuesday, November 11th, 2008

ASP.NET is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. The first version of ASP.NET offered several important advantages over previous Web development models. ASP.NET 2.0 improves upon that foundation by adding support for several new and exciting features in the areas of developer productivity, administration and management, extensibility, and performance:
Developer Productivity
ASP.NET 2.0 encapsulates common Web tasks into application services and controls that can be easily reused across web sites. With these basic building blocks, many scenarios can now be implemented with far less custom code than was required in previous versions. With ASP.NET 2.0 it is possible to significantly reduce the amount of code and concepts necessary to build common scenarios on the web.

* New Server Controls. ASP.NET 2.0 introduces many new server controls that enable powerful declarative support for data access, login security, wizard navigation, menus, treeviews, portals, and more. Many of these controls take advantage of core application services in ASP.NET for scenarios like data access, membership and roles, and personalization. Some of the new families of controls in ASP.NET 2.0 are described below.

o Data Controls. Data access in ASP.NET 2.0 can be accomplished completely declaratively (no code) using the new data-bound and data source controls. There are new data source controls to represent different data backends such as SQL database, business objects, and XML, and there are new data-bound controls for rendering common UI for data, such as gridview, detailsview, and formview..

o Navigation Controls. The navigation controls provide common UI for navigating between pages in your site, such as treeview, menu, and sitemappath. These controls use the site navigation service in ASP.NET 2.0 to retrieve the custom structure you have defined for your site.

o Login Controls. The new login controls provide the building blocks to add authentication and authorization-based UI to your site, such as login forms, create user forms, password retrieval, and custom UI for logged in users or roles. These controls use the built-in membership and role services in ASP.NET 2.0 to interact with the user and role information defined for your site.

o Web Part Controls. Web parts are an exciting new family of controls that enable you to add rich, personalized content and layout to your site, as well as the ability to edit that content and layout directly from your application pages. These controls rely on the personalization services in ASP.NET 2.0 to provide a unique experience for each user in your application.

Posted by