A blog of ASP.NET 2.0 Samples, Articles, Reviews and Discussions. The purpose of this blog is to provide a resource to the quick information that developers need on Microsoft's new ASP.NET 2.0.

Friday, December 23, 2005

Rainbow Portal takes first step to 2.0

Under my push [ simply making a poll of who would want rainbow 2.0 and yelling at the rainbowportal group], the awesome developers of rainbow have taken their first step towards 2.0. See all it took was a little push... They have uploaded a Rainbow 2006 .net 2.0 version which I am in the process of getting hehe. Its up on their svn and I will bring you more details as they come in.

If you now your way around SVN/CVS then point your client to : Here

For an intro on Rainbow CVS/SVN then go here: Here

ASP.NET 2.0 Wizard Control

Seems like a lot of users are trying to create question/answer type websites and wizards for their users. This is where the wizard control comes in. It allows to you collect data from users in a step by step process. The data is collected in a neat manner and can be displayed for review at the final step. You can even allow users to stop in the middle and come back to where they left off!!! The wizard control can be customized to allow for certain common scenarios for collecting user input to creating accounts/information for the user.

Link: Official Link
Link: Creating Wizard control in 1.1

Change Membership/Provider Settings at Runtime

The example below shows how to change/switch between providers at runtime. I knew this had to exist for what would be the reason to have a default provider if you couldnt change it? I had to go to MS to find a good example. I hope that as users start to play with .NET 2.0, people will write better articles for me to find :). I always like to grab the developer/best practice way that illustrates the full concept. I am currently collecting best practices in .NET 2.0 that are hard to find but normal to us all and will post when I have fully covered the different topics.

Link: http://url123.com/rqn4w

Precompile your ASP.NET Apps

Precompiling your applications is a good idea once your App goes into production. When you have decided on a code freeze and want to test teh full ability, precompile is a good option. ASP.NET goes in and compiles all your pages/dal/bll into assemblies that are faster and safer. All your resources files get compild as well which also makes things safer. The article also goes into precompiling for Staging which you can use as an example for other environments.

Link: http://url123.com/r96pu

Thursday, December 22, 2005

At least MS likes me as a beta tester...

I just checked my email and got the following:

Dear Microsoft Beta Customer,

Thank you for your interest in the BizTalk Server 2006 Beta Release!

Your nomination form has been reviewed and you are now registered in the program. You will have access to the beta software and additional software via download within 24 hours of receiving this email. You will also have access to the private newsgroup.

I guess they still like me as a tester. I plan to test the crap out of it as Im working on a finacial applicaton and have disconnected processes. If you would like please visit the link below.

Click here to apply

Wednesday, December 21, 2005

New things for ASP.NET 2.0

Hold your horses on whatever yorue doing because its about to get easier. Thanks to Paggy4u, for alerting me on this issue[ by commenting to my blog] that Guthrie released the next changes for ASP.NET 2.0. Guthrie continues to talk about this new profile provider that can map to any table [ also told to me by Paggy4u [ thanks man] ] and other new enhancements.

Read up!

Tuesday, December 20, 2005

XML Manipulation in SQL Server 2005

I am now having to represent xml data along with my relational data and thought I would share some resources on this subject. Apparently SQL Server 2005 provides 5 functions for T-SQL that allow fast CRUD for XML. You can also type your xml so that your xml is checked for type safe on an insert/update with xml schemas.

MSDN Full Explaination

Monday, December 19, 2005

Working on MagicAjax New website

Ive been busy with [ my excuse] the Magic Ajax website which we built in rainbow. I have a guide on how to use Magic Ajax in your apps and we present a better look then the current website. The new website should be up by next week.

Check it out

XML Labs eXML Server control

