How to prevent changes to CheckBoxList

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default How to prevent changes to CheckBoxList

    Hello.
    Can anyone tell me if there is ANY way to prevent the user changing
    the values in a checkboxlist. I just want to use it for information
    only. Disabling it is not an option as it results in a unacceptable
    gray color.

    Many thanks in advance for any replies.
    Meerkat Guest

  2. Similar Questions and Discussions

    1. Extend CheckBoxList
      I'd write a UserControl that contains the CheckBoxList and the Textbox.... "MoeJoe" <anonymous@discussions.microsoft.com> wrote in message...
    2. How to I Iterator through a CheckBoxList?
      This is an ASP.NET using C# website
    3. CheckBoxList
      When I put a CheckBoxList on a web form and then populate it, it grows longer. The behavior I wold like would be more like the Windows Forms...
    4. how to prevent prevent .so-calling routine to crash from segfaults in .so
      Hi, Guys I am stuck with a problem and need some help. Platform : Linux(RedHat 7.3) Problem Area : Dynamic Shared Object Libraries, POSIX...
    5. checkboxlist control
      Why don't you keep one of the checkbox selected on load. -- Regards Khan Imran "buran" <buran@buran.com> wrote in message...
  3. #2

    Default Re: How to prevent changes to CheckBoxList

    Use a bit of javascript in the onChanged property, and set it back to it's
    checked property every time.

    D

    <Meerkat> wrote in message
    news:k7b5gv4fl61gcebf3rvs7puf0q5cnbs86u@4ax.com...
    > Hello.
    > Can anyone tell me if there is ANY way to prevent the user changing
    > the values in a checkboxlist. I just want to use it for information
    > only. Disabling it is not an option as it results in a unacceptable
    > gray color.
    >
    > Many thanks in advance for any replies.

    Duncan Welch Guest

  4. #3

    Default Re: How to prevent changes to CheckBoxList

    Hello Rajesh,

    Your suggestion looks to be just the sort of thing I am looking for.
    ( i.e. simple) However, could I impose on your kindness a little
    more and ask exactly where do I put the code that you suggest.
    Is it in the code behind or the html? and what is the exact syntax.
    I have tried all sorts of things but failed miserably.

    Many thanks in anticipation,

    Meerkat.


    On Wed, 02 Jul 2003 04:58:17 -0700, Rajesh Tiwari <rajesh@dospl.com>
    wrote:
    >use onfocus="this.blur()"
    >
    >try something like
    >ChkBoxId.Attributes("onfocus")="javascript:this.b lur()"
    >
    >hope it helps
    >
    >Rajesh
    >
    >*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    >Don't just participate in USENET...get rewarded for it!
    Meerkat Guest

  5. #4

    Default Re: How to prevent changes to CheckBoxList

    hi meerkat,
    sorry for the late reply.here is the code that u were looking for.

    run this code and see if it is of some help

    <%@ Page Language="c#" debug=true%>
    <%@ Import Namespace="System.Data" %>
    <Script Language="C#" runat=server>
    void Page_Load(Object sender,EventArgs e)
    {

    lst2.Attributes["onclick"]="javascript:return false";
    }
    </script>
    <html>
    <body>
    <form id=frm1 runat=server>
    <asp:CheckBoxList id=lst2 runat=server>
    <asp:ListItem>a</asp:Listitem>
    </asp:CheckBoxList>
    </form>
    </body>
    </html>

    i hope i answered ur query.

    Rajesh

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Rajesh Tiwari Guest

  6. #5

    Default Re: How to prevent changes to CheckBoxList

    how about setting ENABLED property to false
    or VISIBLE property to false


    "Rajesh Tiwari" <rajesh@dospl.com> wrote in message
    news:eJOHA7tQDHA.3192@TK2MSFTNGP10.phx.gbl...
    > hi meerkat,
    > sorry for the late reply.here is the code that u were looking for.
    >
    > run this code and see if it is of some help
    >
    > <%@ Page Language="c#" debug=true%>
    > <%@ Import Namespace="System.Data" %>
    > <Script Language="C#" runat=server>
    > void Page_Load(Object sender,EventArgs e)
    > {
    >
    > lst2.Attributes["onclick"]="javascript:return false";
    > }
    > </script>
    > <html>
    > <body>
    > <form id=frm1 runat=server>
    > <asp:CheckBoxList id=lst2 runat=server>
    > <asp:ListItem>a</asp:Listitem>
    > </asp:CheckBoxList>
    > </form>
    > </body>
    > </html>
    >
    > i hope i answered ur query.
    >
    > Rajesh
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    David Waz... Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139