For years, I've been teaching an ASP.NET class where we build an ASP.NET website in Visual Studion 2008 and use it to do hands-on training exercises. However, I've never looked at perform these exercises in a web application to see what the difference is - assuming that it would be the same. I learned over the weekend that it is not; one of the differences being direct access to the Profile object in your WebForm, which you can't get to from within a web application build like you can from a website build.

Of course, there are serious ways to get to it - none of which seem to be that different. One way is to create a wrapper class that you can use to get to your Profile information. Joe Wrobel has an excellent one that you can install and use in your web applications that is available here:

http://code.msdn.microsoft.com/WebProfileBuilder (downloads) 

http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx (blog post)

However, a friend I was helping with this still had questions on how exactly to use it after installing the build task and updating the project file, which is where the directions are a little unclear. The next is to implement this property for each of your webforms you intend to use the new WebProfile object:

private WebProfile Profile
{
     get { return new WebProfile(Context.Profile); }

My friend was able to convert her web application thanks to this code. Now I need to go find out what else is different about website and web applications in preparation for my next class.

Cool 

June 1, 2009 13:40 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

5 blogs every ASP.NET programmers should know: 

http://development.tobiasopdenbrouw.nl/post/2009/04/09/5-blogs-every-ASPNET-programmer-should-know-analyzed-(31-DBBB-4-method).aspx

 

April 10, 2009 18:00 by RafaelV
E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

As I mentioned previously, I’ve had the wonderful opportunity to gain more experience developing a MOSS application for a fantastic client with two other consultants (with the project lead being a SharePoint veteran in our company.) Sadly, my contribution to the project has come to a close as the other two consultants prepare to deploy the finished product; however, I’m grateful for two things:

  • Aside from the usual bumps in the road, we were successful in providing our client with what they asked for within the time and budget we were given.
  • My experience was enjoyable and successful to a point that I can be even more useful in future MOSS projects. This happens to be critical for our Atlanta office, because now it puts us in a better position to compete for upcoming MOSS projects without having to use resources from other offices to fill them, therefore increasing our utilization as a team.

More than likely, the next project for me will not be a MOSS application, but will instead be “just” an ASP.NET application – which I’m actually looking forward to. But before that time comes and while it’s fresh on my mind, I’d like to share a few more thoughts on what I think others should know about MOSS development:

  • Lists, lists, lists. At the beginning of the project, our project lead kept referring to all of these “lists”. I had lists coming out of my ears! In our design, we even had plans for a “list of lists”. As a favor to me, we refrained from calling it a “list of lists” to stop my head from spinning; but it didn’t change the fact that everything in SharePoint is stored in a list – basically a configurable data table. The more you grasp that concept, the better you was able to understand how to create and automate them with our C# code.
  • “Out of the box” or custom. If you’re building a custom MOSS application, you’ll need to find out early how much custom development you’ll need versus automating what’s already there for you. When the client starts asking for something to behave just slightly different than how it works “out of the box” (we must have said this phrase about 50 times in the past 6 weeks), you’ll discover the need to create custom webparts and/or a lot of research finding out how to change default behaviors. For example, it took us days just to figure out how to make our column names wrap in an edit form – that was frustrating!
  • No “Page_Load” for you. Throw out the regular ASP.NET page events that you’re used to – no good. For example, if you want an action to be triggered by another action (I don’t know, like when the “page loads”!), you have to create a “feature” and code it to be “activated” when the site is created. To this day, we were puzzled to not find a place to put code that would run every time a page was rendered. In our case , this meant that we unable to refresh our left navigation in the event that a new site was created asynchronously; so we had to find several other places to strategically fire this code, leaving holes where the navigation the user sees may not be entirely accurate.
  • Getting to know the GAC and “iisreset” better. When you’re building a MOSS application, you’re not building a new application from the ground up; instead, you adding pieces (webparts, features, and other class libraries) to the existing SharePoint application framework. This means that  your development environment has to be on a server (we each used a Windows Server 2003 VPC with MOSS and Visual Studio installed on it). Then every time you want to test your stuff, you have to build your DLLs, copy them to the GAC, and reset IIS … every time! And then if you want to debug your code, don’t forget to attach to the “w3wp.exe” process in Visual Studio. It was nerve racking at first, but now I can do it in my sleep (I probably did!)
  • SharePoint really is “hot”. Now that I’ve basically given an overview of the quirks and frustrating things about MOSS development, now it’s time to tell you this: SharePoint is really “hot” and for good reason. I'm always amazed at how much we can accomplish in a matter of weeks. The configurable pieces it already has are incredibly useful, and the possibilities of creating custom collaborative solutions to make a company more efficient are endless. Despite several setbacks getting used to MOSS development, I do know that we could not have built this solution we’re about to deploy as quickly, scalable, and lot of other things than if we built it from scratch using just ASP.NET. Sharepoint is well worth the learning curve!
March 30, 2009 12:42 by RafaelV
E-mail | Permalink | Comments (3) | Comment RSSRSS comment feed

While helping out a friend with a picture gallery for a web application, I Googled some useful C# code for creating thumbnail images using the Image class out of the System.Drawing namespace (not to be confused with the Image web control class out of System.Web.UI.WebControls.)  

http://www.c-sharpcorner.com/UploadFile/mahesh/thumbnail08072007131100PM/thumbnail.aspx

Since I didn't need the image save in a stream, I simplified the code to save it to the root of my web application with this:

using (Image img = Image.FromFile(Server.MapPath("~/image.jpg")))
{
    using (Image thumb = img.GetThumbnailImage(50, 50, null, new IntPtr()))
    {
        thumb.Save(Server.MapPath("~/image_thumb.jpg"));
    }
}


My friend was pleased, except for the fact that his application uses VB.NET. No big deal, I came up with this:

Dim img As Image = Image.FromFile(Server.MapPath("~/image.jpg"))
Dim thumb As Image = img.GetThumbnailImage(50, 50, Nothing, New IntPtr())
thumb.Save(Server.MapPath("~/image_thumb.jpg")) 

 

February 20, 2009 23:07 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

My goal to learn SilverLight has taken a backseat to a great opportunity I was given to learn SharePoint (MOSS 2007 really). There's a lot of parts to it, so it's easy to get lost. Fortunately for me, I am learning "on the job" with another consultant that has a ton of experience with MOSS development. My other saving grace is that custom development is ASP.NET-based, so it plays very well with the ASP.NET I already have. Plus, I've also have experience creating webparts, one of the basic building blocks of custom MOSS development - which MOSS actually make a little easier to use in my opinion.

So far, I've been very pleased with the work we've been able to accomplish in a short amount of time on the project we're working on, and I look forward to being able to share what I've learned down the road. In the meantime, I am still in "learning mode"; so I plan on attending SharePoint Saturday that will happen in Atlanta on April 18, 2009 so that I can get as much exposure as I can. Right now, they're looking for speakers; but since I already know a few developer friends that will be presenting, I think I'll just be an attendee this time and maybe consider presenting at another code camp or something.

Bottom line ... those of you that haven't made the jump to SharePoint and MOSS development out of "fear of the unknown", I am here to say that it's not as scary as you think and I encourage you to give it a try and/or attend a conference to see what it's all about.

February 16, 2009 11:51 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Here's a useful site that provide a way for you to create an animated indicator progress icon that you can easily use with the AJAX UpdateProgress control to visually indicate a callback operation.

http://www.ajaxload.info/

January 17, 2009 23:33 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

A long time ago when I first started developing business web applications, my wife asked me about how things were going at work. I told her that one of the biggest challenges with our development team was making sure that our web applications were user friendly and intuitive. She shakes her head, turns to me and says "A website can't be intuitive!" When I asked why, she said it's because a website can't think or gain perception ... which is true, but my response was that it can help the visitor of that website to that.

For the next 30 minutes or so, we went back and forth on ways a website could or could not be intuitive. We finally looked up the meaning of the word intuition, and finally came to an agreement on what it means for a website to be intuitive ... "immediate apprehension". The websites that are able to provide a good user experience (UX) are able to help the visitor know exactly what the site is about and how to get the information they need quickly. We've all been to websites where we couldn't find anything, left, and never came back - confusion leads to visitors going somewhere else for products, services and/or information; and with business solutions, it leads to an application not being utilized.

So if confusion leads to the failure of a website, the opposite must also be true ... understanding leads to the success of it - which means more repeat visitors, more utilization, more revenue, or whatever the goal of your website is ... and the quicker they can understand what your website is doing the better. But I believe the days are gone where it is acceptable to simply throw a website together without any thought and expect people to automatically "buy into" what you're doing. Having a website is not enough, because the assumption in most industries is that you have; having a website that is intuitive is what will set you apart from the others.

January 16, 2009 07:52 by RafaelV
E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

First of all, Happy New Year to everyone. Everything's gonna be fine in 2009, son!

It has already started out to be a very busy year for me, including a side project that I helped to get off the ground for a gaming guild. Before I was asked by one of the leaders of the Sinister Society Guild to start a website for them, I had no idea what a gaming guild was (probably because I'm not a gamer!); however, I quickly learned through the building this site. 

Along with the basics, they needed a forum, a blog, a way to see their member list (complete with avatars), and a way to secure their site where only their guild members could see the "members only" sections (especially the forum!) And of course, since they don't make any money from this organization - they needed this done as inexpensively as possible.

The first step was to create a new look-and-feel established in a new master page, complete with a brand new logo and flash navigation from my brother Sebastian (thanks, bro!) ... which wasn't easy since we don't usually hang out in "sinister" gaming sites, but we found a way to give 'em what they needed. Then I used the following to quickly build the rest of their site:

  • JumpyForum - I started off by finding forum code that I could easily implement into their existing site without ripping out a lot of its code, and JumpyForum fit the bill. Once it was in place, I totally switched out the screens with regular gridview controls and used the same database structure to make it fit the guild's needs.
  • CliqueSite® NewsBlog - I needed the same thing for their blog, and I used CliqueSite® NewsBlog for it. It comes complete with comments, archiving, and RSS Feeds.
  • ASP.NET Security - Didn't need to create customized security for this, so I just used the ASP.NET security and membership database to drive their security with 4 roles: Member, Assasin (a special member), Moderator (for forums), Administrator.
  • ASP.NET Profiles - For all of the extra member information that they wanted to collect (like name, contact info, Xbox gamer tag, Guild Ranking, etc.), I used profile objects. 
  • Gravatar - Avatars are very important for gamers on the Internet, and this guild needed them to make their site legit. Fortunately for me, I didn't have to program a way for them to create them; within minutes I was able to implement Gravatar for free, that are managed by the tools they provide for you. And with a nifty custom control that is provided by Fresh Click Media, all I have to is pass in the e-mail address, tell it what size I want and I'm done. I was also able to specify the image to show when there isn't an Gravatar setup for a particular e-mail address.

Unfortunately, you won't be able to see any of these goodies unless you're an active member of the Sinister Society. But if you into playing the new game Darkfall (due to come out in the states the end of the month) and feel like you're "sinister" enough to hang with the big boys, feel free to apply for membership that I created using the wizard control. 

January 13, 2009 16:49 by RafaelV
E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

By participating in beta exams, you have the opportunity to provide the Microsoft Certification program with feedback about exam content. Having participated in the development process of these exams (including 71-564 below!), I know they depend on the contributions of experienced IT professionals and developers to improve and maintain the value of Microsoft certifications. But hurry fast, these spots don't last long.

Exam 71-564: Pro: Designing and Developing ASP.NET Applications Using the Microsoft® .NET Framework 3.5

Exam 71-565: Pro: Designing and Developing Enterprise Applications Using the Microsoft® .NET Framework 3.5

November 15, 2008 13:49 by RafaelV
E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

We .NET developers find ourselves at an interesting crossroad today, which can be summed up by a question: when should I take the plung and learn Silverlight/WPF/XAML? If you're like me, this decision may depend on whether or not we have the need to use it - like clients asking for it. If you do, the next thing you'll need is the confidence that Silverlight/WPF/XAML can handle the needs that business applications present to us. There are two schools of thought on whether or not this is true. Some say no; all of the colleagues I hang with, including Rocky Lhotka, say yes.

If you're like me, you don't have a current business need to learn Silverlight/WPF/XAML. Despite that, I'm still going to everything I can to learn it well. In my opinion, and many others that I respect, Silverlight/WPF/XAML is the future of UI development. Many believe that in about 5-10 years it will be take over as WinForms and WebForms. As Rocky explains in his post, once you get past the learning curve the UI development is much more productive.

To assist me in my commitment to learn Silverlight, I've volunteered to do a Silverlight presentation in about 3 weeks. The best way to learn anything is to teach it; so I'm very much looking forward to it. If I can get through this presentation, I know I will comfortable enough with Silverlight to start using it on a regular basis. My hope is that I'll also find new ways to use Silverlight, along with using it as a regular part of my freelance projects. Once I do that, I should be ready for primetime consultant work with future clients that my ask for it.

October 25, 2008 10:09 by RafaelV
E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

http://microsoftpartnerevents.com/acrossamerica/Atlanta.aspx  

September 8, 2008 21:25 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

This service pack includes full support for SQL Server 2008 (including support for new date and file stream capabilities), new features for ASP.NET AJAX, performance improvement for WPF, and more!

http://www.microsoft.com/downloads/details.aspx?FamilyId=AB99342F-5D1A-413D-8319-81DA479AB0D7&displaylang=en

August 26, 2008 07:42 by RafaelV
E-mail | Permalink | Comments (2) | Comment RSSRSS comment feed

Last night, I went to a Tech Night at Magenic where all of us got to see the basics of creating a Silverlight and WPF applications. After seeing how simple it is to create them, and the power of the technology as far as what you can do with, I'm starting to get really excited about using Silverlight in a live project. However, I need to focus on the goals I have at hand first. But in the meantime, it'll be good for me to keep paying attention to as much as possible in anticipation of being able to that in the future.

Here's something cool you can do with Silverlight - give an object the ability to be clicked and dragged.

http://simplesilverlight.wordpress.com/2008/08/13/drag-and-drop-silverlight-example/

August 11, 2008 21:10 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

Tracey and I have been on Facebook for about 2 weeks, so we're still getting the hang of things. While I was checking out some other features, I found that there's a development kit available to create applications using Facebook data using Visual Studio Express Editions - both web and windows applications. Could be useful!

http://www.microsoft.com/express/samples/facebook/

August 1, 2008 23:02 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed

After implementing the AJAX Extension from ASP.NET 3.5 in my family portal website that we use to organize our household, I've gained much more confidence with UpdatePanel controls. I still need to make some minor tweaks to it; but for the most part, I love being able to produce a web application without all that page refreshing.

However, I also know that I have more to learn about AJAX, and that there are more features that I can take advantage of. A cool way to do that would be to use controls that have AJAX built-in. In my ASP.NET 1.1 and 2.0 days, I was introduced to Anthem.NET, which gives you controls that encapsulate the complicated code needed to make AJAX work. Therefore, we were able to simply replace regular ASP.NET web controls with Anthem controls that responded to callbacks instead of the normal postbacks.

There is also an open source project developed by DotNetSlackers called the AJAX Data Controls (ADC), which is developed on top of the ASP.NET AJAX Extension. My man Jason Gaylord has been using them for a while, and has just recently joined that development team to convert these controls for ASP.NET 3.5 and Visual Studio 2008. This set of controls are now available for download, which includes a GridView, Repeater, DataList, and Page controls.

I'm hopeful that I'll gain more AJAX functionality out of the box with these controls than I could implement on my own, along making my AJAX development more efficient. Of course, I'll keep you posted either way; but if they're good enough for Jason, I'm confident they will serve me well.

July 10, 2008 22:53 by RafaelV
E-mail | Permalink | Comments (0) | Comment RSSRSS comment feed