Question Multiple Choices
Question Multiple Choices
A. You have an online diary with two form fields, a title, and a large subject box. A title is
not required, and the subject content is stored in a database column with no maximum size.
B. The web application you maintain has an area that serves as a pass-through to another
company’s web services. The form contains personal information, such as address and phone
number, and is used to set up a profile on the company’s retirement partner website. The partner
has never given you any instructions as to what is or is not required to be sent to them.
C. Your application is a long wizard that college students use to apply for financial aid.
They do not have access to the application until they are already logged on to the system so the
application knows who they are. Most students will log on many times to finish the application,
so any field might or might not be completed at any time.
D. You are developing a simple form that helps home brewers keep track of their process.
The form provides two input fields: Date/time and ph level. The Date/time box needs to be an
ordinary text box because people around the world might enter the date differently, in a way
that is meaningful to them. The ph level can be either a numeric value or a text description.
Answer:
ABCD
Explanation
A. Correct: You should build in validation to check that at least one field has been
populated before saving an entry.
B. Correct: Although the partner company has not provided any requirements, your
company is responsible for data entry and therefore should ensure that the data passing
through the application meets some minimum criteria.
C. Correct: The application has many entry fields so it is difficult to predict when an
entry hits a valid stage. However, you already know you have constraints on the data
being input because of the size of the database columns in which you will be storing
them. A MaxLength validator on each field would help ensure that there is no loss of
data.
D. Correct: Although either field in the form can be anything, they should have a
maximum length limit imposed so the data does not exceed the size of the database
column they will be stored in. You should also validate that neither field is empty.
You want to support the Internet Explorer, Firefox, and Opera web browsers in your application.
Which vendor-specific extensions do you need to include with CSS3 properties? (Choose all that
apply.)
A. -webkit-
B. -ms-
C. -o-
D. -hp-
E. -moz-
Hide Answer
Answer:
BCE
Explanation
A. Incorrect: The -webkit- prefix is used for Google Chrome and Apple Safari.
B. Correct: The -ms- prefix is used for Internet Explorer.
C. Correct: The -o- prefix is used for the Opera browser.
D. Incorrect: The -hp- prefix is used by Hewlett-Packard.
E. Correct: The -moz- prefix is used for Mozilla Firefox.
2. You are creating an ASP.NET MVC web application. The application accepts phone
number input through the application’s form. When viewing the source from a browser,
you find the following code:
</div>
Answer:
D
Explanation
A. Incorrect: The Value construct sets the display information in the element. In addition, the
field is not bound to the model.
B. Incorrect: This will not validate or set the size requirement.
C. Incorrect: This will make the input field display with a placeholder.
D. Correct: This is the proper way to limit the size of a certain field that is being bound to the
model.
3. You are creating an ASP.NET MVC web application. Within the application, you have
created a partial view for contact email and phone number. Which code segment should
you use to display the partial view on the main page?
A. <div class="float-right">
<section id="contact">
@Html.ActionLink("ContactPartial")
</section>
</div>
B. <div class="float-right">
<section id="contact">
@Html.Partial("ContactPartial")
</section>
</div>
C. <div class="float-right">
<section id="contact">
@RenderPage("ContactPartial")
</section>
</div>
D. <div class="float-right">
<section id="contact">
@RenderBody("ContactPartial")
</section>
4. You are designing an HTML5 website. You need to design the interface to make the
content of the web page viewable in all types of browsers, including voice recognition
software, screen readers, and reading pens. What should you do? (Each correct answer
presents a complete solution. Choose all that apply.)
A. Annotate HTML5 content elements with Accessible Rich Internet Application (ARIA)
attributes.
B. Convert HTML5 forms to XForms.
C. Ensure that HTML5 content elements have valid and descriptive names.
D. Use HTML5 semantic markup elements to enhance the pages
E. Use Resource Description Framework (RDF) to describe content elements throughout the
entire page.
5. You are developing an ASP.NET MVC application and you need to create satellite
assemblies from resource files. What code should you use?
Razor View Engine ASPX View Engine (Web form view engine)
The namespace used by the Razor The namespace used by the ASPX View Engine is
View Engine is System.Web.Mvc.WebFormViewEngine
System.Web.Razor
The file extensions used by the The file extensions used by the Web Form View Engines
Razor View Engine are different are like ASP.Net web forms. It uses the ASPX extension to
from a web form view engine. It view the aspc extension for partial views or User Controls
uses cshtml with C# and vbhtml
with vb for views, partial view, or templates and master extensions for layout/master
templates and layout pages. pages.
The Razor View Engine is an A web form view engine is the default view engine and
advanced view engine that was available from the beginning of MVC
introduced with MVC 3.0. This is
not a new language but it is
markup.
Razor has a syntax that is very The web form view engine has syntax that is the same as
compact and helps us to reduce an ASP.Net forms application.
typing.
The Razor View Engine uses @ The ASPX/web form view engine uses "<%= %>" or "<%:
to render server-side content. %>" to render server-side content.
By default all text from an @ There is a different syntax ("<%: %>") to make text HTML
expression is HTML encoded. encoded.
Razor does not require the code A web form view engine requires the code block to be
block to be closed, the Razor closed properly otherwise it throws a runtime exception.
View Engine parses itself and it is
able to decide at runtime which is
a content element and which is a
code element.
The Razor View Engine prevents A web form View engine does not prevent Cross Site
Cross Site Scripting (XSS) Scripting (XSS) attack.
attacks by encoding the script or
HTML tags before rendering to
the view.
The Razor Engine supports Test Web Form view engine does not support Test Driven
Driven Development (TDD). Development (TDD) because it depends on the
System.Web.UI.Page class to make the testing complex.
Razor uses "@* … *@" for The ASPX View Engine uses "<!--...-->" for markup and
multiline comments. "/* … */" for C# code.
There is only three transition There are only three transition characters with the Razor
characters with the Razor View View Engine.
Engine.
The Razor View Engine is a bit slower than the ASPX View Engine.
6. If the multiple filters are implemented in mvc in which order the filter execute
Authorization filters
Action filters
Response filters
Exception filters
7. Your application manages the sale of expensive well-drilling equipment. Your IT director
wants you to add functionality that sends an email to a customer’s sales account manager
whenever someone from your client company logs in to the system. What is an
appropriate solution?
A. Override the AuthorizeAttribute and apply it to the login action. Run the base method
first to handle the authentication and then evaluate the status of the request. If the user is a
customer, send the email.
B. Create a custom action filter that is globally defined and overrides the
OnActionExecuting method. This action filter evaluates the status of the user and sends the
email if it is a customer.
C. Override the AuthorizeAttribute that is applied to the login action, check for the user’s
authentication status, and determine whether it is a customer prior to sending it to the base
authentication method.
D. Create an action filter that overrides the OnActionExecuted method and apply it to the
login action. This action filter evaluates the status of the user and sends the email if it is a
customer.
Hide Answer
Answer:
D
Explanation
A. Incorrect: You should not have an AuthorizeAttribute on your login action, because it ensures
that users have to be authenticated before they log in. Users can never log in to the site.
B. Incorrect: Because this filter is applied globally, it sends the email every time the user takes
an action, rather than just once per visit.
C. Incorrect: You should not have an AuthorizeAttribute on your login action because it ensures
that users have to be authenticated before they log in. Users can never log in to the site.
D. Correct: This is be applied only because the user is leaving the login section of the
application, at which point you also know whether they have been authenticated.
A. SecurityToken
B. SecurityTokenHandler
C. SWTToken
D. Saml2SecurityTokenHandler
Hide Answer
Answer:
B
Explanation
A. Incorrect: SecurityToken is the .NET Framework class that identifies the token.
B. Correct: SecurityTokenHandler is the appropriate class to override for creating a custom token handler.
C. Incorrect: SWTToken is a type of common token.
D. Incorrect: Saml2SecurityTokenHandler is a specific handler for a specific type of token.
10. In your ASP.NET web application you want to display a list of clients on a Web page.
The client list displays 10 clients at a time, and you require the ability to edit the clients.
Which web control is the best choice for this scenario?
Options
- The DetailsView control
- The Table control
- The GridView control
- The FormView control
CORRECT ANSWER : Returns the physical file path that corresponds to virtual
specified path
14. ______________ element in the web.config file to run code using the permissions of a
specific user
Options
- < credential> element
- < authentication> element
- < authorization> element
- < identity> element
CORRECT ANSWER : Disable View State and don't use session state
16. Which of these data source controls do not implement Caching?
Options
- LinqDataSource
- ObjectDataSource
- SqlDataSource
- XmlDataSource
Q:
(1 point) Which of the following is TRUE of shapefiles? Is a very commonly-
used raster data structure . Actually consists of two files-one.shp file and one .mta file Can
only store polygonal data, i.e. "shape files.. Does not store topological information. Is an
essential element for using DEMs in a GIS Question 9 (1 point) In
general, which of the following is almost always TRUE about
vector data vs raster data of exactly the same area Select
A:
8- does not stores topological informations . Spac...
See solution
Q:
Which of the following is not true about Rasters? a. All rasters are images, but not all
images are considered rasters. b. A raster is the data model that describes how an
image is stored. c. All images are rasters, but not all rasters are considered images.
d. Raster and image are two terms that are often interchanged.
A:
Option c) is not true for rasters because all imag...
See solution
Q:
8. Which oster data structure stresser data amatrix and write the cell values into d. All of
the above e. Only (a) and (b) 7. Which of the following objects is not part of the
vector data model in GIS? a point bline ca d volume file by row and column? a cell by cell
b. run length code c. quad tree d. none of the above 9. Which raster data structure stores
the cell values by row and by group? a cell by cell b run length code c. quadtree 10
A:
7 volume Because points, lines, polygons are par...
See solution
Q:
3. Describe the differences between raster and vector based data. Give one example
of data that is typically in raster structure and another example that is typically in
vector structure. Explain why raster format is less accurate and do not reflect either the
nature of geographical features.
A:
See solution
Q:
1. Which data model is used to define the scope of requirements for a database?
Physical Data Model Conceptual Data Model Logical Data Model Enterprise Data Model
2. Which data type specifically supports storing coordinates on a round earth? BLOB
Geometry Raster Geography Which data type specifically supports storing objects such as
points, lines and surfaces? BLOB Geometry Raster Geography 4The body of a Facebook
post is a.Unstructured
A:
Dear Student , As per the requirement submitted ab...
See solution
Q:
Qusetion #1 20% a) Compare between raster and vector data models according
to the following Vector Raster Data Structure Storage requirements Network analysis
Attribute precision Topology b) State five different methods that used for
spatial data capturing.
A:
See solution
Q:
Which of the following is an advantage for raster data compared to vector data in storing
spatial data? a. Vector data must have gaps between features b. Raster cells can capture
variation of spatially continuous phenomena better than vector shapes c. Raster cells are
flexible in shape and size d. Vector shapes require large storage space e. Rasters can map
only one thematic variable
A:
B), Raster cells can capture variation of spatiall...
See solution
Q:
1. Which of the following is a format for storing raster data ? a) Topology b) Spatial
reference c) Geocoding d) Cell encoding 2. By applying the reclassification operator
to a raster layer, a GIS analyst may: a) assigen new values to existing cells b) increase or
decrease the total number of classes c) reduce the total number of raster cells d) all of the
above 3. Which of the following is true for a raster data structure ? a) a 2m grid has
A:
1. d) cell encoding 2.d) all of the above 3. c) Th...
See solution
Workout
1. You are developing an ASP.NET MVC application that takes customer orders.
Orders are restricted to customers with IP addresses based in the United States.
You need to implement a custom route handler. How should you implement the
route handler? (To answer, drag the appropriate line of code to the correct
location or locations. Each line of code may be used once, more than once, or not
at all. You may need to drag the split bar between panes or scroll to view content.)
IHttpHandler
IRouteFactory
IRouteHandler
IHttpContraint
RequestContext
ServerContext
{
public
GetHttpHandler(
requestContext) {
return new USIPHandler(requestContext)
}
Hide Answer
Answer:
IRouteFactory
IHttpContraint
ServerContext
[DataObjectMethod(DataObjectMethodType.Select)]
public List<Employee> GetAllEmployee()
{
using (var ctx = new MyEntity())
{
var x = from y in ctx.Employees
select y;
return x.ToList();
}
}
I can delete a particular record if for example I assign y.EmployeeName == "Harold Javier" to the
Delete method above, but when I assign y.EmployeeId == z.EmployeeId to the above code, the
delete doesn't work. (Note: EmployeeId is the primary key of the Employee table)
public class BaseEmployee
{
public int Id;
public string Name;
}
Console.Write("Employee Name:");
employeeDetail.Name = Console.ReadLine();
Console.Write("Employee Address:");
employeeDetail.Address = Console.ReadLine();
return employeeDetail;
bool p = true;
while (p)
{
switch (Option)
{
case 1:
arraylist.Add(employeeDetails.Add());
break;
case 4:
foreach (Object obj in arraylist)
{
break;
case 3:Console.Write("Enter Employee Id:");
int EId = int.Parse(Console.ReadLine());
foreach(Object obj in arraylist)
{
Employee emp = obj as Employee;
if(EId==emp.Id)
{
arraylist.Remove(emp.Id);
arraylist.Remove(emp.Name);
arraylist.Remove(emp.Address);
}
}
break;
}
}
}
}
3.
How will you maintain the sessions in MVC?
The sessions of an MVC can be maintained by 3 possible ways:
1. ViewBag
The ViewBag is a dynamic type property of ControllerBase class which is the base class
of all the controllers. It’s a dynamic wrapper around ViewData casting is not required
when you use ViewBag. ViewBag only transfers data from controller to view, not visa-
versa. ViewBag values will be null if redirection occurs.
ViewBag support any number of properties or values. if same value found then it will only
consider last value assigned to the property.
2. TempData
TempData internally uses session variable and stays for a subsequent HTTP Request. This means
it maintains data when you move one controller to another controller or one action to another
action. As this is a dictionary object null checking and typecasting is required while using it.
Below example shows how to retrieve and put data from or into tempdata both in controller and
view .
1. ViewData is a dictionary of objects that is derived from ViewDataDictionary class and is accessible
using strings as keys.
2. ViewBag is a dynamic property that takes advantage of the new dynamic features in C# 4.0.
3. ViewData requires typecasting for complex data type and check for null values to avoid error.
4. ViewBag doesn’t require typecasting for complex data type.
C#
Copy Code
public ActionResult Index()
{
ViewBag.Name = "Monjurul Habib";
return View();
}
C#
Copy Code
public ActionResult Index()
{
ViewData["Name"] = "Monjurul Habib";
return View();
}
In View:
C#
Copy Code
@ViewBag.Name
@ViewData["Name"]
TempData:
TempData is also a dictionary derived from TempDataDictionary class and stored in short lives session
and it is a string key and object value. The difference is the life cycle of the object. TempData keeps the
information for the time of an HTTP Request. This mean only from one page to another. This also works with
a 302/303 redirection because it’s in the same HTTP Request. It helps to maintain data when you move from
one controller to other controller or from one action to other action. In other words, when you redirect,
“Tempdata” helps to maintain data between those redirects. It internally uses session variables. Temp data use
during the current and subsequent request only means it is used when you are sure that next request will be
redirecting to next view. It requires typecasting for complex data type and check for null values to avoid error.
It is generally used to store only one time messages like error messages, validation messages.
C#
Copy Code
public ActionResult Index()
{
var model = new Review()
{
Body = "Start",
Rating=5
};
TempData["ModelName"] = model;
return RedirectToAction("About");
}
C#
Copy Code
public ActionResult About()
{
var model= TempData["ModelName"];
return View(model);
}
The last mechanism is the Session which works like the ViewData, like a Dictionary that takes a string for
key and object for value. This one is stored into the client Cookie and can be used for a much more long time.
It also needs more verification to never have any confidential information. Regarding ViewData or ViewBag,
you should use it intelligently for application performance. Because each action goes through the whole life
cycle of regular ASP.NET MVC request. You can use ViewData/ViewBag in your child action, but be
careful that you are not using it to populate the unrelated data which can pollute your controller.
Workout part 2
1. what is bundling and minification in mvc?
Both bundling and minification are the two separate techniques to reduce the load time. The bundling
reduces the number of requests to the Server, while the minification reduces the size of the requested
assets.
Bundling
To improve the performance of the application, ASP.NET MVC provides inbuilt feature to bundle
multiple files into a single, file which in turn improves the page load performance because of
fewer HTTP requests.
Bundling is a simple logical group of files that could be referenced by unique name and loaded
with a single HTTP request.
Minification
Answer
A Web Map Service (WMS) defines an interface that allows a client to get maps of
geospatial data and gain detailed information on specific features shown on the map. A
"map" is defined here as a visual representation of geospatial data, not the geospatial data
itself.
A Web Feature Service (WFS) allows a client to perform data manipulation operations on one or
more geographic features. Data manipulation operations include the ability to Get or Query
features based on spatial and non-spatial constraints, Create a new feature, Modify a feature, or
Delete a feature.
3. Imagine that you want to develop spatially enabled dynamic website using open
software. mention which software you use to manage your spatial data coverage
explain their use?
Applications frequently take external input (from a user or another external agent) and
perform actions based on that input. Any input that is directly or indirectly derived from
the user or an external agent might have content that uses the syntax of the target
language in order to perform unauthorized actions. When the target language is a
Structured Query Language (SQL), such as Transact-SQL, this manipulation is known as a
SQL injection attack. A malicious user can inject commands directly into the query and
drop a database table, cause a denial of service, or otherwise change the nature of the
operation being performed.
SQL injection attacks can be performed in Entity SQL by supplying malicious input
to values that are used in a query predicate and in parameter names. To avoid the
risk of SQL injection, you should never combine user input with Entity SQL
command text.
Entity SQL queries accept parameters everywhere that literals are accepted. You
should use parameterized queries instead of injecting literals from an external
agent directly into the query. You should also consider using query builder
methods to safely construct Entity SQL.