Interview questions for 3-6 years experienced on .net
Recently i attended one cmmi level 5 mnc for 3+ experience.asp.net mvc and asp.net interview questions posted here.some of the questions what i remembered.please provide answers that will be helpful to others.
1.how do return partial view in controller?
2.what is difference between viewdata and view bag?
3.how to validate using data annotation fistname not be blank and
minimu 5- maximum 50 characters only allowed.
public class order
{
public int order id;
public string username;
public string firstname;
public string lastname;
}
4.create json structure for
public class order
{
public int order id;
public string username;
public bool active;
}
5.what is difference between hyperlink and link button?
6.where private assembly stored in asp.net?
7.which assembly used for localised resources?
8.postback=true for
a.dropdownlist
b.gridview
c.button
d.all the above
9.how to write a query for to get id,name,managerid,manager name it will have table employee
id int
name varchar(20)
managerid int
10.how to improve performance a table consits of 1000 records to select id,name,sal where designation = somecondition?
11.how to get 3 chatacters of a given telephone number?
5.what is difference between hyperlink and link button?
Ans:The hyperlink will not postback to the servver.it will post a simple request to the server for the url set as navigate url.but link button works exactly as button hyperlink doesn't have an onclick event.
if you need to do any operation with data that's on the page you will have to use a LinkButton (or a Button), but if you just need to redirect the user to somewhere else go for an HyperLink (You will avoid half roundtrip!).