Friday, June 02, 2006

Internet Explorer Bugs and our commas

It is always good to read this page if you are a web developer:
We've come to this when we are debugging our web apps, which we found very strange behavior whereby the ASP.NET textbox controls are giving us a comma, and a few more if we are duplicating HTML elements on the fly on the client side.
Well, although we've replaced the id of those elements, the fact is that, IE goes by the name attributes for form submission.

And even more funny is that if you have an element having different ID but same name, try to do a alert(document.getElementById("theid").id); on both element, you might be surprised with the result.

Show my DIV on top of drop down list

For web developers, this is the one that you should read!

Fortunately, FireFox doesn't have this problem and even better is that IE7 fixed it.

"Click to activate this control!"

Notice that when you surf to a site with active content, say flash/java applet, you'll always need to "click to activate this control". As developer, these 2 links will be useful for you.

Monday, February 27, 2006

WebResource.axd Caching

While I'm hunting around to see how I can improve the bandwidth while I've used WebResource.axd embeded resource files extensively, it seems like the cache-control is always put as "private" which means it never get cached! even in the same page!

That's really a performance penalty.

After using fiddler to find out the fact, still don't have any clue since the AssemblyInfo's WebResource method doesn't give any option to caching customization. Thanks to Google again, I've got to Rick Strahl's WebLog on the issue of webresource.axd caching.

Basically, what happen is that when the library is compiled in debug mode, the caching is private (that means no caching) but while compiled in production mode, it will be public. Thank God, that means my codes will simply get its performance up when I switch over to production compilation.

Caveats about System.Diagnostics.StackTrace

This is a good site:

While I'm looking into self reporting of stack tracing of line from my framework, so that I can easily trace back to the line w/o throwing out unfriendly error message to surfer, use the stack trace class! .NET Rocks!

This is the codes I'ved used:
Dim sbMessage As New Text.StringBuilder
sbMessage.AppendFormat("Originating Host:{0}" & vbCrLf, System.Web.HttpContext.Current.Server.MachineName)
sbMessage.AppendFormat("User Host: {0}({1})" & vbCrLf, System.Web.HttpContext.Current.Request.UserHostName, System.Web.HttpContext.Current.Request.UserHostAddress)
sbMessage.AppendFormat("RawUrl : {0}" & vbCrLf, System.Web.HttpContext.Current.Request.RawUrl)
sbMessage.Append("Stack Trace:" & vbCrLf)
Dim st As New StackTrace(True)
For Each stEntry As StackFrame In st.GetFrames
sbMessage.Append(stEntry.ToString & vbCrLf)

Subsequently, send it to your mailbox using System.Net.Mail.SmtpClient(), and you've got your own error reporting machanism.

Monday, January 02, 2006

SQL Management Studio Small Bug

Found one little bug on SQL Management Studio, but not important at all though.

Try this to reproduce:
1. Create/edit a table using management studio
2. at the Data type column, type "varchar(10)"
3. Press tab.