Click here to Skip to main content
       

ASP.NET

 
AnswerRe: Problem With List View PinmemberParwej Ahamad22-Nov-12 6:08 
GeneralRe: Problem With List View Pinmemberd0cvb22-Nov-12 10:28 
GeneralRe: Problem With List View PinmemberParwej Ahamad22-Nov-12 18:35 
QuestionChecking the size of a cookie Pinmembersuzyb22-Nov-12 1:46 
AnswerRe: Checking the size of a cookie PinmemberZaf Khan23-Nov-12 6:04 
GeneralRe: Checking the size of a cookie Pinmembersuzyb23-Nov-12 9:49 
GeneralRe: Checking the size of a cookie PinmemberZaf Khan23-Nov-12 11:43 
QuestionRemove tick/check box from ASP.NET Checkbox control Pinmemberthes@int21-Nov-12 6:48 
Hello guys !
 
I have this CheckBoxList control and to each ListItem of it, have set the Text property to the img HTML tag so it displays an image.
 
I am trying to remove the tick/check box from the checkboxes of a ASP.NET CheckBoxList control when i click on each item.
 
My code does this. Every time i click on some check box, the **SelectedIndexChanged** event fires up and it does some saving of some data in my database. And when the saving is done and the page is refreshed i want to check/tick box of the checkbox item that was clicked not to be there anymore and the checkbox to be disabled cause i don't want the user to able able to click it again. I have tried to tried to set the Enable and Selected properties to False, and also add an attribute to the CheckboxList control, but without success. Here is my code.
 

<asp:CheckBoxList ID="Services" runat="server" RepeatColumns="5" CellPadding="10"             
    CellSpacing="15" RepeatLayout="Table" 
                             Font-Size="Large" RepeatDirection="Vertical" TextAlign="Right" 
    AutoPostBack="true" EnableViewState="true">
 
    <asp:ListItem Value="Facebook" Text="<img src='/ServiceIcons/facebook.png'  
    title='Facebook' />" />
    <asp:ListItem Value="Googleplus" Text="<img src='/ServiceIcons/googleplus.png' 
    title='Google+' />" />
    <asp:ListItem Value="LinkedIn" Text="<img src='/ServiceIcons/linkedin.png' 
    title='LinkedIn' />" />
    <asp:ListItem Value="RSS" Text="<img src='/ServiceIcons/rss.png' title='RSS' />" />
    <asp:ListItem Value="Skype" Text="<img src='/ServiceIcons/skype.png' title='Skype' />" 
    />
                
    </asp:CheckBoxList>
 

And in the code behind i do this:
 
Private Sub Services_SelectedIndexChanged(ByVal sender As Object, ByVal e As 
      System.EventArgs) Handles Services.SelectedIndexChanged
        
           -----Storing to database code here------
 
            Services.Items(Services.SelectedIndex).Enabled = False
            Services.Items(Services.SelectedIndex).Attributes.Add("class", 
            "displayCheckBox")
            Services.Items(Services.SelectedIndex).Selected = False
        
 
      End Sub
 
And the css class here:
 
.displayCheckBox input{background:Green;}
 
After the the event does the storing in the databse, page refreshed the checkbox that was selected is disabled but it shows the tick/check box, and i don't want it to show it if is selected.
 
Any one has an idea. I have searched a lot, but it seems that the CheckBoxList control doesn't provide much costumizing options.
 
Thank you in advance !
AnswerRe: Remove tick/check box from ASP.NET Checkbox control Pinmemberjkirkerx21-Nov-12 12:46 
Questionweb service creation PinmemberMember 961924321-Nov-12 6:17 
AnswerRe: web service creation Pinmembermark merrens21-Nov-12 6:24 
QuestionReturn multiple result set to Generic List Pinmemberyesu prakash20-Nov-12 23:38 
AnswerRe: Return multiple result set to Generic List PinmemberDavid Mujica21-Nov-12 3:14 
QuestionButtons are not working for enterkey press Pinmemberrakeshs31220-Nov-12 22:27 
AnswerRe: Buttons are not working for enterkey press Pinmemberjkirkerx22-Nov-12 18:03 
QuestionSchedule and post comments to FaceBook wall using ASP.Net [modified] PinmemberHu Dhaval20-Nov-12 21:56 
AnswerRe: Schedule and post comments to FaceBook wall using ASP.Net PinmemberDhol Gaurav20-Nov-12 22:24 
GeneralRe: Schedule and post comments to FaceBook wall using ASP.Net [modified] PinmemberHu Dhaval20-Nov-12 22:32 
AnswerRe: Schedule and post comments to FaceBook wall using ASP.Net PinmemberRichard Deeming21-Nov-12 2:10 
QuestionCOMPILATION error "object reference not set to an instance of an object" PinmemberAnnLogan20-Nov-12 20:47 
QuestionRe: COMPILATION error "object reference not set to an instance of an object" Pinmembern.podbielski20-Nov-12 21:11 
AnswerRe: COMPILATION error "object reference not set to an instance of an object" PinmemberAnnLogan20-Nov-12 21:49 
GeneralRe: COMPILATION error "object reference not set to an instance of an object" PinmvpRichard MacCutchan21-Nov-12 3:16 
AnswerRe: COMPILATION error "object reference not set to an instance of an object" Pinmembern.podbielski22-Nov-12 20:07 
QuestionTab index with firefox issue Pinmemberrakeshs31220-Nov-12 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.140926.1 | Last Updated 1 Oct 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid