Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of 'ASP.WebForm1_aspx'

T

Tony Girgenti

Hello.

I'm developing and testing a web application using VS.NET 2003, VB, .NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

I'm trying create a function in javascript to compare dates between calendar
selected dates(that's not really my problem yet).

I can't get the html to recognize the function that i have created. When i
run the program, it gives the error
Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of
'ASP.WebForm1_aspx'
Source Error:


Line 77: Font-Size="X-Large" ForeColor="OrangeRed">Coyne Truck Web
Services</asp:label><asp:image id="Image1" style="Z-INDEX: 105; LEFT: 16px;
POSITION: absolute; TOP: 16px" runat="server"
Line 78: Height="72px"
ImageUrl="file:///C:\Inetpub\wwwroot\CoyneTruckWebServices\images\cc_logo.gif"></asp:image>
Line 79: <asp:button id="btnGetArchivedTrips" onclick="btnGAT_onClick();"
style="Z-INDEX: 104; LEFT: 168px; POSITION: absolute; TOP: 152px"
Line 80: accessKey="G" runat="server" Width="128px" BorderStyle="Solid"
ForeColor="OrangeRed" BackColor="White"
Line 81: Text="Get Archived Trips"></asp:button>


Here is my html:
<script id=clientEventHandlersJS language=javascript>
<!--
function document_onclick() {
}

//-->
</script>
<script language=javascript for=document event=onclick>
<!--
function btnGAT_onClick() {
var startDate = calendar1.selected.date
var endDate = calendar2.selected.date
}
return document_onclick()
//-->
</script>

I have this line in the Page_load event:

Me.btnGetArchivedTrips.Attributes.Add("onclick", "return btnGAT_onClick()")

Why is it not finding that function ?

Any help would be gratefully appreciated.

Thanks,
Tony
 
K

Ken Cox [Microsoft MVP]

Hey Tony,

You're mixing server-side clicks and client-side scripts inappropriately.

Try taking this out of your server-side code:

onclick="btnGAT_onClick();"

It looks like you might be doing the same with the calendar too.

Ken
 
T

Tony Girgenti

Hello Ken.

That succeeded in eliminating the error, but it doesn't seem to be executing
my function.
}
function btnGAT_onClick() {
var startDate = calendar1.selecteddate
var endDate = calendar2.selecteddate
if startDate > endDate
alert('Incorrect dates')
end if
}

Is there a way to stop it in the debugger to see what's going on ?

Thanks,
Tony
 
K

Ken Cox [Microsoft MVP]

Hi Tony,

I think it would be better if you explained what you are trying to
accomplish.

Your client-side function, btnGAT_onClick() , contains server-side
properties (calendar1.selecteddate) that JavaScript isn't going to accept.

As I said previously, you're mixing client-side and server-side code in a
way that won't work.

Ken
Microsoft MVP [ASP.NET]
 
T

Tony Girgenti

Hello Ken.

On the web page i have two calendar controls. I want to be able to compare
one calendar selecteddate(start date) to the other calendar selecteddate
(end date) and give the operator a warning screen if the start date is > the
end date.

Of course this should occur after they click the start button which is also
on the web form.

Any help that you can provide to accomplish this would be gratefully
appreciated.

Thanks,
Tony
Ken Cox said:
Hi Tony,

I think it would be better if you explained what you are trying to
accomplish.

Your client-side function, btnGAT_onClick() , contains server-side
properties (calendar1.selecteddate) that JavaScript isn't going to accept.

As I said previously, you're mixing client-side and server-side code in a
way that won't work.

Ken
Microsoft MVP [ASP.NET]


Tony Girgenti said:
Hello Ken.

That succeeded in eliminating the error, but it doesn't seem to be
executing my function.
}
function btnGAT_onClick() {
var startDate = calendar1.selecteddate
var endDate = calendar2.selecteddate
if startDate > endDate
alert('Incorrect dates')
end if
}

Is there a way to stop it in the debugger to see what's going on ?

Thanks,
Tony
 
K

Ken Cox [Microsoft MVP]

Hi Tony,

Perhaps if you take a look at this sample, you'll get the idea. It tests the
selected dates and calculates the difference. You proceed if the difference
is correct.

Ken
Microsoft MVP [ASP.NET]

<%@ page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim dtCal1 As DateTime
Dim dtCal2 As DateTime
Dim tmspan As TimeSpan
dtCal1 = Calendar1.SelectedDate
dtCal2 = Calendar2.SelectedDate
tmspan = dtCal2.Subtract(dtCal1)
If (tmspan.TotalDays < 0) Then
Label1.Text = "Oops. Your End date is " & _
" before the Start date!"
Else
Label1.Text = "Processing...The difference is " & _
tmspan.TotalDays.ToString & " day(s)."
End If

End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Days Difference</title>
</head>
<body>
<form id="form1" runat="server">
<div>Start Date
<asp:calendar id="Calendar1" runat="server"></asp:calendar>
<br />End Date
<asp:calendar id="Calendar2" runat="server"></asp:calendar>
<br />
<asp:label id="Label1" runat="server"></asp:label>
<br />
<br />
<asp:button id="Button1" runat="server" onclick="Button1_Click"
text="Calculate" /></div>
</form>
</body>
</html>

Tony Girgenti said:
Hello Ken.

On the web page i have two calendar controls. I want to be able to
compare one calendar selecteddate(start date) to the other calendar
selecteddate (end date) and give the operator a warning screen if the
start date is > the end date.

Of course this should occur after they click the start button which is
also on the web form.

Any help that you can provide to accomplish this would be gratefully
appreciated.

Thanks,
Tony
Ken Cox said:
Hi Tony,

I think it would be better if you explained what you are trying to
accomplish.

Your client-side function, btnGAT_onClick() , contains server-side
properties (calendar1.selecteddate) that JavaScript isn't going to
accept.

As I said previously, you're mixing client-side and server-side code in a
way that won't work.

Ken
Microsoft MVP [ASP.NET]


Tony Girgenti said:
Hello Ken.

That succeeded in eliminating the error, but it doesn't seem to be
executing my function.
}
function btnGAT_onClick() {
var startDate = calendar1.selecteddate
var endDate = calendar2.selecteddate
if startDate > endDate
alert('Incorrect dates')
end if
}

Is there a way to stop it in the debugger to see what's going on ?

Thanks,
Tony

message Hey Tony,

You're mixing server-side clicks and client-side scripts
inappropriately.

Try taking this out of your server-side code:

onclick="btnGAT_onClick();"

It looks like you might be doing the same with the calendar too.

Ken


Hello.

I'm developing and testing a web application using VS.NET 2003, VB,
.NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

