Jeremy Cottino

Il est bien plus beau de savoir quelque chose de tout que de savoir tout d'une chose. [Blaise Pascal]

Brain dump sheet for 70-564 certification

Here are my notes, laid out as a Q&A, for the next exam I am preparing, the last one to become Microsoft Certified Professional Developer (MCPD): ASP.NET Developer 3.5 ...wow ;-)
I have prepared this article using OneNote within SkyDrive. This is by the way an excellent tool to take notes, share them and access them from everywhere and for free.

Q1: What are the different Page directives?
The author of this article gives this definition for Pages Directives:
Asp.Net Page directives are something that is a part of every asp.net pages. Page directives are instructions, inserted at the top of an ASP.NET page, to control the behavior of the asp.net pages. So it is type of mixed settings related to how a page should render and processed.
The reference article on MSDN gives all the details regarding Page Directives.

Q2: What are the different application folders?
Based on this MSDN article, ASP.NET recognizes certain folder names that you can use for specific types of content. The table below lists the reserved folder names and the type of files that the folders typically contain. Following folders can be used:
·         App_Browsers: Contains browser definitions (.browser files)
·         App_Code: Contains source code for utility classes and business objects that you want to compile as part of your application.
·         App_Data: Contains application data files including MDF files, XML files, as well as other data store files.
·         App_GlobalResources: Contains resources (.resx and .resources files) that are compiled into assemblies with global scope
·         App_LocalResources: Contains resources that are associated with a specific page, user control, or master page in an application
·         App_Themes: Contains a collection of files (.skin and .css files...) that define the appearance of ASP.NET Web pages and controls
·         App_WebReferences: Contains files that defines a Web reference for use in an application.(.wsdl , .xsd,.disco and .discomap files)
·         Bin: Contains compiled assemblies (.dll files)

Q3: What is a JSON web service in asp.net?
JSON for JavaScript Object Notation specifies how the Web method return-type is serialized. For your information, the other one is XML.
Using this article and the code given by the author, i made a web service test and play with the result. Here is the result I get while invoking the web service:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">
[["CarNumber1","CarColor1","CarMotor1"],["CarNumber2","CarColor2","CarMotor2"]]
</string>

I am not really sure of the added value of such format… will see...

Q4: What is the difference between a web site and a web application?
Here is what I found when googling this question:
A web site is just a group of all files in a folder and sub folders. There is no project file. All files under the specific folder - including your word documents, text files, images etc. are part of the web site.
You have to deploy all files including source files (unless you pre compile them) to the server. Files are compiled dynamically during run time.
As a conclusion, the author writes:
·         A web site is good for you if you just want to create web sites and share with others. It is ideal for new projects.
·         However, "web application project" is better if you are planning to migrate your Visual Studio 2003 or 2002 web sites into Visual Studio 2005. Otherwise you may end up spending lot of time to exclude unwanted files from your web site folder.
The full article is visible on dotnetspider.com

Q5: What are Session state modes and how to use them?
Session state modes define the way how session state information is stored. Here are the definitions taken from the MSDN article and the main information to remember:
·          InProc mode, which stores session state in memory on the Web server. This is the default.
·          StateServer mode, which stores session state in a separate process called the ASP.NET state service. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
·          SQLServer mode stores session state in a SQL Server database. This ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
·          Custom mode, which enables you to specify a custom storage provider.
·          Off mode, which disables session state.

Q6: What are "Custom Profile Provider" and "Custom Membership Provider"?
For this subject, i also googled and find the following sites that contain definitions and samples:
·         For Profile provider (DavidHayden.com)
·         For Membership Provider (MSDN)

