An assortment of ASP.NET, VB.NET, web development, and Windows XP tips-n-tricks.
Wednesday, December 15, 2004
VS.NET: Clean Web Form Templates
For a very good article on this, reference Milan Negovan's article, "Remastering Web Form Templates". His article points-out many of the frustrations of the VS.NET web form designer, and provides a link to a tool he created that can help you generate clean web form templates.
However, I find that going to his web site to use his tool wasn't likely going to happen (I'm too lazy!)... I wanted to know if I could modify the default VS.NET template so it always creates exactly what I want. I found the default ASPX web form template (VB) here:
C:\Program Files\Microsoft Visual Studio .NET 2003\Vb7\VBWizards\WebForm\Templates\1033\WebForm.aspx
I removed the default VS.NET specific meta tags and added my own, such as a copyright, author, etc. Need some help coming-up with the default META tags? Try AnyBrowser.com.
Tuesday, December 14, 2004
Sometimes Post-Back Isn't an Option
To solve this problem, I did a little research and found-out a nifty way to post form information from one ASP.NET page to another:
Server.Transfer("WebPostAway2.aspx", true)Although using Server.Transfer isn't new to me, I never knew about the second parameter, preserveForm! Setting preserveForm to True keeps all the post data intact as it's passed to the next ASPX page.
Friday, December 10, 2004
No More Ugly Submit Buttons
[CSS]For details on the original article: WebReference.com: Stylish Buttons
input.btn{
color:#050;
font-family:'trebuchet ms',helvetica,sans-serif;
font-size:84%;
font-weight:bold;
background-color:#fed;
border:1px solid;
border-top-color:#696;
border-left-color:#696;
border-right-color:#363;
border-bottom-color:#363;
filter:progid:DXImageTransform.Microsoft.Gradient
(GradientType=0,StartColorStr='#ffffffff',EndColorStr='#ffeeddaa');}
Thursday, December 09, 2004
Windows XP: Get That Crap Out of My System Tray!
- Install a shortcut in 1,700 places on my PC?
- Run at startup?
- Create a useless app that runs in my PC's system tray with no option to disable this feature?
As of recently, I was able to speed-up the boot-up time of PC a little by removing many of the links to the programs that thought they needed to run at start-up (and I didn't.) The hard way to do this is to go to Start > Run > Type in "MSCONFIG" > Startup Tab. From there, you can try and decifer what it is that is running on your PC when it boots-up. If you find some programs you think should not be run at startup, you can use the RegEdit tool to remove the entry in the Registry that starts that app.
However, there is an easier way (of course!) System Internals offers a free application called AutoRuns that is really easy to use, and makes removing unwanted start-up apps a breeze! Once the app runs, it lists all the applications that choose to run on start-up, and shows you who manufacturered the application. By right-clicking on the application, you can delete it or go directly to the spot in the Registry where the reference is located.
Warning: It is quite easy to remove programs your PC actually needs at start-up using either of the above methods! Do not even bother using this tool if you aren't a geek! ;)
Wednesday, December 08, 2004
Windows XP: No More Error Reporting!
To turn Error Reporting "Off":
- Right-click on the My Computer icon
- Select Properties from the menu
- Select the Advanced tab
- Click the Error Reporting button
- Select the Disable Error Reporting radio button
- Click OK and you're a happy-camper!
Tuesday, November 23, 2004
How to Disable IE AutoComplete in HTML Forms
Fortunately, there is a simple solution to this problem. Just add the AutoComplete attribute to either the <form> tag or the <input> tag:
<form AUTOCOMPLETE="OFF">... or...
<input type="text" name="name" AUTOCOMPLETE="OFF">
Sometimes the AutoComplete feature is a good thing, however, like in an Intranet environment where a user may have to enter the same information over and over. To better control this information as a web developer, the following article gives a good description of what you can do:
Developer's Dex: AutoComplete Feature of Internet Explorer
Tuesday, November 16, 2004
User.Config File
You can do the following in web.config:
<configuration>Then, create a file called user.config in the same folder as web.config, and paste the following code. Notice that there is no <configuration> tag:
<appsettings file="user.config">
<add key="Key" value="Value" >
</appsettings>
</configuration>
<appsettings>
<add key="Key" value="Override value" >
<appsettings>
Do not add the user.config file to the project. If there is no user.config in the same folder, then the web.config settings are used.
MSDN:Web Projects Source Control Integration In VisualStudioNET
Thursday, November 11, 2004
Yahoo! Mail POP Access... for Free!
Once you download and install the app, configuring Outlook 2003 is as follows:
- Select Tools -> Email accounts from the main menu
- Select Add a new email account and click on Next
- Select POP3 as the Server Type. Click Next
- Enter your username and full Yahoo! email address under 'User Information'
- Enter your Yahoo! Login id and password under 'Logon Information'
- Enter 'localhost' as your Incoming mail server
- Enter localhost as the SMTP server as your outgoing mail server
- Click on the More Settings button and select the Advanced tab
- Increase the Server Timeout to 'Long' (10 minutes)
- Select the Outgoing Server tab
- Enable "My outgoing server (SMTP) requires authentication". Select "Log on using" and enter your Yahoo Mail address as the username and your Yahoo Mail password as the password.
- Click Ok to close the More Settings dialog
- Click Next and then Finish
Can't Find get_asp_ver.aspx?
Microsoft suggests making a bogus get_asp_ver.aspx file, but many use this code in their global.asax.vb file which makes more sense to me than having a file in your site that does nothing:
Sub Application_BeginRequest(ByVal sender As Object, _
ByVal e As EventArgs)
Dim url As String = CStr(Request.ServerVariables("URL"))
If url.ToLower().IndexOf("get_aspx_ver.aspx") >= 0 Then
Response.End()
End If
End Sub
The ASPNET_regiis Tool
ASP.NET IIS Registration Tool
Debugging JavaScript
- Make sure script debugging is not disabled in Internet Explorer.
In MSIE: Tools > Internet Options... > Advanced > Uncheck "Disable Script Debugging (Internet Explorer)"
- Navigate to the page you wish to debug. The page doesn't have to be part of any VS.NET project, you can debug any web page you'd like.
- Open VS.NET. If you already have a ASP.NET project you are working on, open it. Otherwise, just open a new project which you will delete later.
- Start the VS.NET debugger (F5 or Debug > Start)
- In VS.NET, navigate to the Running Documents menu.
In VS.NET: Debug > Windows > Running Documents
The Running Documents menu should appear on the right. If the page you are debugging belongs to the project you are working on and is the page that is currently being debugged, it should already show-up in the running document list under "Microsoft Internet Explorer."
If not, you have to attach to the MSIE process of the window you would like to work with. To do that:
In VS.NET: Debug > Processes...
Find the instance if iexplorer.exe that relates to the page you wish to debug. If there are multiple instance, look at the Title column to find the page. Select the page and click the Attach... button, then Close. You should now see the selected web page show-up in the Running Documents menu.
- Double click on the web page you wish to debug in the Running Documents menu. This should open up the HTML of the page in a new window. Now set a break-point on the line of code you which to start debugging, and away you go!