I'm trying create a function in javascript to compare dates between
calendar selected dates(that's not really my problem yet).

I can't get the html to recognize the function that i have created.
When i run the program, it gives the error
Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of
'ASP.WebForm1_aspx'
Source Error:


Line 77: Font-Size="X-Large" ForeColor="OrangeRed">Coyne Truck Web
Services</asp:label><asp:image id="Image1" style="Z-INDEX: 105; LEFT:
16px; POSITION: absolute; TOP: 16px" runat="server"
Line 78: Height="72px"
ImageUrl="file:///C:\Inetpub\wwwroot\CoyneTruckWebServices\images\cc_logo.gif"></asp:image>
Line 79: <asp:button id="btnGetArchivedTrips"
onclick="btnGAT_onClick();" style="Z-INDEX: 104; LEFT: 168px;
POSITION: absolute; TOP: 152px"
Line 80: accessKey="G" runat="server" Width="128px"
BorderStyle="Solid" ForeColor="OrangeRed" BackColor="White"
Line 81: Text="Get Archived Trips"></asp:button>


Here is my html:
<script id=clientEventHandlersJS language=javascript>
<!--
function document_onclick() {
}

//-->
</script>
<script language=javascript for=document event=onclick>
<!--
function btnGAT_onClick() {
var startDate = calendar1.selected.date
var endDate = calendar2.selected.date
}
return document_onclick()
//-->
</script>

I have this line in the Page_load event:

Me.btnGetArchivedTrips.Attributes.Add("onclick", "return
btnGAT_onClick()")

Why is it not finding that function ?

Any help would be gratefully appreciated.

Thanks,
Tony
 
T

Tony Girgenti

Wow Ken.

I wasn't expecting for you to do the whole thing. Or did you copy it from
somewhere ?

I was simply looking for direction on how to get started, but thanks for all
of your effort.

Tony

Ken Cox said:
Hi Tony,

Perhaps if you take a look at this sample, you'll get the idea. It tests
the selected dates and calculates the difference. You proceed if the
difference is correct.

Ken
Microsoft MVP [ASP.NET]

<%@ page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim dtCal1 As DateTime
Dim dtCal2 As DateTime
Dim tmspan As TimeSpan
dtCal1 = Calendar1.SelectedDate
dtCal2 = Calendar2.SelectedDate
tmspan = dtCal2.Subtract(dtCal1)
If (tmspan.TotalDays < 0) Then
Label1.Text = "Oops. Your End date is " & _
" before the Start date!"
Else
Label1.Text = "Processing...The difference is " & _
tmspan.TotalDays.ToString & " day(s)."
End If

End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Days Difference</title>
</head>
<body>
<form id="form1" runat="server">
<div>Start Date
<asp:calendar id="Calendar1" runat="server"></asp:calendar>
<br />End Date
<asp:calendar id="Calendar2" runat="server"></asp:calendar>
<br />
<asp:label id="Label1" runat="server"></asp:label>
<br />
<br />
<asp:button id="Button1" runat="server" onclick="Button1_Click"
text="Calculate" /></div>
</form>
</body>
</html>

Tony Girgenti said:
Hello Ken.

On the web page i have two calendar controls. I want to be able to
compare one calendar selecteddate(start date) to the other calendar
selecteddate (end date) and give the operator a warning screen if the
start date is > the end date.

Of course this should occur after they click the start button which is
also on the web form.

Any help that you can provide to accomplish this would be gratefully
appreciated.

Thanks,
Tony
Ken Cox said:
Hi Tony,

I think it would be better if you explained what you are trying to
accomplish.

Your client-side function, btnGAT_onClick() , contains server-side
properties (calendar1.selecteddate) that JavaScript isn't going to
accept.

As I said previously, you're mixing client-side and server-side code in
a way that won't work.

Ken
Microsoft MVP [ASP.NET]


Hello Ken.

That succeeded in eliminating the error, but it doesn't seem to be
executing my function.
}
function btnGAT_onClick() {
var startDate = calendar1.selecteddate
var endDate = calendar2.selecteddate
if startDate > endDate
alert('Incorrect dates')
end if
}

Is there a way to stop it in the debugger to see what's going on ?

Thanks,
Tony

message Hey Tony,

You're mixing server-side clicks and client-side scripts
inappropriately.

Try taking this out of your server-side code:

onclick="btnGAT_onClick();"

It looks like you might be doing the same with the calendar too.

Ken


Hello.

I'm developing and testing a web application using VS.NET 2003, VB,
.NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

I'm trying create a function in javascript to compare dates between
calendar selected dates(that's not really my problem yet).

I can't get the html to recognize the function that i have created.
When i run the program, it gives the error
Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of
'ASP.WebForm1_aspx'
Source Error:


Line 77: Font-Size="X-Large" ForeColor="OrangeRed">Coyne Truck Web
Services</asp:label><asp:image id="Image1" style="Z-INDEX: 105; LEFT:
16px; POSITION: absolute; TOP: 16px" runat="server"
Line 78: Height="72px"
ImageUrl="file:///C:\Inetpub\wwwroot\CoyneTruckWebServices\images\cc_logo.gif"></asp:image>
Line 79: <asp:button id="btnGetArchivedTrips"
onclick="btnGAT_onClick();" style="Z-INDEX: 104; LEFT: 168px;
POSITION: absolute; TOP: 152px"
Line 80: accessKey="G" runat="server" Width="128px"
BorderStyle="Solid" ForeColor="OrangeRed" BackColor="White"
Line 81: Text="Get Archived Trips"></asp:button>


Here is my html:
<script id=clientEventHandlersJS language=javascript>
<!--
function document_onclick() {
}

//-->
</script>
<script language=javascript for=document event=onclick>
<!--
function btnGAT_onClick() {
var startDate = calendar1.selected.date
var endDate = calendar2.selected.date
}
return document_onclick()
//-->
</script>

I have this line in the Page_load event:

Me.btnGetArchivedTrips.Attributes.Add("onclick", "return
btnGAT_onClick()")

Why is it not finding that function ?

Any help would be gratefully appreciated.

Thanks,
Tony
 
K

Ken Cox [Microsoft MVP]

Hi Tony,

I had done something similar before, so I had most of the code.

Glad to help!

Ken
Microsoft MVP [ASP.NET]

Tony Girgenti said:
Wow Ken.

I wasn't expecting for you to do the whole thing. Or did you copy it from
somewhere ?

I was simply looking for direction on how to get started, but thanks for
all of your effort.

Tony

Ken Cox said:
Hi Tony,

Perhaps if you take a look at this sample, you'll get the idea. It tests
the selected dates and calculates the difference. You proceed if the
difference is correct.

Ken
Microsoft MVP [ASP.NET]

<%@ page language="VB" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Protected Sub Button1_Click _
(ByVal sender As Object, _
ByVal e As System.EventArgs)
Dim dtCal1 As DateTime
Dim dtCal2 As DateTime
Dim tmspan As TimeSpan
dtCal1 = Calendar1.SelectedDate
dtCal2 = Calendar2.SelectedDate
tmspan = dtCal2.Subtract(dtCal1)
If (tmspan.TotalDays < 0) Then
Label1.Text = "Oops. Your End date is " & _
" before the Start date!"
Else
Label1.Text = "Processing...The difference is " & _
tmspan.TotalDays.ToString & " day(s)."
End If

End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Days Difference</title>
</head>
<body>
<form id="form1" runat="server">
<div>Start Date
<asp:calendar id="Calendar1" runat="server"></asp:calendar>
<br />End Date
<asp:calendar id="Calendar2" runat="server"></asp:calendar>
<br />
<asp:label id="Label1" runat="server"></asp:label>
<br />
<br />
<asp:button id="Button1" runat="server"
onclick="Button1_Click" text="Calculate" /></div>
</form>
</body>
</html>

Tony Girgenti said:
Hello Ken.

On the web page i have two calendar controls. I want to be able to
compare one calendar selecteddate(start date) to the other calendar
selecteddate (end date) and give the operator a warning screen if the
start date is > the end date.

Of course this should occur after they click the start button which is
also on the web form.

Any help that you can provide to accomplish this would be gratefully
appreciated.

Thanks,
Tony
message Hi Tony,

I think it would be better if you explained what you are trying to
accomplish.

Your client-side function, btnGAT_onClick() , contains server-side
properties (calendar1.selecteddate) that JavaScript isn't going to
accept.

As I said previously, you're mixing client-side and server-side code in
a way that won't work.

Ken
Microsoft MVP [ASP.NET]


Hello Ken.

That succeeded in eliminating the error, but it doesn't seem to be
executing my function.
}
function btnGAT_onClick() {
var startDate = calendar1.selecteddate
var endDate = calendar2.selecteddate
if startDate > endDate
alert('Incorrect dates')
end if
}

Is there a way to stop it in the debugger to see what's going on ?

Thanks,
Tony

message Hey Tony,

You're mixing server-side clicks and client-side scripts
inappropriately.

Try taking this out of your server-side code:

onclick="btnGAT_onClick();"

It looks like you might be doing the same with the calendar too.

Ken


Hello.

I'm developing and testing a web application using VS.NET 2003, VB,
.NET
Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1 on a WIN XP Pro, SP2
computer. I'm using a web form.

I'm trying create a function in javascript to compare dates between
calendar selected dates(that's not really my problem yet).

I can't get the html to recognize the function that i have created.
When i run the program, it gives the error
Compiler Error Message: BC30456: 'btnGAT_onClick' is not a member of
'ASP.WebForm1_aspx'
Source Error:


Line 77: Font-Size="X-Large" ForeColor="OrangeRed">Coyne Truck Web
Services</asp:label><asp:image id="Image1" style="Z-INDEX: 105;
LEFT: 16px; POSITION: absolute; TOP: 16px" runat="server"
Line 78: Height="72px"
ImageUrl="file:///C:\Inetpub\wwwroot\CoyneTruckWebServices\images\cc_logo.gif"></asp:image>
Line 79: <asp:button id="btnGetArchivedTrips"
onclick="btnGAT_onClick();" style="Z-INDEX: 104; LEFT: 168px;
POSITION: absolute; TOP: 152px"
Line 80: accessKey="G" runat="server" Width="128px"
BorderStyle="Solid" ForeColor="OrangeRed" BackColor="White"
Line 81: Text="Get Archived Trips"></asp:button>


Here is my html:
<script id=clientEventHandlersJS language=javascript>
<!--
function document_onclick() {
}

//-->
</script>
<script language=javascript for=document event=onclick>
<!--
function btnGAT_onClick() {
var startDate = calendar1.selected.date
var endDate = calendar2.selected.date
}
return document_onclick()
//-->
</script>

I have this line in the Page_load event:

Me.btnGetArchivedTrips.Attributes.Add("onclick", "return
btnGAT_onClick()")

Why is it not finding that function ?

Any help would be gratefully appreciated.

Thanks,
Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top