Ask a Question related to ASP.NET General, Design and Development.
-
bruce barker #1
Re: Checkbox and Radiobutton onfocus events
you have to attach the events with client script.
string s =
string.Format("<script>document.getElementById('{0 }').onfocus=function(){ale
rt('goit');}</script>",MyCheckbox.UniqueId);
RegisterStartupScript("MyCheckBox",s);
-- bruce (sqlwork.com)
"Paul" <qwe@qwe.com> wrote in message
news:0e9101c35134$d4bab160$a501280a@phx.gbl...> Hi
>
> I need to set up the onfocus event for a checkbox and
> radiobutton server control from the codebehind page. I am
> trying something like:
>
> this.MyCheckbox.Attributes.Add("onfocus", "alert
> ('gotit');");
>
> or
>
> this.MyCheckbox.Attributes["onfocus"] = "alert
> ('gotit');");
>
> but neither work.
>
> As you can see in the generated code the onfocus seems to
> apply to a span tag, not directly to the controls
> themselves:
>
> <span onFocus="alert('gotit');"><label
> for="MyCheckbox">test</label><input id="MyCheckbox"
> type="checkbox" name="MyCheckbox" /></span>
>
> Identical code works for text boxes and list boxes, but
> not for checkboxes or radiobuttons (or groups). I know
> HTML supports the onfocus event for these two controls.
>
> Any ideas?
>
> Thanks, Paul.
>
bruce barker Guest
-
Custom ListControl OnFocus Event not working
Hey All, I have created a custom control that initially shows a textbox. After the user has typed something in the TextBox a DropDownListbox is... -
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked.
I am trying to update the database field when the checkbox is clicked. I am trying to modified the following solution but.. got stuck on the... -
Handling events for Checkbox in Data Grid
(Type your message here) -------------------------------- From: Abhijit Salvi Hi All, I am working on a DataGrid that has a column of... -
trouble with onFocus - Please help me!
Thank you very very much! -
Checkbox in DataGrid Not Firing OnCheckedChanged events.
Hi There, I have a datagrid with the following template column definition: <asp:TemplateColumn HeaderText="Select"> <ItemTemplate>...



Reply With Quote

