Click here to Skip to main content
11,413,676 members (74,003 online)
   

ASP.NET

 
AnswerRe: Problem With List View Pin
Parwej Ahamad, 22-Nov-12 7:08
memberParwej Ahamad22-Nov-12 7:08 
GeneralRe: Problem With List View Pin
d0cvb, 22-Nov-12 11:28
memberd0cvb22-Nov-12 11:28 
GeneralRe: Problem With List View Pin
Parwej Ahamad, 22-Nov-12 19:35
memberParwej Ahamad22-Nov-12 19:35 
QuestionChecking the size of a cookie Pin
suzyb, 22-Nov-12 2:46
membersuzyb22-Nov-12 2:46 
AnswerRe: Checking the size of a cookie Pin
Zaf Khan, 23-Nov-12 7:04
memberZaf Khan23-Nov-12 7:04 
GeneralRe: Checking the size of a cookie Pin
suzyb, 23-Nov-12 10:49
membersuzyb23-Nov-12 10:49 
GeneralRe: Checking the size of a cookie Pin
Zaf Khan, 23-Nov-12 12:43
memberZaf Khan23-Nov-12 12:43 
QuestionRemove tick/check box from ASP.NET Checkbox control Pin
thes@int, 21-Nov-12 7:48
memberthes@int21-Nov-12 7: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 Pin
jkirkerx, 21-Nov-12 13:46
memberjkirkerx21-Nov-12 13:46 
Questionweb service creation Pin
Member 9619243, 21-Nov-12 7:17
memberMember 961924321-Nov-12 7:17 
AnswerRe: web service creation Pin
mark merrens, 21-Nov-12 7:24
membermark merrens21-Nov-12 7:24 
QuestionReturn multiple result set to Generic List Pin
yesu prakash, 21-Nov-12 0:38
memberyesu prakash21-Nov-12 0:38 
AnswerRe: Return multiple result set to Generic List Pin
David Mujica, 21-Nov-12 4:14
memberDavid Mujica21-Nov-12 4:14 
QuestionButtons are not working for enterkey press Pin
rakeshs312, 20-Nov-12 23:27
memberrakeshs31220-Nov-12 23:27 
AnswerRe: Buttons are not working for enterkey press Pin
jkirkerx, 22-Nov-12 19:03
memberjkirkerx22-Nov-12 19:03 
QuestionSchedule and post comments to FaceBook wall using ASP.Net [modified] Pin
Hu Dhaval, 20-Nov-12 22:56
memberHu Dhaval20-Nov-12 22:56 
AnswerRe: Schedule and post comments to FaceBook wall using ASP.Net Pin
Dhol Gaurav, 20-Nov-12 23:24
memberDhol Gaurav20-Nov-12 23:24 
GeneralRe: Schedule and post comments to FaceBook wall using ASP.Net [modified] Pin
Hu Dhaval, 20-Nov-12 23:32
memberHu Dhaval20-Nov-12 23:32 
AnswerRe: Schedule and post comments to FaceBook wall using ASP.Net Pin
Richard Deeming, 21-Nov-12 3:10
memberRichard Deeming21-Nov-12 3:10 
QuestionCOMPILATION error "object reference not set to an instance of an object" Pin
AnnLogan, 20-Nov-12 21:47
memberAnnLogan20-Nov-12 21:47 
QuestionRe: COMPILATION error "object reference not set to an instance of an object" Pin
n.podbielski, 20-Nov-12 22:11
membern.podbielski20-Nov-12 22:11 
AnswerRe: COMPILATION error "object reference not set to an instance of an object" Pin
AnnLogan, 20-Nov-12 22:49
memberAnnLogan20-Nov-12 22:49 
GeneralRe: COMPILATION error "object reference not set to an instance of an object" Pin
Richard MacCutchan, 21-Nov-12 4:16
mvpRichard MacCutchan21-Nov-12 4:16 
AnswerRe: COMPILATION error "object reference not set to an instance of an object" Pin
n.podbielski, 22-Nov-12 21:07
membern.podbielski22-Nov-12 21:07 
QuestionTab index with firefox issue Pin
rakeshs312, 20-Nov-12 20:43
memberrakeshs31220-Nov-12 20: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
Web03 | 2.8.150427.2 | Last Updated 27 Apr 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid