An Unrivaled Windows Hosting Experience
1-888-313-9421  | webteam@orcsweb.com
  1. IIS Manager for Remote Administration - Prerequisite

    If you decide to install the IIS Manager for Remote Administration on Windows 7 you will likely initially get an error message stating that the IIS Management Console is not installed.

    This error threw me for a little loop initially. It's pretty straight forward, but my first thought was "I know it isn't installed, that's what I'm installing". It seems that when installing the IIS Manager it should be smart enough to also enable the IIS Management Console, but it doesn't - likely for a reason related to security - but still, it struck me as a little odd.

    Resolving the issue is easy and straight forward. Just as the message notes, open the Control Panel and select Turn Windows Features On or Off.

    Then check the box next to the IIS Management Console.

    Then click okay and accept the installation prompts.

    After that completes, you can restart the installation of the IIS Manager for Remote Administration.

     

    Tuesday, March 09 2010 by | 0 comment(s)
    Tagged as: , , , , , ,

  2. Visual Studio 2010 is awesome - check it out!

    Visual Studio 2010, the latest and greatest version of Microsoft's developer toolset, will be releasing soon. I've been around hundreds of users (OrcsWeb clients, MVPs, and industry Insiders) who have used it through the beta cycle (as I have too) and the comments are overwhelmingly positive. If you haven't tried it out yet, you might want to check it out for free during the current RC phase.

    Once you've got it downloaded and running, feel free to set up a free ASP.NET 4.0 RC test hosting account with us this month to try out the deployment related features and the general hosting experience.

    Monday, March 08 2010 by | 0 comment(s)
    Tagged as: , , , , , , ,

  3. New Offers for Visual Studio 2010 - special pricing

    Somasegar recently blogged with an announcement about special pricing ($299) for current users of VS2005 and/or VS2008 to upgrade to Visual Studio 2010. That's great. Thanks Microsoft!

    Friday, March 05 2010 by | 0 comment(s)
    Tagged as: , ,

  4. FREE ASP.NET 4.0 RC & Visual Studio 2010 trial hosting

    Did you know we have free hosting accounts available to test out ASP.NET 4.0 RC and Visual Studio 2010 through the month of March 2010?

    http://vs2010host.com/

    This is a great way to test out the new features of ASP.NET 4.0 and Visual Studio. We also support WebDeploy, one-click-publishing, and the remote IIS 7 management tools. This is a great opportunity to check them out - for free!

    And of course if you need quality production hosting, we at OrcsWeb have managed dedicated hosting, Hyper-V based virtual dedicated hosting, and windows shared hosting options available.

     

    Tuesday, March 02 2010 by | 0 comment(s)
    Tagged as: , , , , ,

  5. .Net 4's new IsNullOrWhiteSpace method

    .Net 4 (still in beta right now) has a handy new method that can analye a string and return where it is null or just whitespace versus other text. Here's a quick sample:

    ScratchPage.aspx

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="ScratchPage.aspx.cs" Inherits="ScratchPage" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <asp:TextBox ID="textBox" runat="server"></asp:TextBox>
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
            <br />
            <asp:Label ID="Label1" runat="server"></asp:Label>
        </div>
        </form>
    </body>
    </html>

    ScratchPage.aspx.cs

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
     
    public partial class ScratchPage : System.Web.UI.Page
    {
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(textBox.Text))
            {
                Label1.Text = "The text box is null or has only white space.";
            }
            else
            {
                Label1.Text = "There is a non-null, non-white-space value in the text box";
            }
     
        }
    }

     

    Tuesday, February 23 2010 by | 0 comment(s)
    Tagged as: , , , ,

  6. ASP.Net Forums

    If you aren't already familiar with the ASP.Net forums, you should browse over and check them out. It's a great place to get answers to frequently asked questions, post your own custom questions for solution assistance, answer questions for people to provide peer support, and find information about new and upcoming solutions (like the ASP.Net 4 forum).

    Some of the general topic groupings include General ASP.Net, AJAX, Visual Studio, Data Access, Advanced ASP.Net, Migration, and a number of Starter Kits and Source Project discussions.

    Thursday, February 18 2010 by | 0 comment(s)
    Tagged as: , , , , ,

  7. How to enable .Net 3.5.1 on Windows Server 2008

    When Windows Server 2008 is installed and the IIS roles are enabled, it defaults to .Net 2.0.

    If you want to run .Net 3.5.1 on the server you might think the process is as easy as just downloading the bits from Microsoft and running the installation process. No, it isn't. It still isn't hard, but it can be frustrating for someone who isn't familiar with the required process.

    To enable .Net 3.5.1 on a Windows Server 2008 machine that already has the IIS role enabled...

    To get started, from within Server Manager you need to select Features in the left-hand tree and then Add Features in the right-hand pane.

    NOTE: I have the SMTP feature enabled on this test server but on your machine you likely won't see that listed.

    On the next screen select the ".Net Framework 3.5.1 Features" option from the list.

    As soon as you click that box, a pop-up window like the one below will be displayed.

    Clicking "Add Required Features" will then install the necessary dependencies and files required to support .Net 3.5.1 on the server.

     

    Wednesday, February 17 2010 by | 0 comment(s)
    Tagged as: , , , , ,

  8. Securing ASP.Net Pages - Forms Authentication - C# and .Net 4

    ASP.Net has a built-in feature named Forms Authentication that allows a developer to easily secure certain areas of a web site. In this post I'm going to build a simple authentication sample using C# and ASP.Net 4.0 (still in beta as of the posting date).

    Security settings with ASP.Net is configured from within the web.config file. This is a standard ASCII file, with an XML format, that is located in the root of your web application. Here is a sample web.config file: 
    <configuration>
        <system.web>
            <authenticationmode="Forms">
                <formsname="TestAuthCookie"loginUrl="login.aspx"timeout="30">
                    <credentialspasswordFormat="Clear">
                        <username="user1"password="pass1"/>
                        <username="user2"password="pass2"/>
                    </credentials>
                </forms>
            </authentication>
            <authorization>
                <denyusers="?"/>
            </authorization>
            <compilationtargetFramework="4.0"/>
            <pagescontrolRenderingCompatibilityVersion="3.5"clientIDMode="AutoID"/>
        </system.web>
    </configuration>
     
    The very first line is standard for a web.config file and has no bearing on the security.
     
    The next section specifies that you are configuring the security for this web application. First we set the authentication mode to use a cookie in this specific example. You can specify a unique name for your cookie. This section also specifies the page or URL that will contain the authentication code (login.aspx in this case) and how long the authentication cookie should be persisted.
     
    The next two lines specify valid usernames and passwords for this web application. As far as I know there is no limit to the number of user accounts you can place in the web.config, but if there were a large number - or if they change frequently - it might be better to place this information in an external file like a database or an XML file instead (I'll show this in a future article).
     
    Now that we have specified some valid logon accounts, we need to actually specify that we want to password protect. For this example I have decided to password protect the entire web site starting at the root, so the optional <location> attribute will not be used. We set the authorization to deny all non-authenticated users (deny users="?").
     
    That's all that is needed for the config.web file. If someone tries to access the site and the user has not already authenticated, they will be redirected to the login.aspx page.
     
    This is only half the required process though. We now need to create the login.aspx page to actually allow the user to authenticate to our application.
     
    Here is the complete source of the sample login.aspx page
     
     
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="login.aspx.cs" %>
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            Username:
            <asp:TextBox ID="username" runat="server"></asp:TextBox>
            <br />
            Password:
            <asp:TextBox ID="password" runat="server"></asp:TextBox>
            <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Login" />
            <br />
            <br />
            <asp:Label ID="status" runat="server" Text="Please login"></asp:Label>
        </div>
        </form>
    </body>
    </html>
     
    And here is the complete source of the login.aspx.cs file:
    using System;
    using System.Web.UI.WebControls;
    using System.Web.Security;
     
    public partial class Default3 : System.Web.UI.Page
    {
        protected void Button1_Click(object sender, EventArgs e)
        {
            if (FormsAuthentication.Authenticate(username.Text, password.Text))
            {
                status.Text = ("Welcome " + username.Text);
                FormsAuthentication.RedirectFromLoginPage(username.Text, true);
            }
            else
            {
                status.Text = "Invalid login!";
            }
     
        }
    }
     
    Let's look at the login.aspx page first. This is fairly straight-forward HTML format. These aren't actually straight HTML tags, but rather ASP.Net HTML controls that will render HTML page to the client browser (you can tell the difference because the runat="server" tag at on the control). This is a form that accepts a username and password. When the submit button is clicked, this page executes the code within the login.aspx.cs page located in the subroutine named "Button1_Click".
    Inside the Button1_Click method we use the FormsAuthentication object. The first line of the sub actually passes the entered username and password over to the object, which in turn compares this information to the values in the web.config file. If the values match, then the next line changes the label (just so we can see visually that it worked) then writes a cookie to the browser and redirects the user back to the original URL which was requested. The second value listed ("true") tells the browser to persist the cookie. So if this user authenticates, closes their browser, opens it again, and tries the secure URL - they will still be authenticated.
    If the username and password entered did not match, an error message is displayed to the screen and the visitor is allowed to enter a new username and password to try again.
    This is a simple example and I don't cover any of the advanced configurations or options, but with this sample code, you should have a basis to work with if you want to implement security in ASP.Net
     

    Monday, February 15 2010 by | 0 comment(s)
    Tagged as: , , , ,

  9. Design Guidelines for Developing Class Libraries

    Someone pointed out my old-school VB naming conventions in a recent C# sample code post and provided some pointers and some suggested reading. I've named objects the same way for so long that I'm sure I'll struggle with the changes, but I took the pointers to heart and will work to adjust my naming conventions moving forward. I haven't read through the link provided yet, but figured I'd share it here (its from MSDN).

    He also mentioned that the comments button isn't currently working, which explains why comments have totally dropped off - someone here is looking into that issue to see why it broke and will hopefully have it working again shortly.

    Update: Here is another link I was just reading about Pascal Case and Camel Case use in C# programming:
    http://cplus.about.com/od/learnc/ss/csharpclasses_5.htm

     

    Wednesday, February 10 2010 by | 0 comment(s)
    Tagged as: , , , ,

  10. Sending email from ASP.Net 4 - C# sample code

    (I updated the code sample based on feedback about C# naming standards and leveraging iDisposable - which I'm sure I'll forget many times until I get comfortable more with C#.)

    Below is sample code showing how to send email from ASP.Net 4 (currently in beta as of this posting) using C#. With this code I am assuming that the server already has a local SMTP service installed, so I use "localhost" to relay the email.

    Here is the SendMail.aspx page:

     

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="SendMail.aspx.cs" Inherits="SendMail" %>

     

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

     

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head runat="server">

        <title></title>

    </head>

    <body>

        <form id="form1" runat="server">

        <div>

            Message to:

            <asp:TextBox ID="to" runat="server"></asp:TextBox>

            <br />

            Message from:

            <asp:TextBox ID="from" runat="server"></asp:TextBox>

            <br />

            Subject:

            <asp:TextBox ID="subject" runat="server"></asp:TextBox>

            <br />

            Message Body:

            <br />

            <asp:TextBox ID="body" runat="server" Height="171px" TextMode="MultiLine"

                Width="270px"></asp:TextBox>

            <br />

            <asp:Button ID="sendMail" runat="server" onclick="SendMail_Click"

                Text="Send Email" />

            <br />

            <br />

            <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

        </div>

        </form>

    </body>

    </html>

     

    Here is the source code of the SendMail.aspx.cs page:

    using System;

    using System.Web.UI.WebControls;

    using System.Net.Mail;

     

    public partial class SendMail : System.Web.UI.Page

    {

        protected void SendMail_Click(object sender, EventArgs e)

        {

            using (MailMessage mailItem = new MailMessage(

                from.Text, to.Text, subject.Text, body.Text))

            {

                SmtpClient smtpServer = new SmtpClient("localhost");

                try

                {

                    smtpServer.Send(mailItem);

                }

                catch (Exception ex)

                {

                    Label1.Text = ex.ToString();

                }

            }

        }

    }

     

     

    Monday, February 08 2010 by | 0 comment(s)
    Tagged as: , , , , , ,

  11. How to install SMTP on Windows Server 2008

    The SMTP services are not installed by default on Windows Server 2008. To install that service, follow these steps...

    First go to the Features Summary section of the Server Manager and click Add Features.

    Server Manager Features Summary

    Then scroll down and select the SMTP Server option from the list.

    Once you click the SMTP Server option, you'll get a dialog box showing the other roles and features required for the SMTP service to work.

    Click Add Required Role Services then Next on the three subsequent dialog boxes. You're then presented with a summary and an Install button. Click Install and all the required services will be installed to support SMTP on the server.

     

    Thursday, February 04 2010 by | 0 comment(s)
    Tagged as: , , , ,

  12. Installing Visual Web Developer 2010 Express Beta 2

    First things first, you can download the Visual Web Developer 2010 Express Edition Beta 2 (wow, that sure is a mouth-full!) for free from Microsoft's site here.

    On the initial welcome screen there is nothing to do but click next. No option to opt-out from sending your information to Microsoft. Hey, it is a beta, and a major goal with beta programs is to get feedback, so I certainly don't blame them for locking that in.

    Next, agree to the license (read it first of course).

    After that you get an optional install screen. There is only one option presented to me, and it's SQL Server 2008 Express SP1. I'm going to select it and highly suggest you do to. After all, what fun is a web application without a SQL source?

    The next screen lets you select a specific install folder - or accept the default.

    I'm going to leave the defaults alone. Space requirement shows as 3.2GB, which isn't horribly large. Well, yeah, it's big for sure, but just wait until you see everything included - then you'll likely agree that 3.2GB of space is not a bad trade-off.

    Click install from there and a download and install process starts. I show 18 items for a total of 292MB being downloaded, which matches what the install screen earlier showed. What takes up the additional 3GB?? I guess I'll have to wait and see.

    Well, the install is done now. That was painless. I have no idea why the space requirements were 3.2GB though. I've clicked around the folders and did a quick estimate around 400MB of new files. Either the install needs a ton of temporary installation space (3GB) or maybe that's a small bug on the install screen.

     

     

    Wednesday, February 03 2010 by | 0 comment(s)
    Tagged as: , , , , ,

  13. Managed Dedicated Hosting - Hard Drive Redundancy / RAID

    When working with client prospects to understand the differences between ORCS Web's dedicated solutions and cheap host options, many things come to light preventing an easy initial apples-to-apples comparison.

    One of the common differences we see is that most hosts include a single hard drive with their standard server packages. Every dedicated solution that ORCS Web deploys has a hardware based RAID solution though. If the term RAID is unfamiliar to you, please see "What is RAID" for some background information.

    Having multiple hard drives setup in a RAID configuration benefits both performance and redundancy. Server hard drives spin at a tremendous speeds and are the most likely hardware components of a server system to fail. With a RAID solution, the server stays online with no interruption and the failed hard drive can be hot-swapped while the server is online - no disruption to the hosting at all.

    Personally, I would not deploy a production application to a server that did not have a RAID hard drive configuration. But, admittedly, not everyone shares this viewpoint. I've had some interesting dialog with a couple of people who say "who cares?". Their thought is that if their server drive fails, they'll just get the host to pull out the drive, put in a new one, restore the data, and get the server back online.

    Well, let's consider some points for a non-RAID drive failure in a production server...

    Do you have backups? I'm a HUGE believer in backups for all systems. I'll craft a future post about this point. But, if you are going to consider deploying to server with a single hard drive, you better be sure you have backups. Either manually export all your data to your personal PC on a regular basis, or be sure that your host is backing up your server.

    When was the last backup? Any data written or changed on the drive between the most recent backup and the failure is going to be lost. In some situations this can be a huge deal. Lost orders; lost user accounts; lost records - all gone and never to be seen again.

    How easy is the restore? If the drive that fails is just hosting standard web content only, or image files, or some other simple file type, the restore process might be fairly quick and easy. If the drive is holding the OS, or data files, or dozens of other types of complex or transactional data, it's a totally different situation. The time to actually run the restore process (getting the data back onto a new hard drive) is only part of the work. There is often a decent amount of manual work still required to get the system fully functioning again with the data current.

    Swap the drives... Depending on the type of server you are running, the hard drive swap process can be really simple - pull a drive from the front of the system and slide in a new drive. Or it could be rather cumbersome - un-rack the server, open it up, pull the drive, put in a new one, close everything back up, re-rack the server. Also, if considering this option, best be sure the host can assure you they have the exact physical size, data size, and speed hard drive that you'll need, or you could be stuck without a quick replacement.

    Considering those points - If the server was being backed up, and if there are spare drives sitting around, and if the restore process goes smoothly... you would still be looking at a few hours of downtime - maybe many hours depending on the specifics of the situation. And even after the server is restored you could be dealing with the potential fallout of data loss and the impact to your organization. How will your clients react? How about site visitors that stopped by and couldn't access the server?

    Is it worth the risk to save a negligible amount of money on your hosting cost each month? Maybe in some situations where the users are extremely tolerant of downtime and data loss is not a concern. In the reality of today's world though, fewer and fewer Internet sites or applications have users that would tolerate such a situation when it could be so easily avoided.

    I say go RAID and be safeguarded against hard drive failure.

     

     

    Tuesday, January 26 2010 by | 0 comment(s)
    Tagged as: , , , , ,

  14. Use WCAT To Load-Test Your Web Application

    Here is a useful post giving an introduction to Microsoft's WCAT - which can be used to generate load against a web application.

    http://blogs.msdn.com/alikl/archive/2008/03/09/stress-test-asp-net-web-application-with-free-wcat-tool.aspx

     

    Wednesday, January 20 2010 by | 0 comment(s)
    Tagged as: , , ,

  15. Saving Snapshots to PNG in Silverlight 4 and the WebCam

    John Papa has a cool blog post about capturing images from a webcam using Silverlight. Check it out.

    http://johnpapa.net/silverlight/saving-snapshots-to-png-in-silverlight-4-and-the-webcam/

     

    Wednesday, January 13 2010 by | 0 comment(s)
    Tagged as: , ,

  16. How do I move a page without losing search engine traffic?

    Let's say you have lot of Classic ASP pages or HTML pages on your site that are bringing in good search engine traffic but now you want to redesign your site using ASP.NET. What do you do so you don't lose your established traffic with the new design?

    In the HTTP protocol you would use a 301 redirect. Keep the old page name in place but edit the file using the following syntax. In time the search engine will have the new page indexed:

    <html>
    <head>
    <meta http-equiv="refresh" content="0;url=http://www.xyz.com/newpage.html">
    </head>
    <body>
    This page has moved to <a href="http://www.xyz.com/newpage.html">http://xyz.com/newpage.html</a>
    </body>
    </html>

    If you want to move some Classic ASP pages you can use the following:

    <%@ Language=VBScript %>
    <%
    Response.Status="301 Moved Permanently"
    Response.AddHeader "Location", "/newpage.asp"
    %>

    If you want to move some .Net pages you can use the following:

     <%@ Page Language="C#"%>
    <script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
       Response.Status = "301 Moved Permanently" ;
       Response.AddHeader( "Location" ,"/newpage.aspx" );
    }

    </script>

     

     

    Thursday, March 12 2009 by | 0 comment(s)
    Tagged as: , , ,

  17. Five years ago I had my head in the clouds...

    Five years ago I had my head in the clouds and wrote a short introductory article about highly-available and highly-scalable hosting.

     http://www.orcsweb.com/articles/web_cluster.aspx

    Yes, in February of 2004 I was trying to help people understand and appreciate the benefit of cloud hosting. I didn't have the marketing powerhouse of Microsoft or Google, nor was the term "cloud" being used in the industry, but the technology was available and at ORCS Web we had already been supporting clients of various sizes on cloud platforms with great success.

    I continue to be a huge fan of cloud hosting and believe it deserves consideration from anyone who takes their web application hosting seriously. Success on the platform takes a lot more than just throwing a few servers online though so clients should be looking for a host with years of experience and proven successes. There is also more to hosting than just the infrastructure. Strong technical support and excellence in customer service are also key to successful hosting solutions so clients should read reviews and check references before entering into a hosting relationship.

    We'd love to help your web solutions be successful so let us know if you have any questions or if there is anything we can do for you.

    Happy hosting!

    Brad

     

     

    Sunday, February 01 2009 by | 0 comment(s)
    Tagged as: , , , , , , ,

  18. Dividision Within a SQL Statement With Decimal Results

    I was surprised to find that this SQL statement does not return .36 as I had expected:

    select 36/100 as ShowPercent

    From some online searching I found a post which commented that a decimal result from a division operation would not display properly if both of the values were integers. I have no idea why, but that does seem to be true. The change I made to get the correct result was:

    select 36/cast(100 as float) as ShowPercent

    ~Brad

    Tuesday, December 23 2008 by | 1 comment(s)
    Tagged as: , , , ,

  19. Dedicated Cloud Solutions

    I've noticed that a few hosting companies are now advertising that they have "dedicated cloud" solutions. That's an interesting bit of marketing. A dedicated cloud, as I understand it (and confirmed by details on competitor sites) is basically a webfarm front-end with possibly a database cluster on the backend (though often the term "cloud" is targeted toward the front-end solution).

    Either these companies are new to the webfarm / cloud space, or they're just putting a marketing twist on existing services.

    At ORCS Web we have been hosting highly-available and highly-scalable webfarm solutions for clients for over ten years. Here's a short case-study about a webfarm solution we manage for Lake Quincy Media. We also host webfarm / cloud solutions for http://www.asp.net/, http://www.zagat.com/, http://aspalliance.com/, and many other clients.

    I guess I need to start getting comfrotable with using the term cloud now since it seems to be the new buzzword. Whether you call it a cloud, webfarm, server farm, or anything else - I'm all for HA/HS solutions and believe that anyone who relies heavily on their web site/application being online should go this route. It's the best way to avoid costly downtime that might otherwise occur with hardware failure or resource overload.

    Happy Hosting!

    ~Brad

     

    Tuesday, December 23 2008 by | 0 comment(s)
    Tagged as: , , , , , , , , ,

  20. Access Report Viewer DLL Files for your Application

    If an application requires the use of Report Viewer Redistributable and needs access to specific .dlls for the application to run, you’ll find this post helpful, http://drowningintechnicaldebt.com/blogs/dennisbottjer/archive/2006/10/16/Hacking-Report-Viewer-Redistributable.aspx.

     

    It explains how to extract the necessary .dll files so you can reference them in your application and avoid GAC security errors (e.g., Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The module was expected to contain an assembly manifest.)

     

    I will outline the steps below to avoid another click. ;) I have also added links for the most recent versions of Report Viewer.

     

    1. Download Report Viewer Redistributable
      1. Report Viewer 2005 - http://www.microsoft.com/downloads/details.aspx?familyid=8a166cac-758d-45c8-b637-dd7726e61367&displaylang=en
      2. Report Viewer 2008 - http://www.microsoft.com/downloads/details.aspx?familyid=CC96C246-61E5-4D9E-BB5F-416D75A1B9EF&displaylang=en
      3. Report Viewer 2008 SP1 - http://www.microsoft.com/downloads/details.aspx?familyid=BB196D5D-76C2-4A0E-9458-267D22B6AAC6&displaylang=en
    2. Use favorite Zip Utility to extract the MSI.exe to a folder of your choice
    3. Find the file ReportV1.cab in extract folder from step #2
    4. Use favorite Zip Utility to extract ReportV1.cab to a folder of your choice
    5. Open the new folder from step 4 and find 4 files
    6. Rename: FL_Microsoft_ReportViewer_Common_dll_117718_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.Common.dll
    7. Rename: FL_Microsoft_ReportViewer_ProcessingObject_125592_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.ProcessingObjectModel.dll
    8. Rename: FL_Microsoft_ReportViewer_WebForms_dll_117720_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.WebForms.dll
    9. Rename: FL_Microsoft_ReportViewer_WinForms_dll_117722_____X86.3643236F_FC70_11D3_A536_0090278A1BB8 To Microsoft.ReportViewer.WinForms.dll
    10. Copy these dlls to your smart client project and reference them
    11. Now they will be part of the Smart Client's Build Output and Click Once Deployment

     

    I hope this makes someone’s life a little easier!

    Tuesday, November 25 2008 by | 0 comment(s)
    Tagged as: , ,

  21. Sending Multiple Values To Another Page From GridView

    I am working on a project right now that requires me to send multiple values to another page from a GridView.  The GridView control in ASP.Net 2.0 makes it easy to send a single value through the URL and it doesn't take very long searching the Internet to find many people who have provided this information.  I might add that it is part of the tooltip for the Gridview if you go through the settings of editing the columns in Visual Studio 2005.  There are also a multitude of suggestions from many people on passing multiple values but after I tried numerous options, I could not get any of them to work.  I did stumble across an article from Azam Sharp that finally got me going in the right direction:  http://www.gridviewguy.com/ArticleDetails.aspx?articleID=133.  While the fundamentals of my application use the foundation of Azam's article, the final product is different enough from the article to make me include it here.

     First we need to create a GridView with the columns that we need.  For better control we will need to use TemplateFields.

     <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
        <Columns>
            <asp:TemplateField HeaderText="Field1">
                <ItemTemplate>
                    <asp:HyperLink ID="hlField1" runat="server" NavigateUrl='<%# FormatUrl(Eval("Field1"),Eval("Field2"),Eval("Field3")) %>' Text='<%# Eval("Field1") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Field2">
                <ItemTemplate>
                    <asp:Label ID="lblField2" runat="server" Text='<%# Eval("Field2") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Field3">
                <ItemTemplate>
                    <asp:Label ID="lblField3" runat="server" Text='<%# Eval("Field3") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>

    We also need to bind our data to the GridView.  In this specific case I am using an XML file.

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim oDs As New DataSet
        oDs.ReadXml(Request.PhysicalApplicationPath + "myFile.xml")
        GridView1.DataSource = oDs
        GridView1.DataBind()
    End Sub

    You will notice in my GridView that I am calling a function, FormatURL. In this specific implementation it is accepting 3 values that it will build into the string that it returns.

    Public Function FormatURL(ByVal str1 As String, ByVal str2 As String, ByVal str3 As String) As String
        Return "pagedetail.aspx?id1=" & str1 & "&id2=" & str2 & "&id3=" & str3
    End Function

    The only thing left to do is to retrieve the querystrings on the new page, pagedetail.aspx in this case.

    Dim str1 As String = Request.QueryString("id1")
    Dim str2 As String = Request.QueryString("id2")
    Dim str3 As String = Request.QueryString("id3")

    As you can see, with this basic outline, there is tremendous power in the GridView and what you can do with it using a minimal amount of coding.

    Friday, August 24 2007 by | 0 comment(s)
    Tagged as:

  22. Dynamic AJAX Slideshows

    The most recent version of the ASP.NET AJAX Control Toolkit came with a new control called SlideShow. This is a nifty little control that extends the ASP.NET image control into an AJAX slideshow. It uses a web service call to retreive the images of the slideshow. This web service call just returns an array of "AjaxControlToolkit.Slide".

    So in the example that comes with the toolkit, there are four or five hard coded images in the array. This really is not very useful in a real life scenario. Most of the time if you are displaying a slideshow, these images will need to be filled dynamically either through a database, or my flavor of choice, from the file system.

    What I wanted to be able to do was just add an image to my assigned photos directory, and have it automatically show up in my slideshow. No admin section, no file uploader, and no database.

    To do this I create a class called 'PhotoGallery' with a public shared function called 'GetSlides'. GetSlides returns as an array of "AjaxControlToolkit.Slide". This function goes out to my file system, returns all the files in the given directory, and adds them to the array. It really is that simple.

    I am sure there is a bit simplier way to do this, as far as the array. You can download my VB.NET class below.

    [ DOWNLOAD CODE ]

    Monday, April 30 2007 by | 0 comment(s)
    Tagged as: , , ,

  23. ASP.NET Team Releases ASP.NET AJAX 1.0

    It is finally here. The official release of ASP.NET AJAX 1.0.

    http://ajax.asp.net

    Update: As always, ScottGu has some great information about this release on his blog.

    Tuesday, January 23 2007 by | 0 comment(s)
    Tagged as: ,

  24. Pausing ASP.Net 2.0 Page


    For the most part, web pages load sequentially where pieces of code execute one right after the other.  Sometimes you need a page to stop for a predetermined amount of time while it waits for other tasks to complete.  An example of this is a web page that sends an email outside of your network which needs to wait while the email is sent, processed by the spam filter, checked by the anti-virus, and then processed by the mail server to show up in a mail box before the web page indicates whether the message was received.  As you know, this process can take over 30 seconds. 

    Before ASP.Net 2.0 it was possible to implement something like this, but it was either involved writing a bunch of code or using a third party component.  Now with ASP.Net 2.0 you can use the following:

    System.Threading.Thread.Sleep(xxx)

    This stops execution of the page for xxx number of milliseconds, so a value of 120000 would pause page execution for 2 minutes. 

    One thing to keep in mind is that this only pauses execution of the page and has no affect on IIS values.  IIS is generallly set to timeout after two minutes so you will get a timeout error if you don't also adjust the value for the web site in IIS.  In my testing I've found that three minutes is about the maximum that you should consider doing this for.  If you need to do it for a longer time then you should try looking at the problem you are trying to solve from a different angle.

    Thursday, January 04 2007 by | 0 comment(s)
    Tagged as:

  25. System.SecurityException Errors With ASP.NET 2.0

    This error is an issue that is often encounted, especially in shared hosting, and is due to a higher trust level in place on the shared hosting server in order to provide the best security to all the clients on the server.  In ASP.Net, a trust level defines what level of access your code has to the server.  Higher trust levels have more access to the server, while lower trust levels have less access providing more security between the separate applications. 

    Often the application that was created and worked properly on your local development machine doesn't work when you upload it to the shared hosting server and will throw this error.  This is because most local development machine run in Full Trust allowing your ASP.Net application unrestricted access to the machine.  It can do read files and folders outside of its own root, access the registry, and even write to the Windows event log.

    For obviously reasons a quality host will take steps to improve the security and stability of its shared servers and limit the access of each individual site.  It is fairly standard practice for shared hosting ASP.Net sites to be required to run under medium trust.  This does occasionally create some issues with executing certain code on the server but almost always there is a different way to accomplish the same task within the constraints of medium trust.

    Here is a link with more information on the restrictions of medium trust and also how to configure a server for medium trust that should make it easy for you to setup a development environment that will match the medium trust environment of a shared host.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/PAGHT000020.asp 

    Saturday, December 02 2006 by | 0 comment(s)
    Tagged as: