| 0 comments ]

You can now follow the same way like in the blogger help to create your expandable post. When writing your new post, anything you put above the tag will be the teaser text.

The main body of your post needs to go in between the and tags. When you have finish typing your post, make sure you add "more" label in order for the “read more” link to work properly.

| 0 comments ]

ASP.NET directives are special instructions to CLR about the behaviour and operations of the webforms.Every ASP.NET page contains directives.In other words,these directives are commands that the compiler uses when the page is compiled.We can control the behaviour of page by using directives.It doesn't matter that the page uses code-behind model or the inline-coding model,we can use directives in our application.

Directive is opened with .The format of a directive is as follows :
<%@[Directive] Attribute=value %>

we can add more than one attribute to directive statements as follows:
<%@[Directive] Attribute=value Attribute=value %>

There are 11 directives in ASP.NET 2.0.

Page - when the page is complied the @Page directive enables us to use attributesand values for an .aspx page.
Control - Enable us to use with user controls(.ascx).
Register - Registers one .ascx file to web-page[.aspx].
OutputCache - Used for Client-side caching.
Import - Imports a Namespace[Package] into the page.
Implements - Implements one Interface to web-form[.aspx/.ascx].
Reference - Used for Page To Page Data Transfer.
Assembly - Includes one Assembly[.dll] to the application.
PreviousPagetype - Enables the page in an application to work with postback from other Page.Master - Defines one Master[.master] Page.MasterType - Uses a class name to a page within specified master page.
Tips:
(1.)Although page still compiles if we put these directives at a different place in the page but it is good programming practice to put these directives at the top of our page or control.
(2.)@Page and @Control directives can not be used at the same time in .aspx page.

| 0 comments ]

Introduction:
This tutorial illustrates how to Implement Fragment Caching, this caching is conceptually same as Page caching. Here we will create a User Control file [.ascx] which will show System Date & Time in a Label control and embed it in a aspx.page that will also show system's Current Date & Time.
We will use Directive in the User control file and Directive in our Main Page to embed User Control file below Directive.
Same as earlier we have done in Page Cache we have to declare it's Duration attribute, when you request the Main Page label in Main page gets updated but the Label in User Control file is cached hence it will show the cached time (assuming that the duration of User Control file has not elapsed).
Step 1:
Create a Website name it Caching and rename the Default.aspx file to FragmentCache.aspx
Step 2:
Drag & Drop Label control on the Page with properties [ID= LblMsg ]

Step 3:
Write this code in FragmentCache.aspx.cs File.
protected void Page_Load(object sender, EventArgs e) { LblMsg.Text = "Current Time : "; LblMsg.Text += DateTime.Now.ToString(); }
The above code is for Main Page which will show system current Date & Time.
Step 4:
Now add a new Web User Control file in this project and name it UCPage.ascx
Step 5:
Again Drag & Drop Label control on the UCPage.ascx with properties [ID= LblMsg ]

Step 6:
Write this Line of code under Directive in PageCache.aspx File.

The above code will make this file cached for 10 secs.
Step 7:
Now Write This Line of Code in UCPage.ascx.cs File
protected void Page_Load(object sender, EventArgs e) { LblMsg.Text = "Cached Time : "; LblMsg.Text += DateTime.Now.ToString(); }
Step 8:
Now Drag & drop UCPage.acsx File from solution explorer on FragmentCache.aspx file by doing this, automatically these line of code are added in FragmentCache.aspx file.

When you debug FragmentCache.aspx page you will see that the page shows the current time in upper Label control while lower Label Control shows Cached time. Whether how many time you have refresh the page within 10 secs in will show same time, as soon as the time elapsed you will get the current system time in both Controls. This is how we implement Fragment cache in asp.net

| 0 comments ]

Introduction:
This tutorial illustrates how to implement page caching, here I am creating a simple page that shows system current date & time in a Label control, here we have used Directive along with Directive to cache entire Page.
When we cache a Page we also have to declare it's Lifetime because if we don't declare it's lifetime than every time we request to the server & we will get the same old cached Page Hence it's mandatory to declare lifetime of a Cached Page so that after particular time Server refreshes that Page. Hence In OutputCache Directive we will use Duration attribute, when you again request the same page after that duration than a new cached page is send to you by the server.
Step 1:
Open a new Website name it Caching and rename the Default.aspx file to PageCache.aspx
Step 2:
Drag & Drop Label control on the Page with properties [ID= LblMsg ]

Step 3:
Write this Line of code under Directive in PageCache.aspx File.

I have already discuss the use of Duration attribute but here we have a new attribute VaryByParam by declaring this we can cache multiple version of a page based on parameters passed in it. The possible parameters we can pass are none, "*", any query string. For more details check with msdn.
Step 4:
and type this code in PageCache.aspx.cs File.protected void Page_Load(object sender, EventArgs e) { LblMsg.Text = "Current Time :
"; LblMsg.Text = DateTime.Now.ToString(); }
In this code we are saving current System time in Label [LblMsg] Control.
When you debug this page you will see that the page shows the same time for 30 sec whether how many time you have refresh the page as soon as the time elapsed you will get the current system time. This is how we use to cache a page you may be thinking that 30 sec is very short duration of time may be but for Web Servers where there are thousands of request are processed in a minute. Hence generally caching duration is decided by Website Traffic.

| 0 comments ]

Introduction:

This tutorial illustrates how to create your very first aspx page. To start developing an ASP.net application you should have basic understanding of HTML. No previous knowledge of ASP technology is required, because ASP or Classic ASP works on entirely different concept as compared to ASP.net. As ASP.net is advance form and it build on entirely new concept of .Net framework. In this article, I have used Microsoft Visual Studio Professional Edition 2005.

Step 1:

Start Visual studio 2005 and Select File > New > Website.

Step 2:

A dialog Box will appear , In which you have to select ASP.Net Website option from Templates. This will create a blank ASP.Net Website.

post1.4.1

Step 3:

Choose [File System] option from the location Drop down menu and in language menu choose [Visual C#]. Now enter the location & Name of Website, then Click OK button. By default the site name will be Website1, if you have not created any application previously. Change it to MyWebsite. The new path will be like: C:\Documents and Settings\UserName\My Documents\Visual Studio 2005\Projects\MyWebsite.

Code:

[Default.aspx Page]

<%@ Page Language="C#" AutoEventWireup="true" CodeFile= "Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd>

<html xmlns="http://www.w3.org/1999/xhtml >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>

[Default.aspx.cs Page]

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}

| 0 comments ]

When the programmer face a challenge to design an application, which can interact which each other irrespect of OS and hardware. Then to satisfy the needs two standards evolves one is HTML [Hypertext Markup Language] and other is XML [Extensible Markup Language]. Both of these standards are operation system independent hence they can be run on any machine & both of them uses HTTP [Hypertext Transfer Protocol] Protocol for transfer of data. HTML standard is used to Display Data in Browser while XML is used to Inter exchange data between two computers.

But with current Technologies it is not easy to manage large application, hence they need to develop some framework which can help it’s programmers to manage and deploy these application easily. Hence several Web Page Technologies evolve Like Microsoft ASP [Active Server Pages], Sun MicroSystem JSP [Java Server Pages] and many more.