Skip to main content

ASP.NET Questions

Why are you more likely to use HtmlControls rather than WebControls when migrating from ASP?
Choice 1
ASP pages are made from HTML elements, not controls, which map to the HtmlControls better.
Choice 2
HtmlControls involve less development effort.
Choice 3
HtmlControls have the same syntax as ASP HtmlControls.
Choice 4
HtmlControls can be used to transfer ASP session state.
Choice 5
ASP also uses HtmlControls.

In a Web application, how many security-related events does the global.asax file provide?
Choice 1
1
Choice 2
2
Choice 3
3
Choice 4
4
Choice 5
More than 4

Why does the Page object have an IsPostback property?
Choice 1
It is used to know that control events need to be thrown.
Choice 2
It is used in the Application_BeginRequest event to decide whether to authenticate a user.
Choice 3
It is used so that the Page can determine whether to load Viewstate.
Choice 4
It is used to determine whether to throw the Page_PostBack event.
Choice 5
It is used so that the controls can be loaded with their initial state when the page is first loaded.
ASP.NET Fundamentals, Question 10 of 40

A relationship between two DataTables within a DataSet is represented by which one of the following?
Choice 1
ForeignKey object
Choice 2
DataColumn object
Choice 3
DataTable object
Choice 4
PrimaryKey object
Choice 5
DataRelation object

Which one of the following do you use to add a new cookie to store a 'LastVisit' date with the current time?
Choice 1
Response.Cookies.Add( new HttpCookie("LastVisit", DateTime.Now.ToString()) );
Choice 2
Response.Cookies.Add( new Cookie("LastVisit", DateTime.Now.ToString()) );
Choice 3
Response.Add( new Cookie("LastVisit", DateTime.Now.ToString()) );
Choice 4
Response.Cookies.Add( new HttpCookie("LastVisit", DateTime.Now) );
Choice 5
Response.Add( new HttpCookie("LastVisit", DateTime.Now.ToString()) );


Assuming viewstate is enabled, what is wrong with the above code?
Choice 1
You need to check IsPostBack and bind the data only once.
Choice 2
The OnClick event fires before the Page_Load event.
Choice 3
The OnClick event does not fire until after the code is rendered.
Choice 4
The OnClick event will NEVER fire.
Choice 5
You cannot bind data in the Page_Load event.


Which object do you use as a means of reading a forward-only stream of rows when connecting to SQL Server 2000 database?
Choice 1
SqlServerDataAdapter
Choice 2
OleDbDataReader
Choice 3
SqlDataAdapter

Choice 4
OleDbDataAdapter
Choice 5
SqlDataReader


What line in the above control needs to be added for Wednesday to be selected by default?
Choice 1

Choice 2

Choice 3

Choice 4

Choice 5




Which server setting must be set in order to be able to store objects outside of a page in an application?
Choice 1
Enable application storage
Choice 2
Enable variable storage
Choice 3
Enable server-side variables
Choice 4
Enable session state
Choice 5
Enable Web forms



Under which one of the following situations is using a class inheriting from System.IO.Stream NOT appropriate?
Choice 1
Sending information across a network
Choice 2
Manipulating an XML DOM
Choice 3
Saving a file to disk
Choice 4
Loading a file from disk
Choice 5
Implementing a pipe
ASP.NET Fundamentals



Sample Code

For the code referenced above to work correctly in your application, in which one of the following directories does the compiled DLL from the file MyPage.aspx.cs need to be?
Choice 1
The same directory as the .aspx file calling it
Choice 2
The Web root for the application
Choice 3
/bin directory of the application
Choice 4
The Web root for the site
Choice 5
The directory named support

Comments

Popular posts from this blog

Task Parallel Library (TPL) and Akka.NET: Differences

Task Parallel Library (TPL) and Akka.NET are both powerful tools in the .NET ecosystem for handling parallelism and concurrency, but they serve different purposes and use different models of computation. Here are some key differences:s 1.    Actor Model vs Task-Based Model: Akka.NET is built around the actor model, where actors are the fundamental units of computation and they communicate by exchanging messages. TPL, on the other hand, is task-based. It's designed to make developers more productive by simplifying the process of adding parallelism and concurrency to applications. TPL uses tasks (which are independently executing work units) and provides various ways to control and coordinate them. 2.    Fault Tolerance: One of the key features of Akka.NET is its built-in fault tolerance. It has a "let-it-crash" philosophy, where the system is designed to self-heal from errors. If an actor fails, its parent actor can decide on the supervision strategy: either to resta

Extension Methods - Advanced

Here we will see how can we use the Extension Methods in advanced manner in other types Imagine you often need to retrieve items from a List based on a custom criterion that the built-in LINQ methods don't cover. Extension Methods for Lists: Filtering based on Custom Criteria And the output would be   Extending Enums: Displaying Descriptive Strings Output: Extending DateTime: Calculating Age     Output: The code samples can be found at https://github.com/oneananda/C_Sharp_Examples/tree/main/ExtensionMethods