Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to prevent changes to CheckBoxList

Reply
Thread Tools

How to prevent changes to CheckBoxList

 
 
Meerkat
Guest
Posts: n/a
 
      07-02-2003
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.
 
Reply With Quote
 
 
 
 
Duncan Welch
Guest
Posts: n/a
 
      07-02-2003
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:(E-Mail Removed)...
> 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.



 
Reply With Quote
 
 
 
 
Meerkat
Guest
Posts: n/a
 
      07-02-2003
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 <(E-Mail Removed)>
wrote:

>use onfocus="this.blur()"
>
>try something like
>ChkBoxId.Attributes("onfocus")="javascript:this.b lur()"
>
>hope it helps
>
>Rajesh
>
>*** Sent via Developersdex http://www.developersdex.com ***
>Don't just participate in USENET...get rewarded for it!


 
Reply With Quote
 
Rajesh Tiwari
Guest
Posts: n/a
 
      07-05-2003
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 http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
David Waz...
Guest
Posts: n/a
 
      07-06-2003
how about setting ENABLED property to false
or VISIBLE property to false


"Rajesh Tiwari" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
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
Checkboxlist inside Repeater - doesn't fire click event for Checkboxlist JD ASP .Net 5 08-08-2007 11:28 AM
RE: Prevent changes to wireless network adapter =?Utf-8?B?UGF2ZWwgQS4=?= Wireless Networking 0 01-16-2007 11:57 PM
How to get Selected item in a Databinded CheckBoxList when CheckBoxlist is in a DataList? Patrick.O.Ige ASP .Net 5 06-19-2005 06:11 AM
CheckBoxList - how to prevent labels from wraping? MattB ASP .Net 2 11-12-2004 04:23 PM
Word 2000 Normal.dot changes - how do I prevent them? jersie0 Computer Support 6 04-30-2004 07:07 PM



Advertisments