XML Labs has released a nwe XML Server control ( eXML) that they claim runs 400 percent faster then the ASP.NET 2.0 control. They say they just use the namespaces in the .NET Framework. This goes to show that even normal developers ( Not big name companies) can make better controls then the commercial ones out. This control basically can take any XML and dislplay it from an XSL doc. This is very usefull if you are working with storing XML in the db especially SQL Server 2005 which has native XML support.

XML Labs

Saturday, December 17, 2005

Moved in to office

Finally made the transistion to our office. Rahul and I moved to the office with the hum of 15 servers in the background. I think it kinda makes you want to work more. I will finally have time to get back to blogging new things about ASP.NET 2.0. Check back tomorrow as I will have some new things. Im getting about 100 ppl a day so come back and stay a while. Please make a comment here or there if you have a better way of doing things. I also use my blog to develop so it helps me out too.


Thursday, December 15, 2005

How to create a Custom Module

Its about time someone released a step by step way of making a custom Rainbow Portal Module. Its actually easier and more straight forward now. I am going to have a blog entry on making a real world rainbow portal module [ when I get sometime]; but for now Install Rainbow Portal 2006 and start creating modules!

Link: http://url123.com/5z6qh

So Im making a C# Group

I made a C# group on yahoo groups with the intention to learn,teach,help,instruct on C# 2005 and future versions of C#. The other group mainly just deals with the older versions. Thats not a bad thing, I just want to concentrate on the future. Please join and help me out;we could use the support.

Link: Help Teach,Learn,Discuss C# 2005

Wednesday, December 14, 2005

Check users file permissions

I found a questions about this and had to add a blog entry to this because I too have applications that may need to rely on this. Its pretty simple actually, you just use a namespace that allows access to this information. The link below gives a good explaination.

Link: http://url123.com/vwdes

Microsoft Interview

Um yeah so it went ok I thought. For starters it was two developers interviewing me and not just one. Thats pretty normal for a high end job and oh yeah it is Microsoft. The questions were pretty normal with a strong emphasis on XML. They were tough but fair. I mean I know XML pretty well. You pretty much have to ;but crazy out of the world translations of it is what yah gotta know for MS. I figure it'll take me about 3 days to learn that. I mean a lot was about translating some data to the web. Proving that Microsoft does just like most companies. However, they do it the best and for millions of people around the globe. I was informed that if you for say produce a memory gap then millions of people will be affected. I mean that makes sense. I will work hard on not doing that hehehehe. Im good on mem gaps anyway because I just use controls to do things. I took the interview as more of a Consultant approach because thats what I am. I solve things. I might not remember every little bit; but I know how to get to that information and blog about how to fix it. I often use my own blog to remind myself the best way to do things. I recommend it and if you have a blog let me know. I need some good blog friends. Also I have a blog server. If you would like a free blog , hit me up. The position that I was going for was MSN developer. Its basically fast paced and what Im used to. I learned that you can dress how you want at MS which is pretty cool. Apparently someone came in wearing a grass skirt and coconut bra ala Qualtrough for the luau. I mean if I don't get hired, Im going to developer software and get famous anyway right? I hope....

Meebo - Im an addic

So meebo is always the first thing I sign into when I work out of a computer lab. Esp when they dont allow you to use IM abilities. The thing is sick and coded with Ajax and C# ( of course tis why I like it). They definitly have something going over there. The meebo 3 are up to their 9th release and got some cool features online. They do profiles with mouse over and is so much better than aim. They support invis login ( one of my favs) and constantly are updating their software. They support AIM,Gtalk,MSN,Yahoo and make one list. Sorta like trillian for the web.


Im a MagicAjax.NET Developer

So I woke up and checked my gmail and boom Im a MagicAjax.NET developer. I chose to work on the core modules in hopes to make them faster and industry [enterprise] safe. The controls already rock with better features comming soong [Im waiting for the feature list as I write this]. As far as I know, they are the only project that you can just place in your aspx that a control should work like an Ajax control and magically it is hehehe. Right on.

Also to awake to find ASP.NET forums down. Its chill, people are still contacting me by email which I dont mind.

Seems to be up now:

MagicAjax.NET Dev List


Rahul and I have started an online community to discuss Portals / CMS and developer issues. If you would like to write about these topics, please drop me a line pref with your resume just so I can see you on paper. My email is ramseur@gmail.com and you folkds have a good night. This brings my blog count up to 4 however this is my main one. Wierd I went from 0 to 4 in a week.

Link to Community CMS | Portal Blog

Tuesday, December 13, 2005

ASP.NET 2.0 Site Navigation

ASP.NET 2.0 makes it really easy to provide site navigation. Using XML you can make complicated site maps along with XML treeView/menus that can be loaded from XML Data Sources. I found a good article that reviews all three [siteMap/treeView/menu] by the man himself Scott Mitchell.

Link: http://url123.com/xr9bc

Contribution to Forums.ASP.NET

Im going to keep posting this until they allow an RSS Feed of Most Active users out of forums.asp.net hehe. AND I SO DID MORE THAN 41 in the giving time period. Notice Rahul and I at the top.

New Profile Provider

I agree with this guys post. When is this new profile provider coming out? All I want is a profile provider that I can store my own XML [ not in web.config! ewe yuck] and have it auto persist my profile settings. Seems that Mr. Guthrie has promised a cool new profile provider that you can point to a pre-existing table and go from there. Where is it hehehehehe?

Data Binding Syntax and Runtime Editing

I stumbled on to this article looking on how to set dataNavigatUrlFormatString at runtime. I knew that there had to be a way to do this and its actually very easy. This article also reviews the new late binding Syntax which is always good to know. I always like articles that teach us things that books leave out, especially when its something common.

Link: http://url123.com/xrvb3

Using a DataList to show RSS Feeds

I wanted to know a cool quick way to show RSS feeds on one of my sites. I find that there are many ways to do this quick and easy; however this article presents the information straight forward. This is a good article to also teach you about the ease of use and power of the DataList control and how you can use it to do normal real world scenarios.

Link: http://url123.com/xr3by

ASP.NET 2.0 DataList

Cant believe I looked over this control. The DataList will definitly be a control I will use often in my applications as most applications need to see data in lists and not grids. The DataList is like a cool repeater that allows you to also select and edit items in the list [ which rocks].

Old School[asp.net 1.1] DataList

MS pushes interview till tomorrow

I was all ready and its again tomorrow. Ha I guess I dont mind because it takes a load off. Heres the convo:

James from Microsoft :

Eric, our lead is still traveling today so we're going to need to do
this tomorrow -- how does 10:30 pacific sound (1:30pm eastern)

ramseur@gmail.com wrote :

Hehe you kids are nuts. I was all prepared too! That sounds good.

PS: There might be a blong entree about this hehe just kidding.

James from Microsoft :

Apologies, it's pretty crazy here around the holidays and he was
traveling from NYC to Seattle. Tomorrow is firm though.

Hey if you want to blog about it feel free :) Maybe it will be the
start of a new chapter for you

ramseur@gmail.com wrote :

Hhehe just giving you guys a hardtime. I understand business and how
it works and things come up. Whenever he has time, Ill make time.

I do like how they have fast responses and are nice when things come up. I like people with a sense of humor anyways.

Magic Ajax Panel

So with a simple search I find out that the theory of this magic control is a fact. Its actually been on sourceforge all this time and is being worked on a lot recently. Basically you can take any control [ yes both asp.net 1.1/2.0] and drag it to an Ajax Panel and your control becomes an Ajax control. You also need to add some things to your page to make it Ajax [Make it extend from Ajax.AjaxPage and override a few methods]. The link below explains everything with a good example and sample code. There are also links to the official release and you can judge for yourself.

ASP.NET 2.0 Magic Ajax Samples

New Articles coming up when I awake

