469,945 Members | 1,848 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,945 developers. It's quick & easy.

Control Not Declared

22
Hi,
My page code behind code is attached ,I am a bit confused as the VS 2005 keeps giving me the error that chklistvyes & the other controls are not declared ,despite having the runat server in the html cade of the control,
I keeps oin throwing this error can some one please help me out with this issue asap,please as I tried to figure it out many a time but in vain.................
Expand|Select|Wrap|Line Numbers
  1. Partial Class CPro
  2.     Inherits System.Web.UI.Page
  3.     Dim i, nyes, nno As Integer
  4.     Dim OptionsY() As Integer = {1, 1, 1, 1, 1, 1}
  5.     Dim OptionsN() As Integer = {1, 1, 1, 1, 1, 1}
  6.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  7.         chklistvyes.Enabled = False
  8.         chklistvno.Enabled = False
  9.         txtcallprov.Visible = False
  10.         txtcallprov.BackColor = Drawing.Color.White
  11.         btnCopyIdv.Attributes.Add("Onclick", "javascript:HighlightAll('test2.select1')")
  12.         btnCopyIdv.Attributes.Add("onclick", "javascript:window.clipboardData.setData('Text', document.getElementById('" & txtcallprov.UniqueID & "').value);")
  13.     End Sub
  14.  
  15.     Protected Sub radcustid_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles radcustid.SelectedIndexChanged
  16.         If Trim(radcustid.SelectedValue.ToString) = "Yes" Then
  17.             chklistvyes.Enabled = True
  18.             chklistvno.Enabled = True
  19.             txtcallproid.Visible = True
  20.             txtcallproid.Text = "XYZ"
  21.             txtcallproid.BackColor = Drawing.Color.Green
  22.         ElseIf Trim(radcustid.SelectedValue.ToString) = "No" Then
  23.             txtcallproid.Visible = True
  24.             txtcallproid.BackColor = Drawing.Color.Red
  25.         End If
  26.     End Sub
  27.     Protected Sub btnrefresh_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnrefresh.Click
  28.         Response.Redirect("Callpro.aspx")
  29.     End Sub
  30.  
  31.  
  32.     Protected Sub btnvcheck_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnvcheck.Click
  33.         Dim x
  34.         Dim msg, msg1, msg2, msg3, msg4, msg5 As String
  35.         msg = ""
  36.         msg1 = ""
  37.         msg2 = ""
  38.         msg3 = ""
  39.         msg4 = ""
  40.         msg5 = ""
  41.         For x = 0 To chklistvyes.Items.Count - 1
  42.             If chklistvyes.Items(i).Selected Then
  43.                 nyes = nyes + 1
  44.             Else
  45.                 nno = nno + 1
  46.             End If
  47.             i = i + 1
  48.         Next
  49.  
  50.         If (nyes > 4) Then
  51.             txtcallprov.Visible = True
  52.             txtcallprov.Text = "XYZ"
  53.             txtcallprov.BackColor = Drawing.Color.Green
  54.         ElseIf (nyes = 4) Then
  55.             txtcallprov.Visible = True
  56.             txtcallprov.Text = "XYZ"
  57.             txtcallprov.BackColor = Drawing.Color.Green
  58.         ElseIf (nyes < 4) Then
  59.             txtcallprov.Visible = True
  60.             txtcallprov.Text = "XYZ"
  61.             txtcallprov.BackColor = Drawing.Color.Red
  62.         End If
  63.  
  64.  
  65.     End Sub
  66.  
  67. End Class
  68.  
Please help me out asap..................
Mar 12 '09 #1
4 5252
Plater
7,872 Expert 4TB
The name of the two pages are the same, and at the top of the aspx page it has a CodeFile= property that points to the exact correct name of the code page and an Inherits property that points to the exact correct name of the class in the code page?
Are you sure you have exact capitalizations correct? Did you build the page in a funny way?
(You may have to create a new page, copy/paste everything over and then delete the original)
Mar 12 '09 #2
Frinavale
9,735 Expert Mod 8TB
Did you delete the .design.vb file?
If this is a web application (as apposed to an asp.net web site)Are you sure that the namespaces matches?

For example:
In your ASP page code you would have something like:
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CPro.aspx.vb" Inherits="MyNamespace.CPro"  %>
Where MyNamespace matches the namespace of the ASP.NET web application.
Mar 13 '09 #3
Anni V
22
@Frinavale
Thanks for your suggestion
but the copy /pasting on a new page worked,
It is an asp.net website, but I am not a pro at what you explained , since you guys are the best at this (geniuses as I would say) ,
I was just fine as it worked by recreating a page & copy pasting the same, the errors disappeared
Thanks
Regards
Mar 17 '09 #4
Please send your html code. Have you declared runat=server in the controls
Mar 20 '09 #5

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Chien Lau | last post: by
6 posts views Thread by martin | last post: by
2 posts views Thread by DocAccolade | last post: by
3 posts views Thread by Raed Sawalha | last post: by
4 posts views Thread by bill | last post: by
4 posts views Thread by Boris Yeltsin | last post: by
reply views Thread by lanem | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.