Wednesday, 5 December 2007

Bring back wires

Yesterday I spoke about my successful transition from wired to wireless. Today, all is not well - my wireless gaming adapter can't be configured using Windows Vista. Belkin kindly provided me with software for installing the adapter. Unfortunately, Vista can't find the hardware during the setup process but any computer running XP has no problems. After repeatedly configuring it at a friend's house, I now know of a web interface (accessible from Vista :D). I spent about 2 hours speaking to Belkin's support staff trying to get it to work! Hopefully, I can help others who are having similar problems and can't find the solution without spending a ridiculous amount of time on the phone.

Here are the steps you should follow:
  • Disconnect from any wired/wireless networks

  • Connect the gaming adapter to your PC

  • Edit the TCP/IP properties for the Ethernet connection (Local Area Connection) - set the IP address to 192.168.2.100 (try not to conflict with any other network device), set the subnet mask to 255.255.255.0 (default), leave the default gateway blank and obtain the DNS server addresses automatically.

  • Navigate to http://192.168.2.225 in a web browser - this should load the web interface. From here, you can change the wireless settings such as SSID and encryption type. I'd recommend using WEP encryption although it depends on the router model. Because I have the new Belkin N1 Vision, they claim that is uses an advanced form of WPA encryption not compatible with the gaming adapter. Before you save the changes, make sure the device will obtain an IP address from the DHCP server automatically (there is an option on the same setup page).


  • This is a great solution but why couldn't they include the information in the box!? I only found out after calling their support line - the online help wasn't very impressive.

    The interface is also used to perform firmware updates - something you'll need to do if your network has WPA encryption.

    Tuesday, 4 December 2007

    No more wires

    After buying a new laptop, a NAS drive and a wireless gaming adapter, I decided to splash out again and increase the performance of my network. Poor transfer rates between the laptop and NAS drive made it almost impossible to utilise it's full potential.

    I always favoured Linksys hardware but I've now converted to using products made by Belkin. I chose the Belkin N1 Vision router because it offers up to 300Mbps transfers which is perfect for a network with NAS drives.

    The first stage was the installation of a new internal network card for the laptop. When I bought it, I went for the cheaper alternative which doesn't support the IEEE 802.11n draft specification (something I would later regret). Alienware provided me with the new card (at an additional £30) and instructions for carrying out the upgrade myself.

    The second stage was more simple - setting up the new router. Luckily, the router has a very easy-to-use wizard and it was up and running in no time. I even managed to keep all my old static IP addresses for the laptop, NAS drive and Xbox.

    After only a few minutes, I started to see the difference. I can now transfer high volumes of data in a fraction of the time. I would highly recommend the N1 Vision to anyone looking to increase their network range and speed.

    Ghost button alternative

    Following on from my previous post about Ghost Buttons, I've now found a much easier and efficient alternative.

    ASP.NET 1.x:
    btnTest.Attributes.Add( "onclick", "javascript:this.disabled = true; " + GetPostBackEventReference( btnTest ) );

    ASP.NET 2.0:
    btnTest.Attributes.Add( "onclick", string.Format( "javascript:this.disabled = true; {0}", ClientScript.GetPostBackEventReference( btnTest, "" ) ) );

    Advantages:

    • You only need a handle to the control instead of the ID - sometimes these can get complicated if controls are placed inside other controls

    • There is less code

    • Only a single control is ouputted - this could mean a performance increase compared to using Ghost Buttons

    Disadvantages:

    • The code will need to be recompiled to make any changes to the click event

    Ghost buttons

    How do you disable a server-side button after it has been clicked to prevent subsequent clicks whilst the page is doing a postback?

    I'm sure your first response is similar to my initial answer; add the attribute, onclick="this.disabled = true;" to the button. Unfortunately, this can't be applied to a server-side button because it also disables any postback events.

    As a workaround, I added a duplicate HTML button to the page. It is important that the server-side button has an extra attribute; style="display: none;". This prevents it from being rendered to the browser but will still exist in the source code. You may be thinking that Visible="false" would do the same but this prevents the control from creating any output at all. The HTML button is the visible replacement but when clicked, it will trigger the click event of the server-side button or "Ghost Button".

    <input type="button" onclick="this.disabled = true; btnTest.click" value="Test">
    <asp:Button ID="btnTest" runat="server" style="display: none" />

    AOL, MTU... WTF???

    This week I helped a friend install a wireless network in their home using their AOL Broadband connection. They purchased a Belkin ADSL2+ Modem with Wireless-G Router, I configured it using their username and password and enabled wireless security. All seemed well until I got a call a few days later. Their 2 computers both had connections to the internet but they were unable to view certain URLs like Hotmail, MySpace or any of Belkin's websites to get support! Eventually (with help from a friend), I found out that something called MTU was causing the problem. The router's MTU was set to 1342 but for AOL Broadband, it has to be 1450. The MTU can be changed using the router's web interface. For this model, it can be found by going through the steps for setting up the connection type.

    Form button focus

    Annoyingly, when a form element gets focus in IE, the respective submit button changes slightly. Combine this with custom styles for buttons and they gain a black border:


    Any ideas?

    DefaultButton

    When entering data into a web form, users often press the Enter key instead of clicking on a submit button. Classic HTML pages can have multiple forms, each having a separate submit button. This means that when a control gets focus in the first form, the page will automatically trigger the respective event if the user presses the Enter key.

    ASP.NET pages can only contain one server-side Form tag where all server-side controls must be defined. This only becomes a problem when a page requires several form sections. For example, a page might include two form sections; search and log in. If these both have their own submit buttons and are defined in the same server-side Form tag, how does the page know which event should be triggered when the user presses the Enter key? Normally the first button on the page takes precedence or nothing happens at all.

    To assign default buttons to each form section, simply place them (and any other related controls) inside a PlaceHolder control and set the DefaultButton attribute to the respective button ID.
    <asp:Panel DefaultButton="btnSubmit" runat="server"> 
    <asp:TextBox ID="tbName" runat="server" />
    <asp:Button ID="btnSubmit" runat="server" Text="Submit" />
    </asp:Panel>

    This rule is not applicable to the LinkButton control (unless in IE).