Asp.Net interview questions and answers for 2-5 years experienced

Dear readers, I am writing this article after facing more than 100+  Asp.Net Interviews these Questions have been designed specially to get you acquainted with the nature of questions you may encounter during your interview for the subject of Asp.Net, Asp.Net MVC, C#,OOPS concept,SQL and jQuery. Ques 1) Difference between Abstract class and Interface ? […]

Read More

How To Use Log4Net In MVC to Track Error

LOG4NET Before showing what Log4Net is I would like to  explaing what logging actually is. Logging In computing, a logfile is a file that records either events that occur in an operating system or in a programme or when a software runs. Logging is the act of keeping a log. Or we can say, logging […]

Read More

Deploying website: 500 – Internal server error

Firstly, you need to check the customErrors mode is on or off if its off then change it to on and see the detailed errors message of your web page, because its return a general error message without giving information on what’s really happening for security reasons. With the detailed error message, you can locate […]

Read More

How can I get Id of inserted entity in Entity framework?

It is pretty easy. If you are using DB generated Ids (like IDENTITY in MS SQL) you just need to add entity to ObjectSet and SaveChanges on related ObjectContext. Id will be automatically filled for you: using (var context = new MyContext()) { context.MyEntities.AddObject(myNewObject); context.SaveChanges(); int id = myNewObject.Id; // Yes it’s here } Entity […]

Read More

How to get Value from usercontrol to aspx page in Javascript

In this post i will show how to get value of a textbox of user control in Asp.net page where that user control is registered.This question is asked in my many interview so come to the example lets first create a user control with the name of Test.  <%@ Control Language=”C#” AutoEventWireup=”true” CodeFile=”Test.ascx.cs” Inherits=”Test” %> […]

Read More

Sort an Array in Ascending order

An array can be sort via simple inbuilt Sort() method or Linq. But in this post i will show you how to sort an array in ascending order without using any inbuilt function and linq. Example: class Program { static void Main(string[] args) { Console.WriteLine(“\n Enter the Numbers : “); int[] arr = new int[5]; string arr1 […]

Read More