Thursday 11 August 2011

Explain the AutoPostBack feature in ASP.NET?

AutoPostBack allows a control to automatically postback when an event is fired.

For eg: If we have a Button control and want the event to be posted to the server for processing,
we can set AutoPostBack = True on the button.

Tuesday 9 August 2011

Difference b/w Server.Transfer and Response.Redirect?

Response.Redirect :
  1.     we want to redirect the request to some plain HTML pages on our server or to some other web    server.
  2.     we don't care about causing additional roundtrips to the server on each request.
  3.     we do not need to preserve Query String and Form Variables from the original request.
  4.     we want our users to be able to see the new redirected URL where he is redirected in his browser (and be able to bookmark it if its necessary)

Server.Transfer :
  1.     we want to transfer current page request to another .aspx page on the same server
  2.    we want to preserve server resources and avoid the unnecessary roundtrips to the server.
  3.     we want to preserve Query String and Form Variables (optionally).
  4.     we don't need to show the real URL where we redirected the request in the users Web Browser.

Sunday 7 August 2011

Difference B/W abstract and Interfaces in .NET

Abstract Class

It can contain Fields
It can contain members with definition when they are not declared as abstract.
You can specify access modifier for the members.
By default members are private.
It can contain static members
It can contain constructors and destructor
It doesn’t support multiple inheritance.

Interface

It can not contain fields
It can not contain definition for any member
It is not possible to specify an access modifier for the members.
By default members are public.
It can not contain static members.
It can not contain constructors and destructor.
It supports multiple inheritance.

Saturday 6 August 2011

C PROGRAM

/* A Fibonacci Sequence is defined as follows: the first and second terms in the sequence are 0 and 1. Subsequent
terms are found by adding the preceding two terms in the sequence. Write a C program to generate
the first n terms of the sequence.
*/

#include <stdio.h>

void main()
{
int num1=0, num2=1,no,counter,fab;
clrscr();

printf("<===========PROGRAM TO FIND THE FIBONACCI SERIES UP TO N NO. IN SERIES=========>");
printf("\n\n\n\t\tENTER LENGTH OF SERIES (N) : ");
scanf("%d",&no);

printf("\n\n\t\t\t<----FIBONACCI SERIES---->");
printf("\n\n\t\t%d  %d",num1,num2);

//LOOP WILL RUN FOR 2 TIME LESS IN SERIES AS THESE WAS PRINTED IN ADVANCE
for(counter = 1; counter <= no-2; counter++)
{
fab=num1 + num2;
printf("  %d",fab);
num1=num2;
num2=fab;
}
getch();
}