By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,705 Members | 1,301 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,705 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Oct 4 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uJ****************@TK2MSFTNGP06.phx.gbl...
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


Oct 4 '06 #2

P: n/a
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

"Ken Cox [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in message
news:OV**************@TK2MSFTNGP03.phx.gbl...
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
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uJ****************@TK2MSFTNGP06.phx.gbl...
>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



Oct 4 '06 #3

P: n/a
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" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
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

"Ken Cox [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:OV**************@TK2MSFTNGP03.phx.gbl...
>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
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uJ****************@TK2MSFTNGP06.phx.gbl...
>>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




Oct 5 '06 #4

P: n/a
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 [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
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" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>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

"Ken Cox [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:OV**************@TK2MSFTNGP03.phx.gbl...
>>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
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uJ****************@TK2MSFTNGP06.phx.gbl.. .
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




Oct 5 '06 #5

P: n/a
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" <tony(nospam)@lakesideos.comwrote in message
news:uh**************@TK2MSFTNGP02.phx.gbl...
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 [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:%2****************@TK2MSFTNGP05.phx.gbl...
>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" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl...
>>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

"Ken Cox [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:OV**************@TK2MSFTNGP03.phx.gbl...
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
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uJ****************@TK2MSFTNGP06.phx.gbl. ..
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
>
>




Oct 5 '06 #6

P: n/a
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 [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in message
news:e9**************@TK2MSFTNGP06.phx.gbl...
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" <tony(nospam)@lakesideos.comwrote in message
news:uh**************@TK2MSFTNGP02.phx.gbl...
>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 [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:%2****************@TK2MSFTNGP05.phx.gbl...
>>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" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl.. .
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

"Ken Cox [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:OV**************@TK2MSFTNGP03.phx.gbl...
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
>
>
"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:uJ****************@TK2MSFTNGP06.phx.gbl.. .
>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("onclic k", "return
>btnGAT_onClick()")
>>
>Why is it not finding that function ?
>>
>Any help would be gratefully appreciated.
>>
>Thanks,
>Tony
>>
>>
>
>




Oct 5 '06 #7

P: n/a
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" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
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 [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:e9**************@TK2MSFTNGP06.phx.gbl...
>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" <tony(nospam)@lakesideos.comwrote in message
news:uh**************@TK2MSFTNGP02.phx.gbl...
>>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 [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:%2****************@TK2MSFTNGP05.phx.gbl...
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" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP06.phx.gbl. ..
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
>
"Ken Cox [Microsoft MVP]" <BA**********@newsgroups.nospamwrote in
message news:OV**************@TK2MSFTNGP03.phx.gbl...
>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
>>
>>
>"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
>news:uJ****************@TK2MSFTNGP06.phx.gbl. ..
>>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("oncli ck", "return
>>btnGAT_onClick()")
>>>
>>Why is it not finding that function ?
>>>
>>Any help would be gratefully appreciated.
>>>
>>Thanks,
>>Tony
>>>
>>>
>>
>>
>
>




Oct 5 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.