The built in options for validating an email address didn’t include any way to validate phone numbers that include extension numbers.
Here is a regular expression that does this:
(((d{3}) ?)|(d{3}-))?d{3}-d{4}( xd{0,})?
The built in options for validating an email address didn’t include any way to validate phone numbers that include extension numbers.
Here is a regular expression that does this:
(((d{3}) ?)|(d{3}-))?d{3}-d{4}( xd{0,})?
I have been waiting to see a nice autolookup control that has more features that the current ASP.NET AJAX control offers.
This control is pretty close. I would rather not use the Anthem.net library if possible, but this control looks good.
I recently migrated one of the web applications I work on frequently to make use of the newly released ASP.NET AJAX toolkit.
In order to make this work, a bunch of changes were needed in the web.config. So many in fact that I decided to merge my web.config file into theirs, rather than vice versa.
After all was done and working, we started getting a few javascript errors in stuff unrelated to any ajax controls.
After some investigation I relized that the naming convention for controls had changed.
Controls that used to be named ASDF:ZXCV were now named ASDF_ZXCV.
So in some instances we had javascript looking for elements where the element name was hard coded as “ASDF:ZXCV”. Of course the correct way to get the element name is to use the ClientId property of the control, but that was not used 100% of the time on our site.
The problem is that when I upgraded the application from .Net 1.1 to a .Net 2.0 web application project, the upgrade tool included an item in the web.config file that was intended to ease the transition.
<xhtmlConformance mode="Legacy"/>
In ASP.NET 2.0, by default all rendered content is well formed XHTML. This was different from ASP.NET 1.1. By setting the xhtmlConformance mode to Legacy, it would not force the output to be XHTML compliant.
Another effect that this has, is the naming of controls. When Legacy is turned on, control hierarchies are separated by a colon “:”. In standard mode, they are separated by a dollar sign “$” in the name property, and an underscore “_” in the ID property.
This can be seen if you use reflector on the control class, you can see this:
internal char IdSeparatorFromConfig
{
get
{
if (!this.EnableLegacyRendering)
{
return '$';
}
return ':';
}
}
In 99% of the places where we reference asp.net generated code, we relied on the ClientId property, so we had no problems. But in that 1% of places where we took the shortcut of hard coding in the element, we got JS errors.
This site has some pretty cool links to sites that offer AJAX and DHTML snips and classes.
For example, and pretty cool little Poll thing I might convert from PHP to asp.net/XML:
http://www.dhtmlgoodies.com/index.html?whichScript=ajax-poller
Here is the original source of this tip.
“for some bizarre reason, you have to set HtmlEncode=false on a bound column in a gridview, to get the DataFormatString to work. “
Lucene.Net is another document index search engine.
You can point it at some files, office, pdf, rtf, html, and it will index them and provide a nice google-like results page.
Here is an interesting list of the top 10 things people do wrong when using AJAX.
http://weblogs.asp.net/mschwarz/archive/2006/11/20/the-top-10-mistakes-when-using-ajax.aspx
A while back I was looking at the AJAX toolkit page (http://ajax.asp.net/ajaxtookit) and I was really not impressed with anything I saw.
Things like the “Confirm” button, which is basically a button with 10 seconds of javascript coding built into it isn’t a big deal, IMO.
But their list of controls has really grown and there are some really interesting things in that toolkit.
It still boggles my mind that they don’t have an autocomplete dropdown list where your selections are LIMITED to the choices from the list.
ASP.NET has this thing where pressing Enter on a page will cause it to be submitted, but no submit action is taken, mostly because you can have multiple buttons on a page, and it isn’t sure which button it should consider clicked when you press enter.
The solution to this was the “__EVENTTYPE” field. Click here for more info on __EVENTTYPE.
Thankfully ASP.NET 2.0 has introduced some new features to help remove this complexity.
Scott Gu blogs about the new form defaultButton property, as well as the new SetFocusOnError property of the validators here:
http://weblogs.asp.net/scottgu/archive/2005/08/04/421647.aspx
A while ago, maybe 3 months, my blog stopped remembering my login. When I login I can click to have it remember my login, and thus when I return to the site I don’t have to login every time.
Well I finally arrived at the problem.
In IIS settings for the website, under the ASP.NET tab, if you click the “Edit Configuration” button, and then the authentication tab, you have the option to set the expiration length for the cookie, which was set to 1 hour.
I changed it to a larger value, restarted the IIS processes, and it appears to be working great now!