Bonus "question", list of control we should know for this exam, with a link to an MSDN article
·          FormView:
The FormView control is used to display a single record from a data source in a table. When using the FormView control, you specify templates to display and edit bound values. The templates contain formatting, controls, and binding expressions to create the form. The FormView control is often used in combination with a GridView control for master/detail scenarios. This section contains the following topics about the FormView control
·          ListView:
Displays the values of a data source by using user-defined templates. The ListView control enables users to select, sort, delete, edit, and insert records.
·          DataList:
A data bound list control that displays items using templates.
·          Repeater:
A data-bound list control that allows custom layout by repeating a specified template for each item displayed in the list.
·          DetailsView:
Displays the values of a single record from a data source in a table, where each data row represents a field of the record. The DetailsView control allows you to edit, delete, and insert records.

0 commentaires

Some tips on ASP.NET, 70-562 certification cheat sheet

I wanted with this post to give a list of tips around asp.net (as part of my next certification 70-562 TS Microsoft .NET Framework 3.5, ASP.NET Application Development)
The first element ASP.net developer should know is the ASP.net page life cycle. Knowing this area will allow you to correctly initialize controls. Here is a great article on MSDN on the life cycle, which details the following sections:
·         General Page Life-cycle Stages
·         Life-cycle Events
·         Login Control Events

The second point is related to page redirection and page transfer. What is the difference between:
·         Response.Redirect("url");
·         Server.Transfer("url");
·         HttpContext.Current.RewritePath("url");

This article gives a very good comparison between Response.Redirect and Server.Transfer.
As a summary, the author gives the following points:
·         Response.Redirect is more user-friendly, as the site visitor can bookmark the page that they are redirected to.
·         Transferred pages appear to the client as a different url than they really are. This means that things like relative links / image paths may not work if you transfer to a page from a different directory.
·         Server.Transfer has an optional parameter to pass the form data to the new page.
The last option, HttpContext.Current.RewritePath, is cleverly detailed in this article with a very simple to understand example.
The detail of the HttpContext.RewritePath Method is explained in this MSDN article.

The third tip of this post is the difference between #EVAL and #BIND.
In few words, #EVAL is one-way(read-only) and #BIND is a two-way (updatable) binding.
Data-binding expressions are contained within <%# and %> delimiters and use the Eval and Bind functions. The Eval function is used to define one-way (read-only) binding. The Bind function is used for two-way (updatable) binding. In addition to calling Eval and Bind methods to perform data binding in a data-binding expression, you can call any publicly scoped code within the <%# and %> delimiters to execute that code and return a value during page processing.
Very stupid stuff to remember, single-quotes should be used and not double-quotes
<asp:TextBox Runat="server" ID="txtProductName" Text='<%# Bind("ProductName") %>' />

Forth tip, let's discuss about AJAX and the difference between $get and $find
$get is an alias for getElementById. In addition, this function has additional code for those browsers that have not implemented getElementById. (Labels, textboxes are example of elements)
$find is a shortcut for Sys.Application.findComponent. (Widgets like calendars are examples of components)
This excellent article gives a quick summary of the differences:
·         Both, $get and $find, appear return a reference to a DOM object created using mark-up or at runtime
·         Both, $get and $find, appear to return a component reference
·         While both methods work on elements and components, it’s recommended to use $get for elements and $find for components.
2 commentaires

ITIL V3 core volumes and their processes

As part of my exam preparation for ITIL V3 foundation, here is a very simple flowchart that shows all 5 ITIL Core volumes and their processes. Inputs/outputs are also displayed.


This exam will close the 2010 certification season :-), see you next year... MCPD web 3.5 is in the pipe, will see for others...
0 commentaires

SQL Server Edition for Your Needs

What I found on those certifications is some questions around what version of SQL server to use in specific case.
This page, Choose the Right Edition for Your Needs, on the Microsoft website, describes each available version of SQL Server 2008 and their characteristics. I don’t want to re-write this page but in few words, what’s need to be known for the exam is:
·         Core Editions, including Enterprise and Standard edition are used in medium to large company environment. These versions contain advances tools and features
·         Specialized Editions, Workgroup, Web and Developer are departmental solutions; the key word is low-cost solution.
·         SQL Server 2008 Express (Free Edition) Entry level database, ideal for learning and ISV redistribution
·         SQL Server Compact 3.5 (Free Edition) Embedded database for developing desktop and mobile applications
1 commentaires

