Q61
Q61 How can you enable ViewState for a TextBox control in ASP.NET?
TextBox.EnableViewState = true;
TextBox.ViewState = true;
TextBox.SaveState = true;
TextBox.PersistState = true;
Q62
Q62 How do you remove an item from Session State in ASP.NET?
Session.Remove("key");
Session.Delete("key");
Session.Clear("key");
Session.Erase("key");
Q63
Q63 How can you inspect the contents of Session State while debugging?
Using the Visual Studio debugger
Using browser developer tools
Using Fiddler
Using Postman
Q64
Q64 What tool can you use to debug issues with cookies in an ASP.NET application?
Visual Studio Debugger
Browser Developer Tools
Route Debugger
SQL Profiler
Q65
Q65 What is ADO.NET used for in ASP.NET?
Managing user sessions
Handling HTTP requests
Accessing and manipulating data in databases
Managing application settings
Q66
Q66 Which object in ADO.NET is used to hold a table of data in memory?
DataReader
DataSet
DataTable
DataAdapter
Q67
Q67 What is the purpose of the SqlCommand object in ADO.NET?
To store data in memory
To execute SQL queries and commands
To connect to the database
To manage transactions
Q68
Q68 Which method of the SqlCommand object is used to execute a SELECT query?
ExecuteScalar()
ExecuteNonQuery()
ExecuteReader()
ExecuteCommand()
Q69
Q69 What is the purpose of the ConnectionString in ADO.NET?
To specify the database schema
To define the structure of the DataSet
To provide the necessary information to connect to a database
To manage transactions
Q70
Q70 What is Entity Framework in ASP.NET?
A database management tool
A client-side scripting framework
An ORM (Object-Relational Mapper)
A server-side state management tool
Q71
Q71 How do you open a database connection using SqlConnection in ADO.NET?
connection.Start();
connection.Open();
connection.Connect();
connection.Begin();
Q72
Q72 How do you execute a non-query SQL command using SqlCommand in ADO.NET?
command.ExecuteNonQuery();
command.RunCommand();
command.ExecuteCommand();
command.RunNonQuery();
Q73
Q73 How do you retrieve a single value from a database using SqlCommand?
command.ExecuteScalar();
command.ExecuteSingle();
command.ExecuteValue();
command.ExecuteCommand();
Q74
Q74 Which tool can be used to profile database queries in ASP.NET?
Fiddler
Postman
SQL Profiler
Browser Developer Tools
Q75
Q75 How can you handle database connection errors in ADO.NET?
By using try-catch blocks
By using error pages
By using validation controls
By using logging libraries
Q76
Q76 What is the purpose of Forms Authentication in ASP.NET?
To manage user roles
To encrypt data
To authenticate users based on credentials
To manage sessions
Q77
Q77 What is the role of the Web.config file in ASP.NET security?
To store user credentials
To configure security settings
To manage database connections
To handle error pages
Q78
Q78 What is Cross-Site Scripting (XSS) in the context of web security?
An attack that involves injecting malicious scripts into a website
A method for encrypting data
A technique for optimizing web performance
A way to manage user sessions
Q79
Q79 What is the primary purpose of using SSL/TLS in web applications?
To improve page load speed
To secure data transmission
To enhance SEO
To manage cookies
Q80
Q80 What is SQL Injection and how can it be prevented in ASP.NET?
A method to speed up SQL queries; Use faster hardware
A technique to manipulate SQL queries; Use parameterized queries
A way to manage database schema; Use database triggers
A process to optimize SQL performance; Use indexing
Q81
Q81 Which ASP.NET feature helps in preventing CSRF attacks?
ViewState
Cookies
Request Validation
Anti-Forgery Tokens
Q82
Q82 How do you enable SSL for an ASP.NET web application?
By setting the "requireSSL" attribute in the Web.config file
By setting the "secure" attribute in the Global.asax file
By using the [RequireSSL] attribute in the Controller
By setting the "https" attribute in the RouteConfig
Q83
Q83 How do you implement role-based authorization in ASP.NET MVC?
Using the [Authorize] attribute with roles
Using the [Roles] attribute
Using the [Allow] attribute
Using the [Permissions] attribute
Q84
Q84 How do you hash passwords in ASP.NET Identity?
Using the SHA1 class
Using the MD5 class
Using the PasswordHasher class
Using the Cryptography class
Q85
Q85 Which tool can be used to scan for security vulnerabilities in an ASP.NET application?
Fiddler
Postman
OWASP ZAP
Route Debugger
Q86
Q86 How can you handle exceptions securely in an ASP.NET application?
By showing detailed error messages
By logging errors and showing generic error pages
By ignoring errors
By redirecting to a static page
Q87
Q87 What is the primary purpose of ASP.NET Web API?
To create dynamic web pages
To build RESTful services
To manage databases
To handle client-side scripting
Q88
Q88 Which HTTP method is used to retrieve data in Web API?
GET
POST
PUT
DELETE
Q89
Q89 What is the default return format of Web API when a request is made?
XML
JSON
HTML
Plain text
Q90
Q90 Which attribute is used to define a route in Web API?
[Route]
[HttpGet]
[WebRoute]
[ApiRoute]