I am very new to .NET, so forgive my ignorance.

I am probably approaching this in every wrong direction, but for right now, until i can get a real user authentication scheme going (not to mention having to learn how to use code behind...) this will have to do.

Basically, I have an application that has 3 different user levels. The user shall login and the user/pass verified against an Oracle db. If it comes back good, a cookie is set that specifies the user access level. This app will be used on our intranet, and mostly by people who are not going to mess with cookies, so I am not worried about total security (yet... I just need to get this thing out the door for now, and go back and add aforementioned proper user access later).

Sooo... all that to say that I need to have certain field in a form READONLY depending on the user level captured in the cookie. Here is what I have so far (most of the code removed, only displaying one row...):


VB Code:
  1. <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
  2. <script language="vb" runat="server">
  3. public sub Page_Load(sender as object, e as eventargs)
  4. MAN_INVOICE_DATE.Text = format(system.datetime.now,"dd-MMM-yy")
  5. CREATION_DATE.Text = format(system.datetime.now, "dd-MMM-yy")
  6. SYS_INVOICE_DATE.Text = format(system.datetime.now, "dd-MMM-yy")
  7. [B]CLIENT_ID.Attributes.Add("onchange","javaScript:this.value = this.value.toUpperCase();")
  8.    Dim levelAccess As HttpCookie = Request.Cookies("levelAccess")
  9.    Dim userLevel As Byte
  10.    userLevel = levelAccess.value
  11.    Dim ccmReadOnly as Boolean
  12.    Dim dcmReadOnly as Boolean
  13.  
  14.    Select case userLevel
  15.     Case 1
  16.         ccmReadOnly = "False"
  17.         dcmReadOnly = "False"
  18.     Case 2
  19.         ccmReadOnly = "True"
  20.         dcmReadOnly = "False"
  21.     Case 3
  22.         ccmReadOnly = "True"
  23.         dcmReadOnly = "True"
  24.     End Select[/B]
  25.    
  26. end sub
  27. </script>
  28. <html>
  29. <head></head>
  30. <body>
  31. <form method="post" name="form1" runat="server">
  32. <table>
  33.  <tr valign="baseline" bgcolor="#99CCFF">
  34.   <td align="right" nowrap bgcolor="#99CCFF">CCM Email</td>
  35.   <td bgcolor="#99CCFF"><asp:TextBox ID="CCM_EMAIL" TextMode="SingleLine" ReadOnly="<%# response.write(ccmReadOnly) %>" Columns="32" runat="server" />    
  36.   </td>
  37.   <td align="right" nowrap="nowrap">CCM Approval Date</td>
  38.   <td><asp:TextBox ID="CCM_DATE" TextMode="SingleLine" ReadOnly="<%# response.write(ccmReadOnly) %>" Columns="8" runat="server" />          
  39.   </td>
  40.  </tr>
  41. </table>
  42. </form>
  43. </body>
  44. </html>

With or without the quotes around the response.write, I get the following error:
BC30451: Name 'ccmReadOnly' is not declared.

Thanks for your help!