473,407 Members | 2,315 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

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 5584
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

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

Similar topics

2
by: Chien Lau | last post by:
I frequently define internal UserControl-derived classes in my WinForms apps: internal class MyUserControl:UserControl{ ... } I'll often need to embed these controls in a Form, whose class...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
2
by: DocAccolade | last post by:
I am trying to include a legacy com control (controlname.ocx) in an asp.net application using vs 2003. I have added the control to the user control tool box, then dragged it to the form. However,...
3
by: Raed Sawalha | last post by:
I created a very simple user control which contains lable and drag the control to page <%@ Page language="c#" Codebehind="Validate.aspx.cs" AutoEventWireup="false" Inherits="Learning.Validate"...
4
by: bill | last post by:
I have a Repeater control in a web user control. The web user control has a public method named PopulateRepeater which takes an ID as an parameter and populates the repeater control based on the...
4
by: Boris Yeltsin | last post by:
OK, on my Master Page I have a control: <a id="hypTabAccount" href="#" runat="server">Account</a> Now, in the code-behind (Root.master.vb) I can refer to it simply thus: ...
0
by: lanem | last post by:
Sometimes when working on my asp.net 2.0 webpages(vb.net) in Visual Studio 2005, Intellisense in my aspx.vb code-behind file tells me that a control is not declared even though it is on my aspx web...
24
by: tizi_de | last post by:
Hello all, I'm looking for a sample program in C to print out lines not to the standard MS Dos Box but into a different control e.g. text control. Has C the possibility to do printouts to a...
2
by: Monty | last post by:
Hello, I have a label control in my master page like this: <asp:Label ID=lblStatusMessage runat="server"></asp:Label> When I reference the control in my code-behind I get this error "Name...
2
by: Bronquites | last post by:
Hi! I'm having a problem with a User Control that I want to implement in my project. All the variables and classes are declared as Public. My User Control has a procedure that calls the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.