473,750 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control Not Declared

22 New Member
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 5603
Plater
7,872 Recognized Expert Expert
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 Recognized Expert Moderator Expert
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 New Member
@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
bhupinder
32 New Member
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
6806
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 is contained in the same assembly as the control. As far as I know, the only way to do this using the designer is to add the UserControl-derived object
6
11299
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" Src="WebControls/Header.ascx" %> The web user control contains the following server controls
2
1153
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, when i try to reference it in code, it does not seem to exist. I declared the object variable and the ide reports the class members. The intellisense then recognizes the child members of the object variable and provides them in a drop down,...
3
1087
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" %> <%@ Register TagPrefix="uc1" TagName="GroupFilesManager" Src="GroupFilesManager.ascx" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <HTML>
4
1805
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 parameter. When I call PopulateRepeater from the User Control page_load event it populates the repeater without a problem. When I call PopulateRepeater from a procedure in the web form which contains
4
3992
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: hypTabAccount.InnerText = "blah" Now, what I want is the same in a content page that uses the Master Page. I have a Master Type in my Content page:
0
1329
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 page. This does not cause a compile error b/c the control is there, but it gives me a blue underline everywhere I refer to the control in the code-behind and says that it is not declared. I used to occasionally have this problem in vs.net 2003,...
24
2012
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 control instead of using the MS Dos Box? And what control can I use for this purpose when I need to have the most similar look to the MS Dos Box? Every help is greatly appreciated.
2
3337
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 'lblStatusMessage' is not declared" If I add a declaration for it at the top of my partial class like so: Protected lblStatusMessage As System.Web.UI.WebControls.Label
2
1362
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 variables that are declared in the main page and calls a sub on the main page at the end of its cycle. However on the User Control, the variables and procedure that are in the main page show up as 'Variable 'xyz' Not Declared'.... how come? Shouldn't the...
0
9000
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8838
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9577
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9339
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6081
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4887
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2804
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2225
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.