Interview Tips Interview Tips, Interview Questions and Answers

18Apr/110

Difference Between GET and POST methods in HTML

Difference Between GET and POST methods

GET:
1) Data is appended to the URL.
2) Data is not secret.
3) It is a single call system
4) Maximum data that can be sent is 256.
5) Data transmission is faster
6) This is the default method for many browsers

POST:
1) Data is appended to the URL.
2) Data is Secret
3) It is a two call system.
4) There is no Limit on the amount of data.That is characters any amount of data can be sent.
5) Data transmission is comparatively slow.
6) No default and should be Explicitly specified.

18Mar/110

What is the use of command objects in .NET

They are used to connect connection object to Data reader or dataset. Following are the methods provided by command object:-

• ExecuteNonQuery: -

Executes the command defined in the Command Text property against the connection defined in the Connection property for a query that does not return any row (an UPDATE, DELETE, or INSERT). Returns an Integer indicating the number of rows affected by the query.

• ExecuteReader: -

Executes the command defined in the Command Text property against the connection defined in the Connection property. Returns a "reader" object that is connected to the resulting row set within the database, allowing the rows to be retrieved.

• ExecuteScalar: -

Executes the command defined in the Command Text property against the connection defined in the Connection property. Returns only single value (effectively the first column of the first row of the resulting row set any other returned columns and rows are discarded. It is fast and efficient when only a "singleton" value is required

27Feb/110

ASP.NET Validation Server Controls

CompareValidator     Compares the value of one input control to the value of another input control or to a fixed value
CustomValidator     Allows you to write a method to handle the validation of the value entered
RangeValidator     Checks that the user enters a value that falls between two values
RegularExpressionValidator     Ensures that the value of an input control matches a specified pattern
RequiredFieldValidator     Makes an input control a required field
ValidationSummary     Displays a report of all validation errors occurred in a Web page

20Feb/110

Web Server Controls

AdRotator     Displays a sequence of images
Button     Displays a push button
Calendar     Displays a calendar
CalendarDay     A day in a calendar control
CheckBox     Displays a check box
CheckBoxList     Creates a multi-selection check box group
DataGrid     Displays fields of a data source in a grid
DataList     Displays items from a data source by using templates
DropDownList     Creates a drop-down list
HyperLink     Creates a hyperlink
Image     Displays an image
ImageButton     Displays a clickable image
Label     Displays static content which is programmable (lets you apply styles to its content)
LinkButton     Creates a hyperlink button
ListBox     Creates a single- or multi-selection drop-down list
ListItem     Creates an item in a list
Literal     Displays static content which is programmable(does not let you apply styles to its content)
Panel     Provides a container for other controls
PlaceHolder     Reserves space for controls added by code
RadioButton     Creates a radio button
RadioButtonList     Creates a group of radio buttons
BulletedList     Creates a list in bullet format
Repeater     Displays a repeated list of items bound to the control
Style     Sets the style of controls
Table     Creates a table
TableCell     Creates a table cell
TableRow     Creates a table row
TextBox     Creates a text box
Xml     Displays an XML file or the results of an XSL transform

12Feb/110

HTML Server Controls

HtmlAnchor     Controls an <a> HTML element
HtmlButton     Controls a <button> HTML element
HtmlForm     Controls a <form> HTML element
HtmlGeneric     Controls other HTML element not specified by a specific HTML server control, like <body>, <div>, <span>, etc.
HtmlImage     Controls an <image> HTML element
HtmlInputButton     Controls <input type="button">, <input type="submit">, and <input type="reset"> HTML elements
HtmlInputCheckBox     Controls an <input type="checkbox"> HTML element
HtmlInputFile     Controls an <input type="file"> HTML element
HtmlInputHidden     Controls an <input type="hidden"> HTML element
HtmlInputImage     Controls an <input type="image"> HTML element
HtmlInputRadioButton     Controls an <input type="radio"> HTML element
HtmlInputText     Controls <input type="text"> and <input type="password"> HTML elements
HtmlSelect     Controls a <select> HTML element
HtmlTable     Controls a <table> HTML element
HtmlTableCell     Controls <td>and <th> HTML elements
HtmlTableRow     Controls a <tr> HTML element
HtmlTextArea     Controls a <textarea> HTML element

29Nov/100

Understanding Reference Types

Reference type variables are named appropriately (reference) because the variable holds a reference to an object. In C and C++, you have something similar that is called a pointer, which points to an object. While you can modify a pointer, you can't modify the value of a reference - it simply points at the object in memory.

An important fact you need to understand is that when you are assigning one reference type variable to another, only the reference is copied, not the object. The variable holds the reference and that is what is being copied. Listing 22-2 shows how this works.
// Reference Type Assignment

using System;

class Employee
{
private string m_name;

public string Name
{
get { return m_name; }
set { m_name = value; }
}
}

class Program
{
static void Main()
{
Employee joe = new Employee();
joe.Name = "Joe";

Employee bob = new Employee();
bob.Name = "Bob";

Console.WriteLine("Original Employee Values:");
Console.WriteLine("joe = " + joe.Name);
Console.WriteLine("bob = " + bob.Name);

// assign joe reference to bob variable
bob = joe;

Console.WriteLine();
Console.WriteLine("Values After Reference Assignment:");
Console.WriteLine("joe = " + joe.Name);
Console.WriteLine("bob = " + bob.Name);

joe.Name = "Bobbi Jo";

Console.WriteLine();
Console.WriteLine("Values After Changing One Instance:");
Console.WriteLine("joe = " + joe.Name);
Console.WriteLine("bob = " + bob.Name);

Console.ReadKey();
}
}

Here's the output:

Original Employee Values:
joe = Joe
bob = Bob

Values After Reference Assignment:
joe = Joe
bob = Joe

Values After Changing One Instance:
joe = Bobbi Jo
bob = Bobbi Jo

27Nov/100

Using Delegate Parameters with Anonymous Methods

Many event handlers need to use the parameters of the delegate they are based on. The previous example didn't use those parameters, so it was more convenient to not declare them, which C# allows. Listing 21-2 shows you how to use parameters if you need to.
// Using Parameters with Anonymous Methods

using System;
using System.Windows.Forms;

public partial class Form1 : Form
{
public Form1()
{
Button btnHello = new Button();
btnHello.Text = "Hello";

btnHello.Click +=
delegate
{
MessageBox.Show("Hello");
};

Button btnGoodBye = new Button();
btnGoodBye.Text = "Goodbye";
btnGoodBye.Left = btnHello.Width + 5;

btnGoodBye.Click +=
delegate(object sender, EventArgs e)
{
string message = (sender as Button).Text;
MessageBox.Show(message);
};

Controls.Add(btnHello);
Controls.Add(btnGoodBye);
}
}

2Nov/100

Background of ASP.NET Session State

ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. HTTP is a stateless protocol. This means that a Web server treats each HTTP request for a page as an independent request. The server retains no knowledge of variable values that were used during previous requests. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session. By default, ASP.NET session state is enabled for all ASP.NET applications.

Alternatives to session state include the following:

*

Application state, which stores variables that can be accessed by all users of an ASP.NET application.
*

Profile properties, which persists user values in a data store without expiring them.
*

ASP.NET caching, which stores values in memory that is available to all ASP.NET applications.
*

View state, which persists values in a page.
*

Cookies.
*

The query string and fields on an HTML form that are available from an HTTP request.