Change privilege level of a Windows application

As part of my preparation for the first exam, I discovered some features I didn’t know yet. As usual, the best way for me to remember them is to write a short review. Cheat sheet inside...
Today, the subject is: Security and privilege elevation… tada…

I will not care about the WHY this is needed, just about the HOW. By default, any .net application run as current user (invoker) and does not check any security level. Let’s imagine that we have to develop an application that needs to modify registry or add/update files in %ProgramFiles%. The invoker should be part of the local admin group or the application should not start.

This is this new pop up we discovered with Windows Vista and now in Windows 7.


Quick Note:
How to take a screenshot of the User account control pop up? Seems to be a stupid question, but try it and with default configuration, this is not possible. Here is how to do it:
You have to configure UAC to not switch to the secure desktop, and then you'll be able to take a screenshot of the UAC prompt.
Run Secpol.msc as administrator, expand Local Policies, Security Options, policy "User Account Control: Switch to the secure desktop when prompting for elevation", set to "Disabled". It is recommended to revert the changes after you've taken the screenshots.

After this quick note, let’s go back to our business. On your Windows application, add a new file called Application Manifest File. This will create app.manifest.


The default configuration of the manifest below shows: requestedExecutionLevel level="asInvoker", meaning that the application runs with the same privilege as the calling application.
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>

If you want that the application request administrator privilege to be launched, replace the previous config. by the one below, with requestedExecutionLevel level="requireAdministrator"

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
</asmv1:assembly>

Note that with requireAdministrator as the level attribute parameter, the .exe icon changes, note the small windows shield icon.

To summarize, the three different values for the level attribute:
  1. requireAdministrator: The application must be started with Administrator privileges; it won't run otherwise.
  2. highestAvailable: The application is started with the highest possible privileges.  If the user is logged on with an Administrator account, an elevation prompt appears. If the user is a Standard User, the application is started (without any elevation prompt) with these standard privileges.
  3. asInvoker: The application is started with the same privileges as the calling application.

21 commentaires

Certification season is open

Autumn seems to be certification season for me. After successfully pass the 70-433 - SQL Server 2008 database development certification, my new challenges come to Windows forms using .Net framework 3.5.

The first one will be 70-505 Microsoft .NET Framework 3.5, Windows Forms Application Development









Then 70-536 Microsoft .NET Framework - Application Development Foundation

And finally if I still have energy 70-563 PRO Designing and Developing Windows Applications Using the Microsoft .NET Framework 3.5









After that I could be MCPD :P

Because for me the easiest way to remember something is to write it, following posts will be dealing with some parts of those certifications that I have trouble to remember.
For those who love the "For dummies"  book cover, you can create your own here.
0 commentaires

Explained to myself, what is Twitter?

I have created my Twitter account few days ago and did not really find the "Good" way to use it.
I found this free webinar from ITMPI about "Using Twitter in the Enterprise". As it was quite interesting, let me share some resources around Twitter.
This webinar was presented by Edward Yourdon (Find him on Wikipedia, or on his blog). Slides of this presentation can be donwloaded here.

Let's start with a nice video that present Twitter called Twitter in plain English.


Amongs many other, here are some Twitter client-based programs:
  • Seesmic: presented as the best Twitter client for Desktop, Web and Mobile, manage multiple Twitter accounts, Facebook feeds and pages and access Twitter Lists.
  • Twhirl: a desktop client for the Twitter microblogging platform, powered by Adobe AIR
  • TweetDeck: a simple and fast way to experience Twitter
  • Tweetie: An iPhone/iPad client.
Some articles:
Also some tools that can be usefull (honestly, i did not try any so...)
  • TweetStats: In ur Tweets, Graphin' Your Stats!
  • TweetCube allows you to share files on Twitter
  • Displayed as a cloud, tweetclouds: Quickly view 'what's being said' across the Twittersphere
  • Twitterfone to... guess what, microblog over mobile phone.
0 commentaires