Set Default Button

Arti

New Member
I cannot find a way to set the default button if it isn't the first button on the page after all of the text boxes. I can set the focus to it, but if I already have to set focus to text boxes, then I can't do both. We are working with web forms, not windows forms so I can't Import the Windows.Forms namespace and use the IsDefault property.....This seems like it should be easy but we can't find it.Try putting this in your page load sub:<BR><BR>Page.RegisterHiddenField("__EVENTTARGET", "ButtonName")<BR><BR>I haven't tried this yet. Please let me know how it turns out.<BR><BR>ShaneI've tried this already, it seems to do nothing unless I'm missing something else in my code that should go with it. Any other ideas? Please, Please.......I use the following in client side script tags<BR>document.Form1.btnSave.setActive()<BR>Actually I trap the enter key so that I can set my save button as the active element and thereby do what most people expect and that is to save their data.<BR><BR>hth<BR>mattI'll try it, thanks
 
Back
Top