Tuesday, January 29, 2008

Javascript Object Visibility

Hey all,

I am trying to do some error checking in my javascript code and I have ran across an issue with the visibility of an object.

I am hiding an object on the page using document.getElementById('objectname').style.display = 'none';

When I go to see if it exists using the code below (the object IS not visible on the screen at the time), nothing happens

if(document.getElementById('objectname').style.visibility == 'hidden')
{
alert('message');
}


I have also used with no avail:


if(document.getElementById('objectname').style.display == 'none')
{
alert('message');
}

Any ideas?

browser for debugging in Visual Studio

Anyone know if you can set the specific browser for VS to use when it runs the debugger? I can't remember but I thought I had set it to IR even though my default browser is Firefox.

Friday, January 11, 2008

Max Length for Text Boxes

I know a while back that we had mentioned putting MaxLength values on all text boxes to prevent OverFlow Exceptions.

I would like to get opinions on certain Text Box values and what we could use as a MaxLength in these cases:

Common Dollar Figures: since these include a decimal sometimes they may require a larger MaxLength Correct? What do we think a typical MaxLength would be in this situation?

Integer Amounts: Since a MaxLength of 9 here and a MaxLength of 9 in a Currency field are different, this could cause for Overflow Errors. 999999999 (Overflow) is much larger than 999999.99 (No OverFlow) (MaxLength 9 TextBox example)

Percentage amounts? Im thinking 4 MaxLength but what do you all think?

Obviously in certain situations:

Question directed at Sidney Crosby: "How much money did you sign your contract for?" Would be at the programmer's discretion.

Thanks for reading!

Bills Fan Dave

C# method documentation

Maybe you have known about this, but I just found that you could put this before a method.
/// <summary></summary>
/// <param name="field"></param>
/// <param name="msg"></param>
/// <param name="min"></param>
/// <param name="max"></param>
/// <param name="validator"></param>
/// <returns></returns>

I just put this before my method "isValidIntegerRng".
/// <summary>
/// check if an integer field is valid and within range, the field is optional
/// </summary>
When I made the call to this method, I wasn't sure if the field is optional or not. This way you can hover over the method call and see the comment so you don't need to open the class to see it.

Thursday, January 10, 2008

What does "hth" mean?

Team,

As I google for answers to my coding questions, I notice that when people end their blog entries they use the abbreviation "hth".

I have always been perplexed by this. What does it stand for?

Bills Fan Dave

Wednesday, January 9, 2008

Session State (Web.Config)

Does anyone know how to programmatically change the web.config's timeout property for Forms Authentication?

I have a few different seminar types and only one of them gets a 30 minute timeout the others are 60 minute timeouts.

I tried this:

if (seminarcode == 2)
{
Session.Timeout = 1; (for testing purposes)
}

This only sets it so that the page timesout after 1 minute of no use where I want to make everything cease after a minute no matter what the user does.

I thought I had the answer but it appears I do not.

PLEASE HELP!

also... what does "hth" mean?

Dave

Monday, January 7, 2008

New Tortoise

Has anyone upgraded to the new version of Tortoise SVN yet? Any issues with it if so?

Wednesday, January 2, 2008

sanitize data


Welcome back everyone! Here is an enjoyable little comic for you all:

From http://xkcd.com/327/