These are some of the Very Important Questions that you come across in your ASP.NET MVC or ASP.NET programming life.

1. How to check an element is visible or not using jQuery

Answer: Use Jquery : visible selector
if($("p").is(":hidden")){}
if($("div").is(":hidden")){}

2. How to select an element by name with jQuery?

Answer: This can be acheived by two ways.
WAY 1: by using jquery selector.
Example1: with id $("#foo") Selects all elements with the id="foo".
Example2: SELECTS ALL ELEMENTS $("*") Selects all elements
Example3: SELECTS ALL ELEMENTS WITH CLASS=BAR $(".bar") Selects all elements with class=bar.
Example4: SELECT ALL P ELEMENTS $("p") Selects all P elements
Example5: SELECT P ELEMENTS WITH BAR CLASS $("p.bar") Selects all elements with the id="foo".
WAY 2: GET ELEMENT BY NAME USING JAVASCRIPT AND PASS IT TO JQUERY selector = document.getElementsByName('nameOfElement'); element = $(selector); eg:- If you want to show or hide an element , then simply do like this element.hide() or element.show()

3. How to add text to an existing div with jquery

Answer: var a = "Hello USMTECHWORLD"; $('#dvscore').before(a);

5. What are the different development environments in your company?

Answer:
It is a very general question asked in any software company.Here they want to test whether you really know about software development process. Ok let us come into the question , what are different environments in your company. Normally all the companies will have following environments.


Development: QA or Staging Environment: Production:

6. How to add jquery file in View of ASP.Net MVC

Answer:
<script src="~/Scripts/jquery-1.10.2.js">
@Scripts.Render("~/Scripts/somesamples.js")
Inside the somesamples.js file, you can write all the jquery scripts related to your ASP.NET MVC view.

7. How to Load country,state and city in dropdownlist of ASP.Net MVC with server hitting one time and after that based on country selection the state should load and upon state selection city should be loaded.

This is viewers choice : mail to :usmtechworld@gmail.com

8. How do i use indentation in code tag of HTML?
public actionresult index()
{
Country objcountry = new Country();
objcountry.countrylist = PopulateCountries();
return View(objcountry);
}
In the above code i have used br tag to the code block,to display each line of the code in next line.

        public actionresult index()
        {
        Country objcountry = new Country();
        objcountry.countrylist = PopulateCountries();
        return View(objcountry);
        }
    
You can use the "pre" tag, which defines preformatted text. Text in a "pre" element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks. It is used when displaying text with unusual formatting, or some sort of computer code. And you will not need additional "br" tags.

9. Tell me the difference between design pattern,architecture and architecture style?

Answer:
By simply telling about this examples, you can easily understand about the difference between Design pattern, Architecure and Architecture style.
Design Patterns :- Decorator,Singleton, Factory,Adapter is Design patterns.
Architecture Pattern :- MVC,MVVM is architecture pattern.
Architecture Style:- REST,Service Oriented is architecture style.

10. How to set default route to an Area in ASP.NET MVC?

Answer:
You need to add DataToken to Default Route, in order to make your area as default route in route.config. for eg:- You have seperate area for login related files and want to be your default route during your application startup.

              routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { area= "Login", controller = "Login", action = "Index", id = UrlParameter.Optional }
            ).DataTokens.Add("area","Login");

11. What is the difference between REACT and ANGULAR?

Answer:
The major difference between REACT and ANGULAR.