Click here to Skip to main content
15,890,845 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Problem With List View Pin
Parwej Ahamad22-Nov-12 6:08
professionalParwej Ahamad22-Nov-12 6:08 
GeneralRe: Problem With List View Pin
d0cvb22-Nov-12 10:28
d0cvb22-Nov-12 10:28 
GeneralRe: Problem With List View Pin
Parwej Ahamad22-Nov-12 18:35
professionalParwej Ahamad22-Nov-12 18:35 
QuestionChecking the size of a cookie Pin
suzyb22-Nov-12 1:46
suzyb22-Nov-12 1:46 
AnswerRe: Checking the size of a cookie Pin
Zaf Khan23-Nov-12 6:04
Zaf Khan23-Nov-12 6:04 
GeneralRe: Checking the size of a cookie Pin
suzyb23-Nov-12 9:49
suzyb23-Nov-12 9:49 
GeneralRe: Checking the size of a cookie Pin
Zaf Khan23-Nov-12 11:43
Zaf Khan23-Nov-12 11:43 
QuestionRemove tick/check box from ASP.NET Checkbox control Pin
thes@int21-Nov-12 6:48
thes@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.NET
<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:

VB
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:

CSS
.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
jkirkerx21-Nov-12 12:46
professionaljkirkerx21-Nov-12 12:46 
Questionweb service creation Pin
Member 961924321-Nov-12 6:17
Member 961924321-Nov-12 6:17 
AnswerRe: web service creation Pin
R. Giskard Reventlov21-Nov-12 6:24
R. Giskard Reventlov21-Nov-12 6:24 
QuestionReturn multiple result set to Generic List Pin
yesu prakash20-Nov-12 23:38
yesu prakash20-Nov-12 23:38 
AnswerRe: Return multiple result set to Generic List Pin
David Mujica21-Nov-12 3:14
David Mujica21-Nov-12 3:14 
QuestionButtons are not working for enterkey press Pin
rakeshs31220-Nov-12 22:27
rakeshs31220-Nov-12 22:27 
AnswerRe: Buttons are not working for enterkey press Pin
jkirkerx22-Nov-12 18:03
professionaljkirkerx22-Nov-12 18:03 
QuestionSchedule and post comments to FaceBook wall using ASP.Net Pin
Hu Dhaval20-Nov-12 21:56
Hu Dhaval20-Nov-12 21:56 
AnswerRe: Schedule and post comments to FaceBook wall using ASP.Net Pin
Dhol Gaurav20-Nov-12 22:24
professionalDhol Gaurav20-Nov-12 22:24 
GeneralRe: Schedule and post comments to FaceBook wall using ASP.Net Pin
Hu Dhaval20-Nov-12 22:32
Hu Dhaval20-Nov-12 22:32 
AnswerRe: Schedule and post comments to FaceBook wall using ASP.Net Pin
Richard Deeming21-Nov-12 2:10
mveRichard Deeming21-Nov-12 2:10 
QuestionCOMPILATION error "object reference not set to an instance of an object" Pin
AnnLogan20-Nov-12 20:47
AnnLogan20-Nov-12 20:47 
QuestionRe: COMPILATION error "object reference not set to an instance of an object" Pin
n.podbielski20-Nov-12 21:11
n.podbielski20-Nov-12 21:11 
AnswerRe: COMPILATION error "object reference not set to an instance of an object" Pin
AnnLogan20-Nov-12 21:49
AnnLogan20-Nov-12 21:49 
GeneralRe: COMPILATION error "object reference not set to an instance of an object" Pin
Richard MacCutchan21-Nov-12 3:16
mveRichard MacCutchan21-Nov-12 3:16 
AnswerRe: COMPILATION error "object reference not set to an instance of an object" Pin
n.podbielski22-Nov-12 20:07
n.podbielski22-Nov-12 20:07 
QuestionTab index with firefox issue Pin
rakeshs31220-Nov-12 19:43
rakeshs31220-Nov-12 19:43 

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

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