My friend Rahul has been bugging me with samples of this magic Ajax control he found. Apparently all you have to do is define any .NET 1.x/2.0 control as a magic Ajax control and then BOOM it becomes one. Got to admit thats a cool concept. Oh I plan to bust that wide open ( I dont doubt it doenst work...just wondering how good it works hehehe) and give a report. I also want to finish my Caching series...what you thought I was done? And yeah there is that other thing I have to do tomorrow..gee what was it...I seem to forget..OH Microsoft..ACK.

Supporting different languages in a site ASP.NET 2.0

This is a cool topic that I came across. ASP.NET 2.0 supports multiple languages in one project just by adding a few lines of code. What are those lines of code you might ask? Wait! Hold your horses. For starters, it has to do with your \Code directory. By default, your \Code directory only supports one language. However, if you inform your web.config of different code directories, then voila.

within your web.config add :

<add directoryname="Code.CSharp">
<add directoryname="Code.VB">

which means :


are valid.

You can then act as you normally do with your pages. Note that only one lang is supported within each directory. Sorry no vb files in the C# directory. Hey what more could you want?

My Contribution to ASP.NET forums

You would think it would be hard to get to the top of the top users lists at aspnet forums. I have done this quite of few times just doing normal posting. Its fun to help people especially when you know what youre talking about....I hope... hehe

Monday, December 12, 2005

CSS Addon for VS.NET 2005

MSFT has just released a kick ass tool for CSS. If you want to actually make your sites look cool and easy to use, then I recommend going and installing this awesome tool. Really cool how normal MS developers are getting the spotlight for just making an addon we all need anyways. Kudos to Barry Tang .

Link: http://url123.com/x2bpm

Blog Facelift

Im now getting used to blogging [ only second week] and wanted to make a better looking blog at least. If you know of any good developer blog templates, shoot me an email. I like this one for now. Also if you have any suggestions [ esp about content or what you would like to see/know that other devs would benefit from]; shoot me an email.

Its Tommorrow

So Microsoft has decided to make me wait another day. That takes a load off hehe. One more day to prepare. Wish me luck.

Creating GridView Dynamically | on the Fly

I see a lot of questions for this so I decided to do some searching. GridViewGuy is the man at finding this stuff. I was also interested in building my grids on the fly so this serves as my ref too. When you get the crazy request to do something in a grid and dont know how, Id recommend doing it dynamically and stopping by gridviewguy.com .

Link: http://url123.com/2k4cs

Microsoft Visits My Blog

I guess this is pretty cool. I seeeee youuuuu...

tide510.microsoft.com (Microsoft Corp)

Washington, Redmond, United States, 0 returning visits
Date Time WebPage
12th December 2005 13:51:49 eramseur.blogspot.com/
www.google.com/search?q=asp.net 2.0 samples&hl=en&lr=&start=10&sa=N

Teeehehe he used google.....

Microsoft Interview

Yep you read that right. I have an important interview with the software Giant. I hope it goes well and Im interested in seeing how hard the interviews are. Ive done about a million screenings but I still think this will be challenging. I am going to try to post more since it will refresh me on a lot of the little things and learn more about asp.net 2.0. Thanks for reading my blog :) I get about 500 new people a week so that's really chill. I wish someone would give me my first comment :). I highly believe I might have mistakes or there could be better ways. I am highly interested in users out there that know best practices for things. I want to leave everyone with general know how and the best practice.

Sunday, December 11, 2005

UI on the Fly

I saw this great article on msdn that is about loading controls on the fly. I like how it opens with the normal way we add controls is the wrong way[dragging them on to a form or loading them on every post]. I believe this is why I found it so interesting because the more I read it the more I could see the performance gains. The article pretty much reviews how to load controls [ or anything] at runtime using XML as the control description language. Why keep making controls from scratch when you can make them on the fly when you need em? And did I mention caching..............Ill let you figure it out....

Link: http://url123.com/ckyn8

Saturday, December 10, 2005

ASP.NET 2.0 Create a Custom Provider for web.config

I have noticed that the question of how you make a common provider for everyday things is being asked a lot. I decided to answer it. I mean its a common thing. I like SQL Express and all but if youre a developer youre going to start with SQL Dev first at least. I mean the only use I saw for SQL Express was for teaching and for nice delieverables of applications. However, I like to use the core tools as I will be required to use in the "real world". Also, I want my own personal apps using the top stuff. That being said, my example is a provider for SQL Server. It just does the normal 3 providers [ Membership,Profile ,Role ] and when I find some good documentation, ill do the rest. I have found that the best stratigy for writing a provider is in the application's own web.config. I saw that you could just stick it into machine.config; but I only recommend that If ALL your applications rely on the same settings. I personally have applications that do all kinds of things with various permissions. My example is for web.config :

First, We will start of with the connection string. This is important because all your Provider elements [ Membership,Profile,Role] will rely on when connecting to the db. You want to make sure that the user connecting has privs to connect AND operate the dbs needed. I would not recommend just giving the sa account. Take some time and provide a secure method to the DB.

Second, I assume you have installed the ASPNETDB into your database using ASP.NET SQL Registration

Please Note: Blogger is wierd with code so I maybe missing an opening '<' in my XML.

In your web.config, put a connection strings section below the

<add name="SQLServerDEV" connectionString="server=.\MSSQLDEV;uid=meebo;password=rocks;
" providerName="System.Data.SqlClient" />

Make sure the ASPNETDB or your custom provider points to the rite DB where it is stored.

Then add the nodes to set up the provider :

- <membership>
- <providers>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="SQLServerDEV" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression="" />
- <profile>
- <providers>
<add name="AspNetSqlProfileProvider" connectionStringName="SQLServerDEV" applicationName="/" type="System.Web.Profile.SqlProfileProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
- <roleManager>
- <providers>
<add name="AspNetSqlRoleProvider" connectionStringName="SQLServerDEV" applicationName="/" type="System.Web.Security.SqlRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<add name="AspNetWindowsTokenRoleProvider" applicationName="/" type="System.Web.Security.WindowsTokenRoleProvider, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

Now you can just switch your connection string as you scale up and youve got a custom provider should you need to give your app to someone else and they can load your db into their platform.

Friday, December 09, 2005

Assemblies in SQL Server 2005

Being able to store an assembly in SQL Server 2005 is a feature worth learning. Imagine using 1000's of code scenarios within the DB itself. The implementation is pretty easy. You just have to create an assembly and hook it to a stored proc that calls with your params. I have provided some links to get you caught up to speed.

Link: http://url123.com/cyzre
Link: http://url123.com/cy4rw

Caching Series Part III - Post-cache Substitution

Finally there is an easy way to insert dynamic snippets into cached pages on each request. The solution that ASP.NET 2.0 provides for us is Post-cache Substitution. There is even an <asp:Substitution> control that makes the process even easier then using the Response.WriteSubstitution API.

Link: http://url123.com/cadrq

Caching Series Part II - Fragment Cache

ASP.NET 2.0 provides the fragment Cache for scenarios that may not need the whole page [most common] page to be cached. All you have to do is add an output cache directive for the user control component and voila. The link below gives a good example. Another form of the output cache is Data Dependent Caching or SQL cache dependency. I already posted an article on this .

Link: http://url123.com/cwh9d

Caching Series Part I - Output Cache

I am now going to try to write a series as the Caching in ASP.NET 2.0 has been significantly improved. I will begin with Page Output Caching as this was a feature in 1.1 that has been improved. I will then touch on the different types of caching in my next Entries.

Page Output Caching is good when you can cache an entire page because the page is not constantly updated. Translation, all your pages that are static user content or don't change that much should be cached. Microsoft says that even output caching for a minute can reduce server loads significantly. The following link gives a good overview.

Link: http://url123.com/cww9y

Wednesday, December 07, 2005

Maintain Scroll Position

