Archive | PRO ASP.NET 70-564 RSS for this section

Create a Vendor-Independent Data Access Class

Vendor independent or provider agnostic data access is a relatively easy thing to implement, thanks to the structure of ADO.NET. You’ll find the classes you’d need in the System.Data.Common namespace.

To access data without knowing the provider type, you’d start in your web.config, by adding these entries to it:

<connectionStrings>
                <add name=”theString” connectionString=”your string here” providerName=”System.Data.SqlClient”/>
</connectionStrings>
<appSettings>
                <add key=”select” value=”SELECT * FROM Customers”/>
</appSettings>

Then in your data access class, you should define a DBProviderFactory, create an instance of it by calling the GetFactory static method passing the provider type as parameter (defined in your web.config). Then you should create a DBConnection class and a DBCommand class, or anything else you’d need, and use it as if you’d use for example the SQL classes. Example:
Read More…

Decide which User-related Information to Store in a Profile

Before you start using profiles, you should know some limitations of the SqlProfileProvider shipped with ASP.NET. First of all, it can become a performance-bottleneck. Each time you query profile information for a user, the profile API retrieves all of the user profile information from the underlying database (a roundtrip to SQL Server). However, after that you are free to process the requested information as long as you don’t post back your page to the server. When you modify profile information, another roundtrip is taken to the server.

Given these facts, you should store relatively small amount of information in user profiles. Another problem is that this information is serialized as clear text (or binary data/XML) but in any way, it’s not encrypted. So you should never include sensitive data in user profiles. Good news that your custom classes (as long as they are serializable) can be stored in profiles. I’ve kept the worst to the last: all profile information is stored in two cells for each user. In the first, all the names of the properties, in the second, all their values. So it will be very hard to share profile information with a desktop application, for example.

Read More…

Service Announcement – Posts which I won’t Publish

There are a lot of objectives in 70-564 which I’ve published already in my series about 70-562. These objectives (at least, from my part) require only a little re-reading, and digging in MSDN. So I won’t publish separate posts for them. They are as follows:

Read More…

Design Complex Layout with Master Pages

Master pages are a very powerful feature to provide a consistent look and feel for your site. They also help you focus on the content of each individual page, rather than re-implementing for example the navigation of your page each time.

However, sometimes you need to access the master page from one of your content pages (the other way around makes less sense). A cool thing to do is to create strongly-typed master pages. This is achieved by only a single directive, called MasterType. It looks like this:

<% @MasterType virtualPath=”~/MasterPage.master” %>
Read More…

Design a Brandable User Interface by Using Themes

Themes allow you to build sites with a consistent layout. You can set them up by adding an App_Themes directory for your application, and fill it up with folders. Each folder in the App_Themes directory represents a theme. You can assign them in a number of ways, in each case using the folder name to identify the theme.

There are five levels of applying themes:

  1. @Page Theme
  2. Web.config <pages Theme=””>
  3. Local control attributes
  4. @Page StyleSheetTheme
  5. Web.config <pages StyleSheetTheme=””>

A level at the beginning of the list overrides one at the end. So when you set a theme in the Page directive, it will override all the other style settings.
Read More…

Getting Certified – PRO ASP.NET 70-564

As I  mentioned yesterday, my current goal is to earn an MCPD credential in ASP.NET. Given this, I must take the 70-564 exam, called PRO: Designing and Developing ASP.NET Applications.

I really don’t have an idea what this exam might look like, I found suggestions that this one is focusing on what should you do rather than how would you do it. So no more constructor overloads to memorize, just understand what and why you’d implement.

Now that’s a cool thing, but unfortunately, there’s no MeasureUp questions for this. The Training Kit is out by now, but with a price I don’t consider to be acceptable for it (it’s about a hundred dollars currently).

Because of the lack of practice questions, I’ll sit on the exam on next week, just to see what it’s all about (with the help of Second Shot, of course). Until then, I’ll use three resources to learn: Matthew MacDonald’s and Mario Szpuszta’s Pro ASP.NET 3.5 in C# 2008, which I have used to prepare for the MCTS 70-562 before, but now I’ll focus on the advanced stuff.

There’s a free Microsoft book, called Microsoft Application Architecture Guide, v2.0. This one will be most useful for the questions about how to design an ASP.NET application. Last resource is of course the MSDN.

I’ll post regularly as I progress through the syllabus of the exam.