Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.NET Checkboxes

Reply
Thread Tools

ASP.NET Checkboxes

 
 
Tracey
Guest
Posts: n/a
 
      07-23-2003
Thanx M, and I mean that, but I really need this to work
without a postback and frankly it should behave like the
other controls are behaving (correctly). This smells like
a bug to me and I just wanted to get some sort of
confirmation from the field or refutation with some sort
of an explaination. Can you reproduce the problem? I have
found a way around it for now by encasing the checkboxes
in an <asp:Table> then disabling/enabling the table
instead, which thankfully works. Thanx again M.

>-----Original Message-----
>hi Tracey
>
>try seting 'AutoPostBack' property for the controls to

true and then try
>again. your code will look somethnig like this
>
><form id="frmTest" method="post" runat="server">
>
><asp:CheckBox ID="chkTest" Runat="server" Enabled="False"

Text="chkTest"
>AutoPostBack="True"></asp:CheckBox>
>
><asp:TextBox ID="txtTest" Runat="server" Enabled="False"
>>txtTest</asp:TextBox>

>
><asp:CheckBox ID="chkTryIt" Runat="server" Enabled="True"

Text="chkTryIt"
>AutoPostBack="True"></asp:CheckBox>
>
></form>
>
>M
>
>"Tracey" <(E-Mail Removed)> wrote in message
>news:00f301c35133$d6f1ab10$(E-Mail Removed)...
>> I have found that the <asp:checkbox> control is not
>> respecting the disabled attribute while the

<asp:textbox>
>> and other controls are respecting it. Does anybody know

if
>> this is a known bug and if so, what it's number is? Can
>> anybody else reproduce this problem? I've included some
>> simple code below. Here is the Form:
>>
>> <form id="frmTest" method="post" runat="server">
>>
>> <asp:CheckBox ID="chkTest" Runat="server"

Enabled="False"
>> Text="chkTest"></asp:CheckBox>
>>
>> <asp:TextBox ID="txtTest" Runat="server"
>> Enabled="False">txtTest</asp:TextBox>
>>
>> <asp:CheckBox ID="chkTryIt" Runat="server"

Enabled="True"
>> Text="chkTryIt"></asp:CheckBox>
>>
>> </form>
>>
>> And here is some client side script used to flip flop
>> between enabled and disabled. Notice how the textbox
>> respects the disabled attribute, but for some reason the
>> checkbox doesn't?
>>
>> Sub chkTryIt_OnClick
>>
>> document.getElementById("chkTest").disabled = _
>> (document.getElementById("chkTryIt").checked = False)
>>
>> document.getElementById("chkTest").checked = _
>> (document.getElementById("chkTryIt").checked = True)
>>
>> document.getElementById("txtTest").disabled = _
>> (document.getElementById("chkTryIt").checked = False)
>>
>> End Sub
>>

>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.502 / Virus Database: 300 - Release Date:

7/18/2003
>
>
>.
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes with Repeaters and DataGrids Fresh Air Rider ASP .Net 0 03-05-2004 10:12 PM
Re: Checkboxes in a datagrid S. Justin Gengo ASP .Net 7 08-16-2003 02:15 AM
Huge number of checkboxes to be populated from database Mike Lerch ASP .Net 3 08-06-2003 01:31 PM
Datagrids with checkboxes and postbacks... Gavin ASP .Net 2 07-30-2003 09:29 AM
ViewState Problem with CheckBoxes in a DataGrid kannadasan ASP .Net 1 06-25-2003 06:43 AM



Advertisments