Maintaining your scroll position through postbacks has been simplified. All you have to do is set a page directive [ MaintainScrollPositionOnPostBack = true ...who knew? ] Now you can have a postback and return the user exactly where he was before he was interupted. This is useful when corporate requires you [ or makes you ] have pretty large forms or you are dealing with a huge post of info.

Link: http://url123.com/mx8ms


I am just going to run through some cool JavaScript options when I find them. OnClientClick is a cool new attribute for the button control that allows you to specify a JavaScript client side event with ease. A sample is listed below but you can just as easily add your own custom javaScript.

Link: http://url123.com/mxbar

Focus API

The Focus API is a lil nifty API good for positioning and default settings. You can have a default button clicked when the user presses enter [ good if you have all kinds of clickable things on a page] or use in conjunction with validation [ to have the user be directed straight to the error(s) ]. The code is straight forward with easy to use properties [ SetFocusOnError,defaultFocus,etc ] and easy to pick up.

Link: http://url123.com/m2ks2

Validation Groups

Asp.NET 2.0 has a cool feature for doing individual validation [ finally ] on different controls. All you have to do is make a control cause validation [ just set CausesValidation to true] and then set the group for the validators. This is cool if you have a couple controls on a page and some controls only needed to be validated because of a certain user action or a certain workflow. Please refer to the below link for source.

Link: http://url123.com/m2u2z

Membership API

I have been reading more on the new Membership API. I like how I just looked at the ASPNETDB and was actually thinking how I could get info out when the API already does this. I wonder how fast it does some of its methods ( particularly the update calls). Nonetheless, the membership api provides some really cool static methods to do most of the operations you need from changing/resetting a password to getting all users or all users currently online.

Link: http://url123.com/mcwqg

Tuesday, December 06, 2005

ASP.NET 2.0 State Management | Control State

State Management has been improved with the introduction of control state. Control State allows you to save settings that deal with a control that are small and lightweight that dont need to be created at every request. The article below discusses improving your applications with State as well as improvements in View State. It also reviews the common concepts of state.

Link: http://url123.com/dzq5w

ASP.NET 2.0 Health Monitoring

Health Monitoring is an amazing api now out of the box in ASP.NET 2.0. It can help you in various ways if you are a administrator trying to fine tune your application or a developer looking for an issue. After reading up on this, I had to post a little about it. My favorite feature is the ability to extend of the System.Web.Management.WebBaseEvent class and create your own personal application monitors. You just raise a small event say everytime the user reaches an error page. Sending email alerts is already built in so dont ask that question. You can even dump alerts to SQL Server. I would then make and admin section that just gave me a gridView of this information. The link below provides an overview and even describes how you can make your own events like "long SQL Server Times" or "dllSlowCompilation". Im sure you can think of better ones :).

Link: http://url123.com/dz5s4

C# 2005 Partial Classes

I haven't updated my blog in awhile so I wanted to start off with something neat. When I first opened VS 2005, I was staring at the new features;I didn't even realize that the keyword partial was before my class name. I did however realize that there was less code and that Initialize component was missing. I soon discovered that this was because of partial classes. Partial classes allow you to split your class over many class files. This is wonderful for web development as you can just define objects in your aspx and they can be used from your code behind. You no longer have to initialize any components or controls. This is also good if you have complex classes and want to spread the logic over many class files. Who knows how dangerous that is eh?

Link: http://url123.com/dm3gr

I like this guys blog entry of how he is using partial classes. It might be dangerous but I like the risk.
Link: http://url123.com/dmv5s

Friday, December 02, 2005

ASP.NET 2.0 Details View

The GridView control can be used with the details view to create Master-Detail Pages. Here are some articles to get you caught up to speed with the Details View. Unlike the GridView, the detailsView does allow inserting. The details view also allows for paging but only 1 record at a time.

Link: http://url123.com/gnz37
Link: http://url123.com/gn43g