ComputerAsp.Net And Web Development With C Sharp MCQs
Practice Asp.Net And Web Development With C Sharp MCQs for competitive exams.
Asp.Net And Web Development With C Sharp MCQs
Practice questions from this topic.
In ASP.NET Core MVC, what is the purpose of the appsettings.json file?
- A. It handles HTTP requests and responses
- B. It defines routing rules
- C. It stores application configuration settings
- D. It manages session data
Correct Answer: C
What is the purpose of the RedirectToAction method in ASP.NET MVC?
- A. It returns a view with a specific model
- B. It performs input validation
- C. It redirects the client to another action method
- D. It handles AJAX requests
Correct Answer: C
Which HTTP status code indicates that the requested resource has been successfully created?
- A. 404 Not Found
- B. 400 Bad Request
- C. 201 Created
- D. 204 No Content
Correct Answer: C
What does CSRF stand for in web development?
- A. Cross-Site Resource Framework
- B. Cross-Site Response Forgery
- C. Cross-Site Request Forgery
- D. Cross-Site Request Framework
Correct Answer: C
What is the purpose of the @section directive in ASP.NET Core Razor views?
- A. To handle HTTP requests and responses
- B. To define routing rules
- C. To manage session data
- D. To define content that can be overridden by child views
Correct Answer: D
In ASP.NET MVC, what is the purpose of the ViewData dictionary?
- A. To pass data between the controller and the view
- B. To manage session data
- C. To define routing rules
- D. To handle HTTP requests and responses
Correct Answer: A
What is the default HTTP method used in an HTML form?
- A. POST
- B. PUT
- C. DELETE
- D. GET
Correct Answer: D
What is the purpose of the tag in HTML?
- A. To create hyperlinks
- B. To define server-side C# code
- C. To define client-side JavaScript code
- D. To style HTML elements
Correct Answer: C
In ASP.NET MVC, what is the purpose of the ViewResultBase class?
- A. It defines routing rules
- B. It represents the result of an action that returns a view
- C. It handles HTTP requests and responses
- D. None of the above
Correct Answer: B
What is the purpose of the AuthorizeAttribute in ASP.NET Web API?
- A. It manages session data
- B. It defines routing rules
- C. It restricts access to authorized users
- D. It handles HTTP requests and responses
Correct Answer: C
Which of the following is NOT a valid Razor syntax in ASP.NET MVC?
- A. @{ }
- B. @model
- C. @RenderBody()
Correct Answer: D
In ASP.NET Core, what is the purpose of the appsettings.json file?
- A. It handles HTTP requests and responses
- B. It defines routing rules
- C. It manages session data
- D. It stores application configuration settings
Correct Answer: D