473,698 Members | 2,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CodeBehind error

I have a code behind line that is giving me the error:

*************** *************** *************** *************** **********
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30456: 'SelectedDate' is not a member of
'System.Web.UI. WebControls.Dat aGrid'.

Source Error:

Line 36:
Line 37: Sub DayChanged(s as Object, e As EventArgs)
Line 38: Response.Redire ct("DisplayEven ts.aspx?myDate= " &
myCalendar.Sele ctedDate)
Line 39: end Sub
*************** *************** *************** *************** **********

The code (as you can see from above) is:
*************** *************** *************** *************** ***
Sub DayChanged(s as Object, e As EventArgs)
Response.Redire ct("DisplayEven ts.aspx?myDate= " & myCalendar.Sele ctedDate)
end Sub
*************** *************** *************** *************** ****

"myDate" is not in my program. It is just the name that DisplayEvents.a spx
expects.

Why am I getting the error and what do I add to my code behind to resolve
it?

Thanks,

Tom.
Nov 18 '05 #1
2 1035
Rob
The compiler thinks that myCalendar is a DataGrid (which doesn't have
a SelectedDate method) and the code inthe event handler seems to be
assuming its a Calendar.

Is it just the case that myCalendar should be declared as a Calendar
and not a DataGrid?

On Thu, 14 Oct 2004 12:04:40 -0700, "tshad"
<ts**********@f tsolutions.com> wrote:
I have a code behind line that is giving me the error:

************** *************** *************** *************** ***********
Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30456: 'SelectedDate' is not a member of
'System.Web.UI .WebControls.Da taGrid'.

Source Error:

Line 36:
Line 37: Sub DayChanged(s as Object, e As EventArgs)
Line 38: Response.Redire ct("DisplayEven ts.aspx?myDate= " &
myCalendar.Sel ectedDate)
Line 39: end Sub
************** *************** *************** *************** ***********

The code (as you can see from above) is:
************** *************** *************** *************** ****
Sub DayChanged(s as Object, e As EventArgs)
Response.Redire ct("DisplayEven ts.aspx?myDate= " & myCalendar.Sele ctedDate)
end Sub
************** *************** *************** *************** *****

"myDate" is not in my program. It is just the name that DisplayEvents.a spx
expects.

Why am I getting the error and what do I add to my code behind to resolve
it?

Thanks,

Tom.


Nov 18 '05 #2
"Rob" <Ro*@dummy.co m> wrote in message
news:or******** *************** *********@4ax.c om...
The compiler thinks that myCalendar is a DataGrid (which doesn't have
a SelectedDate method) and the code inthe event handler seems to be
assuming its a Calendar.

Is it just the case that myCalendar should be declared as a Calendar
and not a DataGrid?
That was it.

I had taken my page and split it into 2 to create a code behind and had
inadvertantly said:

Protected WithEvents myCalendar As DataGrid

instead of

Protected WithEvents myCalendar As Calendar

Thanks,

Tom.
On Thu, 14 Oct 2004 12:04:40 -0700, "tshad"
<ts**********@f tsolutions.com> wrote:
I have a code behind line that is giving me the error:

************* *************** *************** *************** ************
Compilation Error
Description : An error occurred during the compilation of a resource
required
to service this request. Please review the following specific error
details
and modify your source code appropriately.

Compiler Error Message: BC30456: 'SelectedDate' is not a member of
'System.Web.U I.WebControls.D ataGrid'.

Source Error:

Line 36:
Line 37: Sub DayChanged(s as Object, e As EventArgs)
Line 38: Response.Redire ct("DisplayEven ts.aspx?myDate= " &
myCalendar.Se lectedDate)
Line 39: end Sub
************* *************** *************** *************** ************

The code (as you can see from above) is:
************* *************** *************** *************** *****
Sub DayChanged(s as Object, e As EventArgs)
Response.Redire ct("DisplayEven ts.aspx?myDate= " &
myCalendar.Sele ctedDate)
end Sub
************* *************** *************** *************** ******

"myDate" is not in my program. It is just the name that
DisplayEvents .aspx
expects.

Why am I getting the error and what do I add to my code behind to resolve
it?

Thanks,

Tom.

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2880
by: Graham Allwood | last post by:
I'm reading the Essential ASP.NET book by Fritz onion and he says that when VS.NET creates a new .aspx page for you is uses the codebehind attribute on the Page directive rather than the src attribute. From what I understand the src attrib is standard ASP.NET but the codebehind attribute is only understood by VS.NET. Doesn't this make the pages (source code) less portable? Is there any reason for this? Hope someone can help.
6
2854
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked fine while the file was in the project directory. When the obsolete file was removed from the project directory, my application will no longer compile. Can someone please help with this issue? Thank in advance, Tom
1
1284
by: ani | last post by:
When I try to open the web form page, I get a designer error which says: 'the file could not be loaded into the web forms designer. Please correct the following error and then try loading it again: The @Page or @Control directive contains a src=attribute, which is not supported in Visual Studio.
12
1750
by: A.M | last post by:
Hi, Using VS.NET 2003, If i use SRC page attribute instead of CodeBehind, do i still have intelisence and generally IDE support for that? Thanks, Ali
12
2248
by: Wardeaux | last post by:
All, Wanting to find a way to create web pages to add to my website without having to recompile the codebehind everytime I want to add a new one... Here's the deal: I have a web app that takes work orders for 7 different items, each item gets 1 page for input specs. All works well. I want to add a new item. I do not want to recompile and redistribute my app everytime just to add a new input page. Can ASPX resources be compiled into a...
4
1881
by: Mat | last post by:
Hi, I am having a bit of a problem trying to access / set properties of a usercontrol from the parent codebehind. This is what I have so far.. simple.aspx <%@ Page Inherits="CodeBehindSimple" src="simple.vb" %> <%@ Register TagPrefix="CC" TagName="Simple" Src="ucSimple.ascx"%>
1
1233
by: BJ-Mac Donel | last post by:
Please find the below error! This occure when i upload to server, but in my local file working really great, But if i change codebehind to src it is working well, but i also have problem with my namespace Or any other config? thanks! dorei Server Error in '/' Application.
0
1529
by: N. Demos | last post by:
Hello, I have a custom usercontrol, of which I have two instances of in my aspx page. Both the usercontrol and page have codebehind. In the page codebehind, I want a member variable for each usercontrol. My problem is that I keep getting a compiler error on the usercontrol variables in my page codebehind (BC30002: Type 'CityGeoPosSelectClass' is not defined.) For whatever reason, my usercontrol class is not being declared in the page...
2
2536
by: landers | last post by:
Hi All, I have created a vb file that inherits a System.Web.UI.Page. As I am against duplicating source code, I have set the Codebehind attribute on all my aspx pages in the same directory. This works a treat. Now, I have a sub-directory full of aspx pages that I wish to point to this wonderful vb file using the Codebehind attribute again. The designer errors with "The class file '../basepage.vb' specified as the codebehind for...
1
2523
by: Randall Parker | last post by:
Using VS 2003 and Cassini web server. I'm new to ASP.Net and so this may be a dumb question. I'm getting an error where the type 'FarmLand.WebForm1' is not found. The Codebehind C# source file declares a namespace of FarmLand and a class of WebForm1. Does one have to restrict which namespace one uses in Codebehind forms? Maybe match the namespace the aspx file has? When one adds a namespace then does one have to move the file to a...
0
8683
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
8610
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
9170
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
8902
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
8873
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
7740
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6528
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.