Sunday, 20 May 2012

difference between response.redirect and server.transfer

  • In Server.transfer their is no round trip while Response.redirect has a round trip hence puts a load on the server.
  • Using Sever.transfer you cannot redirect to a different server itself while using Response.redirect you can redirect to a different server also.

Page Life Cycle in asp.net

Page Event Use of Event
   
PreInit
  • Check The IsPostBack Property.
  • Create and Recreate dynamic controls.
  • .Set master page and themes.
Init
  • Initialize control properties and skin settings.
  • it is used to read and write all properties.
InitComplete
  • Tracking of view state changes is turned on
PreLoad
  • Raised after the page loads view state
  • process Request Instance.
PageLoad
  • The Page object calls the OnLoad method on the Page object
  • Set Property in controls.
  • establish database connections.
Control events
  • Use these events to handle specific control events, such as a button control's Click event or a TextBox control's TextChanged event.
LoadComplete
  • Raised at the end of the event-handling stage.
PreRender
  • created all controls
PreRenderComplete
  • Raised after each data bound control whose DataSourceID property is set calls its DataBind method.
SaveStateComplete
  • Raised after view state and control state have been saved for the page and for all controls.
Unload
  • Raised for each control and then for the page.
  • In controls, use this event to do final cleanup for specific controls, such as closing control-specific database connections.
   

Thursday, 5 April 2012

Difference between struct and classes

Struct

Classes

1. The struct is value type 1. The class is reference type
2. It inherits from System.ValueType 2.It inherits from the System.Object Type
3. The struct value will be stored on the stack memory. 3.The class object is stored on the heap memory.
4. Cannot implement Inheritance 4.implement Inheritance
5.The struct can have only constructor. 5.The class can have the constructor and destructor.
6. The struct can't initialize at the time of declaration. 6. The class can have the initializes fields.

Friday, 9 March 2012

How to upload a website in asp.net




1. To Uplaod a website you have to build Your Website first

2. Go to Solution Explorer

3. Build Application To check the errors and make required changes in
webconfig File. eg connection string

4. Than again right click on application and select Publish Website option
Publish wizard will open.

5. set the loaction for precomplied folder.

6. clcik Ok

7. You will get Your Precompiled folder.

8. Now Upload that Folder on your Hosting account using any Ftp Program such
as Filezilla or cuteftp or any Other Program.

9. Enter Your Credential and Login

10 Upload Your Precomplied Folder to root folder of webhosting Account.

Conatct me at aman0716@gmail.com regarding any Problem.

Saturday, 14 January 2012

Program for Leap year Checking


#include
#include
#include
void main()
{
int year;
clrscr();
printf("enter the year=");
scanf("%d",&year);
if(year%4==0)
{
printf("Leap Year");
}
else
{
printf("not a Leap Year");
}
getch();
}
 

Write a Program to check an integer for perfect square


#include
#include
#include
void main()
{
int num,root;
clrscr();
printf("enter the number=");
scanf("%d",&num);
root=sqrt(num);
if(num==root*root)
{
printf("Perfect Square");
}
else
{
printf("not a perfect Square");
}
getch();
}
 

Conversion of Centigrade temperature to fahrenheit


 #include
#include
void main()
{
float fahr,cent;
clrscr();
printf("Enter the temperature in centigrade=");
scanf("%f",¢);
fahr=1.8*cent+32.0;
printf("%f centigrade is equals to the %f fahrenheit",cent,fahr);
getch();
}
 

Write a Program to Convert KiloMeter into Meter,Centimeter,Inch


 #include
#include
void main()
{
long int kilometer,meter,centimeter;
double inch,feet;
printf("Enter the Value in kilometer=");
scanf("%ld",&kilometer);
meter=kilometer*1000;
centimeter=meter*100;
inch=centimeter/2.5;
//feet=
printf("%ld Kilometer is Equals to %ld meter\n",kilometer,meter);
printf("%ld kilometer is Equals to %ld centimeter\n",kilometer,centimeter);
printf("%ld kilometer is Equals to %lf inch",kilometer,inch);
getch();
}