ASP.Net
Posts specific to ASP.Net.
In this post, I talked about enabling or disabling a validator client-side. Someone had commented asking how to change the status of a control from valid to invalid. The following javascript works at least for required field validators, I haven't tested it with anything else (but I imagine it should work just fine). Again, this is 2.0, I haven't tested this in 1.1: var myValidator = document.getElementById('&l... For a required field validator...
One of the things I've been working on is how to use Atlas web services to verify actions on the server. So the client requests to perform a particular action on the server, and if they don't have access to perform that action or the action fails (because a database is down, or something along those lines), I don't want the method on the client to continue executing. The problem with that is that Atlas web service calls are asynchronous by nature (explained here and here). So I can't say something...
If you ever find yourself needing to selectively disable an asp.net validator through javascript, you can do the following (in 2.0, not sure if this exists in 1.x): function doSomething(){ var myVal = document.getElementById('my... ValidatorEnable(myVal, false); } Quick and easy! Sadly, not as easy to find through Google, so hopefully this post will help that. :)...
The problem: You want to have a web form with multiple checkboxes, and have some of them be enabled or disabled depending on whether a certain checkbox is checked (or radio button selected, or what have you). At first glance, this seems fairly simple; you can just do: <%=myCheckBox.ClientID%&... = false; in javascript. The problem comes when you, on the server side, disable the checkbox by default. (NB: this pertains to ASP.Net 2.0, it may work differently in 1.x). The problem is that...
In the helps for HtmlInputControl.Name (for .NET 2.0): Gets or sets the unique identifier name for the HtmlInputControl control. Later on, in that same help file: In this implementation, the get accessor returns the value of the Control.UniqueID property. However, the set accessor does not assign a value to this property. So then why say that it sets the property, if it doesn't actually set the property...
I was working on some sample stuff that I'll be posting later and ran into a problem. I had 2 different update panels; inside one was just a div, inside the other one was a repeater. Inside the repeater I had a bunch of checkboxes, and when I checked/unchecked them, I needed the first update panel to be updated. This posed a couple of problems: A checkbox doesn't have a CommandName property, and can't be used to trigger a Repeater's ItemCommand event This I got around by declaring the event handler...