473,748 Members | 2,361 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 1039
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
2883
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
2858
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
1289
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
1753
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
2260
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
1883
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
1235
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
1532
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
2545
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
2524
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
8823
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
9363
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9312
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
9238
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...
1
6793
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
6073
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();...
1
3300
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
2
2775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2206
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.