If you’ve ever built a model from Lego bricks, you’re well prepared to start building real ASP.NET web pages. ASP.NET offers features that allow web developers to build parts of web pages independently, then put them together later to form complete pages.
The content we’re creating through our work with ASP.NET is almost never static. At design time, we tend to think in terms of templates that contain placeholders for the content that will be generated dynamically at runtime. And to fill those placeholders, we can either use one of the many controls ASP.NET provides, or build our own.
In this chapter of the fabulous new edition of Build Your Own ASP.NET 3.5 Web Site Using C# & VB, we’ll discuss many of the objects and techniques that give life and color to ASP.NET web pages, including:
Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts
Tuesday, September 7, 2010
The Constructions of ASP.NET web pages
Sunday, September 5, 2010
Encapsulation and Inheritence
Introduction
The OOP stands on the following three pillars.
- Object &Class (Encapsulation)
- Inheritance
- Polymorphism
Tuesday, August 24, 2010
4-Tier Architecture in ASP.NET with C#
Well, the architecture I am going to demonstrate here is just
enhancement of 3-Tier archicture. In this architecture; you no need of
writing long function parameters throughout the layers (as in
traditionally 3-Tier archicture has to) and the actual objects of the
application will be in a separate tier so that in future you can
separately use these objects for enhancements. Change in the object
definition can be done without touching the entire Business Access
Layers ............
Let me explain you step-wise process of creatioin of 4-Tier architecture application.
In this application, I am going to take example of a Person that will have 3 properties: FirstName, LastName, Age. We will create a separate pages to insert these records (default.aspx) into database and list,update,delete records (list.aspx) from database.
Let me explain you step-wise process of creatioin of 4-Tier architecture application.
In this application, I am going to take example of a Person that will have 3 properties: FirstName, LastName, Age. We will create a separate pages to insert these records (default.aspx) into database and list,update,delete records (list.aspx) from database.
Labels:
.NET,
ASP.NET,
C#,
Design Patterns,
MVC,
Source code,
Tips and Tricks
Monday, August 23, 2010
Passwords Security in Your Database
When ASP.NET developers think of Web security and
authentication, three options typically come to mind: Windows
authentication, forms authentication, and passport authentication.
If you're building an Intranet application within your organization, for instance, you might choose to use Windows authentication. Configuring Windows authentication within IIS is fairly straight forward and involves only two steps.
First, we make sure that Integrated Windows Authentication is checked and Anonymous Access is unchecked for a Web application by following the steps outlined below:
If you're building an Intranet application within your organization, for instance, you might choose to use Windows authentication. Configuring Windows authentication within IIS is fairly straight forward and involves only two steps.
First, we make sure that Integrated Windows Authentication is checked and Anonymous Access is unchecked for a Web application by following the steps outlined below:
- Right-click on the Web app directory within IIS and select Properties.
- Select the Directory Security tab from the application's Properties dialog.
- Select the Edit… button within the Anonymous Access and Authentication control panel.
- Uncheck Anonymous Access and make sure that Integrated Windows Authentication is checked similar to the figure below.
Wednesday, August 18, 2010
The Total Newbie’s Guide to jQuery: Select Elements and Manipulate CSS with jQuery
This article, as well as a follow-up article coming next week, are
excerpts from Chapter 2 of the new SitePoint book, jQuery: Novice
to Ninja, by Earle Castledine and Craig Sharkie. You can grab the
entirety of Chapter 2, as well as Chapters 1 and 7 and the complete code
archive for the entire book for free here. Together, these two
articles constitute an introduction to jQuery for designers who’ve only ever
worked with CSS and HTML.
If you’ve been wanting to learn the basics of jQuery and start adding
some dynamic interactions to your website, this is the place to start. If
you’d like to follow along with the code in this article, download the
sample, which includes all of the code examples from the book.
Labels:
.NET,
Ajax,
ASP.NET,
C#,
CSS,
JavaScript,
JQuery,
Tips and Tricks
Speed Up Your Site! 8 ASP.NET Performance Tips (part 6)
Lack of Indexes
The ability to index data is one of the key benefits of storing information in a database. Imagine for a moment that you need to look up a name in a telephone book. You take advantage of the fact that the last names are sorted in alphabetic order -- it would take forever to find a name if the entries were listed in random order. Databases take advantage of the way your information is sorted for the same reason. The default sort order in a table is called a clustered index.
The ability to index data is one of the key benefits of storing information in a database. Imagine for a moment that you need to look up a name in a telephone book. You take advantage of the fact that the last names are sorted in alphabetic order -- it would take forever to find a name if the entries were listed in random order. Databases take advantage of the way your information is sorted for the same reason. The default sort order in a table is called a clustered index.
Labels:
.NET,
ASP.NET,
C#,
Tips and Tricks,
Visual Studio
Tuesday, August 17, 2010
Speed Up Your Site! 8 ASP.NET Performance Tips (part 3)
How can I decrease the bandwidth that my site uses?
ASP.NET abstracts a lot of traditional web development details from
the developer. Just drag and drop a few controls on a form, set some
properties, write a little bit of code, and -- bam! -- you've got a
functioning web site.
However, that doesn't mean the resulting HTML markup will
necessarily be efficient or small. It's not unusual to see ASP.NET
pages that contain more than 100 kilobytes of markup. I recommend that
you keep a close eye on the HTML markup that results from your ASP.NET
web pages -- to keep these file sizes in check can sometimes require
additional effort, which is one reason we covered the topic of web
standards in Chapter 9, ASP.NET and Web Standards.
Labels:
.NET,
Ajax,
ASP.NET,
C#,
JQuery,
Tips and Tricks,
Visual Studio
Speed Up Your Site! 8 ASP.NET Performance Tips (part 2)
How can I decrease the size of the view state?
One convenience of ASP.NET controls is that they can preserve state
across postbacks -- a topic we've covered in depth in Chapter 6,
Maintaining State. This, of course, is a feature that comes at a price
-- to implement it, we add a hidden field to the page to store the
control settings for transmission between the client and server, but
depending on the controls the page uses, the view state can sometimes
become quite large.
One obvious way to reduce the size of view state is to turn it off
if you don't need it. This adjustment can be performed either at the
page level, or at the control level. If, for whatever reason, you can't
disable the view state (for example, your page uses controls that are
dependent upon the view state), there are a few other steps you can
take to at least reduce its impact on your page size.
Labels:
.NET,
Ajax,
ASP.NET,
C#,
JavaScript,
Tips and Tricks,
Visual Studio
Speed Up Your Site! 8 ASP.NET Performance Tips (part 1)
Now that you've added the finishing touches to your web site
and unleashed it onto the world, fame, fortune, and success will surely
follow -- won't it?
Unfortunately, your web application's success can lead to something
less desirable -- performance and scaling problems. On a traditional
desktop application, one thousand users translate to one thousand
client computers chugging away, sharing the load of running your
application. The application is effectively spread among all the users'
machines. When it comes to a web application, though, those same
thousand users are usually serviced by a single machine -- your web
server.
Success can come at a cost for web applications: a cost in bandwidth
and server hardware. However, there are a few clever ways you can
reduce -- and sometimes eliminate -- these problems. We'll take a look
at some of the different approaches to improving the performance of an
ASP.NET site in this chapter, which has been extracted from The ASP.NET 2.0 Anthology, 101 Essential Tips, Tricks & Hacks. Feel free to download this chapter -- along with three others -- for offline reference.
Wednesday, August 4, 2010
Exploring the Singleton Design Pattern
Introduction
In the course of developing software applications, repetitive patterns emerge as the application is developed. As whole software systems are developed, many of these same patterns become evident at scale.This concept of repetitive pattern is evident in other applications. One such application is automobile manufacturing. Many different automobile models share the same sub-assemblies from the most basic components, such as light bulbs and fasteners, to larger assemblies, such as chassis and engines.
In homebuilding, the repetitive pattern concept applies to screws and nails as well as to whole building electrical distribution systems. Whether a team is assembled to create a new automobile or a new building design, it usually does not have to ponder problems that were solved before. If a team assigned to design and build a house had to rethink and design every single component of the house, the whole process would take much longer than it currently does. Design decisions such as the height of a door or the function of a light switch are well understood. A house designer does not have to redesign and reconstruct a different type of device to deliver and collect water in order to meet a requirement to supply hand washing functionality to different parts of the house: a standard sink, as well as a standard interface of hot and cold water inputs and drain water output, are well understood components of house construction. The repetitive pattern concept can be applied over and over to nearly everything we surround ourselves with, including software.
Monday, August 2, 2010
What is abstract in C#
Abstract Method
It is declared by the keyword abstract. It has no body part. Abstract method must be declared inside an Abstract class, but the vice verse is not correct. This means that it is not necessary that a abstract class always contain abstract methods. Abstract method's definition appears in the child.
It is just like the skeleton of the program and act as a reminder. That means it is defined once in the super class and again used in the derived class.
Friday, July 23, 2010
How to consume other Sites RSS in ASP.NET
Introduction
One might wonder how they can have news on
their website. Will they have to be there and Update their site to get updated content?
Do they have to hunt for news? This becomes confusing for a content designers
of some websites. Can they get this news from other good Source? But how will
they update the News from those sources? These are questions that are asked every
day. In this article I will show you how to use RSS from other sites and
display them in your site and get updates without you being there. Your website
can display news with images and links to the source in ASP.Net
Background
In
this Article we are going to consume RSS feeds in our ASP.NET website
Wednesday, July 21, 2010
The Factory Method (Creational) Design Pattern
The Problem
One of the goals of object-oriented design is to delegate responsibility among different objects. This kind of partitioning is good since it encourages Encapsulation and Delegation.
- Sometimes, an Application (or framework) at runtime, cannot anticipate the class of object that it must create. The Application (or framework) may know that it has to instantiate classes, but it may only know about abstract classes (or interfaces), which it cannot instantiate. Thus the Application class may only know when it has to instantiate a new Object of a class, not what kind of subclass to create.
- a class may want it's subclasses to specify the objects to be created.
- a class may delegate responsibility to one of several helper subclasses so that knowledge can be localized to specific helper subclasses.
Tuesday, July 20, 2010
Upgrading VS 2005 Web Site Projects to be VS 2005 Web Application Projects
he below tutorial helps explain how you can migrate existing VS 2005 Web Site Projects to use the new VS 2005 Web Application Project option. Please make sure that you have already completed Tutorials 1-6 on this site first, as this will help provide you with context about how the VS 2005 Web Application Project model works.
Note: If you want to migrate an existing VS 2003 Web Project to use the VS 2005 Web Application Project option, you should read this tutorial here.
Note: the sample I am using with the migration steps below is the Personal Starter Kit that ships with Visual Studio (if you want to follow along exactly, you can choose File->New Web Site to create the VS 2005 Web Site Project version of it).
Note: If you want to migrate an existing VS 2003 Web Project to use the VS 2005 Web Application Project option, you should read this tutorial here.
Migrating from VS 2005 Web Site Projects to VS 2005 Web Application Projects
Please follow the below steps in exact order. If you have problems using the below steps, please post in this forum and VS team members will be able to help.Note: the sample I am using with the migration steps below is the Personal Starter Kit that ships with Visual Studio (if you want to follow along exactly, you can choose File->New Web Site to create the VS 2005 Web Site Project version of it).
VS 2005 Web Application Project Release Candidate Now Available
What is new with today’s release?
Today’s release is a major refresh that provides a ton of new functionality and rounds out the feature-set. Some of the major new features added since the February preview:
- Event handler generation and wire-up from the WYSIWYG designer
- F7/Shift-F7 Navigation Support (switch between page views)
- Add New Item Wizard to add pages based on Master Pages (easily pick master)
- Richer Publishing Support
- Connection String and Settings Support in Web.Config
- Resources and .Resx Resource Editor Support
- Support for building multi-project applications and sub-web projects
- .ASPX files no longer locked when debugging
- Support for root-path based image and stylesheets (/images/foo.jpg)
- Control Registrations within Web.Config files
- Web Service Cross-Project Reference Support
- Section 508 and WCAG Accessibility Checker Support
- Ability to create an IIS Vroot/Application setting within Project Dialog
- SQL DataSource Control Support
- ASP.NET Custom Folder Templates
- Component Designer Support
- Support to Drag/Drop User Controls, StyleSheets, Images from Solution Explorer to designer
- New Web Service Project Template
- SQL Express Support
Upgrading VS 2003 Web Projects to be VS 2005 Web Application Projects
The below tutorial helps explain how you can now use the VS 2005 Web Application Project to more easily migrate existing web projects in VS 2003 to VS 2005.
An alternative (and now much easier) approach, is to migrate a VS 2003 Web Application Project to use the VS 2005 Web Application Project option instead. The VS 2005 Web Application Project model uses the same conceptual approach as VS 2003 (project file to include/exclude files, and compilation to a single assembly, etc), and so doesn't require any architectural changes (the only things that might impact you are deprecated API warnings -- which can optionally be ignored -- and/or language changes).
Once VS 2005 Web Application Project RC1 is installed, the default migration wizard in VS 2005 is to migrate VS 2003 Web Projects to VS 2005 Web Application Projects. This model is much less invasive and requires fewer changes.
Migrating from VS 2003 to VS 2005 using the Web Application Project
There are a couple of different strategies you can take when migrating a VS 2003 Web Project to VS 2005. One option (which is the default with the shipping VS 2005 bits) is to migrate the project to use the new VS 2005 Web Site project model. For more information click hereAn alternative (and now much easier) approach, is to migrate a VS 2003 Web Application Project to use the VS 2005 Web Application Project option instead. The VS 2005 Web Application Project model uses the same conceptual approach as VS 2003 (project file to include/exclude files, and compilation to a single assembly, etc), and so doesn't require any architectural changes (the only things that might impact you are deprecated API warnings -- which can optionally be ignored -- and/or language changes).
Once VS 2005 Web Application Project RC1 is installed, the default migration wizard in VS 2005 is to migrate VS 2003 Web Projects to VS 2005 Web Application Projects. This model is much less invasive and requires fewer changes.
Upgrading VS 2003 Web Projects to be VS 2005 Web Application Projects
The below tutorial helps explain how you can now use the VS 2005 Web Application Project to more easily migrate existing web projects in VS 2003 to VS 2005.
An alternative (and now much easier) approach, is to migrate a VS 2003 Web Application Project to use the VS 2005 Web Application Project option instead. The VS 2005 Web Application Project model uses the same conceptual approach as VS 2003 (project file to include/exclude files, and compilation to a single assembly, etc), and so doesn't require any architectural changes (the only things that might impact you are deprecated API warnings -- which can optionally be ignored -- and/or language changes).
Once VS 2005 Web Application Project RC1 is installed, the default migration wizard in VS 2005 is to migrate VS 2003 Web Projects to VS 2005 Web Application Projects. This model is much less invasive and requires fewer changes.
Please follow the below steps in exact order. If you have problems using the below steps, please post in this forum and VS team members will be able to help.
Migrating from VS 2003 to VS 2005 using the Web Application Project
There are a couple of different strategies you can take when migrating a VS 2003 Web Project to VS 2005. One option (which is the default with the shipping VS 2005 bits) is to migrate the project to use the new VS 2005 Web Site project model. For more information click hereAn alternative (and now much easier) approach, is to migrate a VS 2003 Web Application Project to use the VS 2005 Web Application Project option instead. The VS 2005 Web Application Project model uses the same conceptual approach as VS 2003 (project file to include/exclude files, and compilation to a single assembly, etc), and so doesn't require any architectural changes (the only things that might impact you are deprecated API warnings -- which can optionally be ignored -- and/or language changes).
Once VS 2005 Web Application Project RC1 is installed, the default migration wizard in VS 2005 is to migrate VS 2003 Web Projects to VS 2005 Web Application Projects. This model is much less invasive and requires fewer changes.
Please follow the below steps in exact order. If you have problems using the below steps, please post in this forum and VS team members will be able to help.
Creating and Using User Control Libraries - Tutorial 6
The below tutorial demonstrates how to create and use separate user-control library projects with VS 2005 Web Application Projects. Please make sure that you have already completed Using Master Pages and Site Navigation - Tutorial 5 before reviewing this one.
What this tutorial will cover is how you can also use VS 2005 Web Application projects to create re-usable libraries of user-controls that are potentially referenced and pulled-in from multiple web projects. This provides additional re-use flexibility with large-scale web-projects, and with VS 2005 Web Application Projects is now easier than it was with VS 2003.
Why Create a User-Control Library
Adding a user-control into an existing web application project is very easy. Simply right-click on the project and choose the "Add New Item" menu item and pick the "Web User Control" template.What this tutorial will cover is how you can also use VS 2005 Web Application projects to create re-usable libraries of user-controls that are potentially referenced and pulled-in from multiple web projects. This provides additional re-use flexibility with large-scale web-projects, and with VS 2005 Web Application Projects is now easier than it was with VS 2003.
Using Master Pages and Site Navigation - Tutorial 5
The below tutorial demonstrates how to create and use the new ASP.NET Master Pages and Site Navigation features within VS 2005 Web Application Projects. Please make sure that you have already completed Data Binding against Objects -Tutorial 4 before reviewing this one.
Add a Master Page to the Web Project
Right-click on the project and select Add->Add New Item to add a new MasterPage called "Site.Master" to the project:Data Binding against Objects - Tutorial 4
The below tutorial demonstrates how to build ASP.NET Pages that databind against Objects within VS 2005 Web Application Projects. Please make sure that you have already completed Building Pages with VS 2005 Web Application Projects -Tutorial 3 before reviewing this one.
Adding Classes to the Web Project
In this sample we'll be data-binding a GridView control on a page to a set of classes in our web application project.
Subscribe to:
Posts (Atom)
