.Net technical interview questions for 2+ years


I would like to share my interview questions in the technical round for candidates with 2+ years experience .Net, as this was the second round of my interview i was asked some tricky questions which i would like to share.

The following are the technical questions asked in the Interview



1.When we write a sql query "Select 1.2" and run it in the sql query builder then what is the output we get ?

2.What is the sequence of pageloads when master page is used ?
Ans : the squence in which the pages get load when master pages are used is

Load(Page)--->Load(Master)--->LoadComplete(Page)

3.When we instantiate a class variable then what are the default properties or methods we can access through that variable other than class members and class methods ?
For Example

public class Myclass()
{
public string Name;
Public string age;
}
static void main()
{
Myclass mc = new Myclass();

mc. //--->now here what are the default methods which we can access apart for the members of class i.e, Name,Age .
}


4.What is Client ID and Unique ID in master pages and where is it used ?

5.What is the significance of "Intergrated security = true" in a connection string ?

6.What is the difference in throwing exceptions using ex.message and throw ?

Finally few more questions were asked on Javascript.


Comments

Guest Author: Anuradha Tirmare30 Mar 2012

It is a good guide.Thank you.It helped me a lot.

Author: Ritesh21 Feb 2014 Member Level: Bronze   Points : 3

5.What is the significance of "Intergrated security = true" in a connection string ?

Answer:
Integrated Security = False : User ID and Password are specified in the connection.
Integrated Security = true : the current Windows account credentials are used for authentication.

Integrated Security = SSPI : this is equalant to true.

we can avid the username , password attributes from the connection string and use the Integrated Security

Author: Ritesh21 Feb 2014 Member Level: Bronze   Points : 7

4.What is Client ID and Unique ID in master pages and where is it used ?

Answer:
Control.ClientID

ClientID will be a unique ID string that is rendered to the client to identify the control in the output HTML. It uses _ to include parent controls (container) ID to make it unique. For example, ct100_ContentPlaceHolder1_txtLogin. The client id for control will be generated by appending the parent container's(parent control) ID with the original control id with "_" as delimeter. In our example, ContentPlaceHolder1 is the ContentPlaceHolder ID of the master page which is the parent container for txtLogin.


To get the ClientID of a control,
txtLogin.ClientID


The client id can be used to identify the control in client side scripting like javascript.

Control.UniqueID
UniqueID is also a uniquely identifiable ID for a control but only used by ASP.Net page framework to identify the control. It uses $ to include parent controls (container) ID to make it unique. For example, ct100$ContentPlaceHolder1$txtLogin. Similar to ClientID, UniqueID is also generated by appending the parent container's(parent control) ID with the original control id but with $ delimeter.

To get the UniqueID of a control,
txtLogin.UniqueID

The unique id is used by the Asp.Net framework to identify the control when the page is posted back to the server.

Author: Ritesh21 Feb 2014 Member Level: Bronze   Points : 2

6.What is the difference in throwing exceptions using ex.message and throw ?

Answer:
throw; rethrows the original exception and preserves its original stack trace.

throw ex; throws the original exception but resets the stack trace, destroying all stack trace information until your catch block.



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: