04-27-2010 07:09 AM
05-10-2010 08:20 AM
you can add on each input control an "Attribute" (control.Attributes.Add(event, jscript))
yourtextboxcontrol.Attributes.Add("onblur","Alert('Fires when you leave the control');");
05-25-2010 10:29 AM
It makes the Development cycle a lot longer.
- Deploy your site without Compilation
- Write your javscript (put it on a linked file), not directly on the form.
- Figure out the code needed to associate Events to your Controls.
Once you have figured it all out and tested it, then:
- On your Form, add a Load action where you add code for:
b) Associate your controls and Events.
I typically run on the form code to create Java variables containing references to the controls (again, keeping in mind that thay are composite controls and knowing which internal item to choose from):
e.g. string scr = "var objStatusPicklist = document.getElementById('" + plStatus.ClientID + "_TXT');";
Then, on the script file, I have an OnReady function that associates my Event, the Custom Handler, My Add event handler function, etc
So, it is doable; but I would only do it for Presentation purposes, I wouldn't do all actual development this way. (Otherwise, testing every change would require to do a Build and Redeploy, taking hours to do what could be done in minutes).