Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 10th, 2006, 10:48 PM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I forgot to add a relevant piece of source code for the ActivityAdd.aspx, as follows:
This code successfully executes once, as it should:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim meType As System.Type = Me.GetType()
        If (Not Me.ClientScript.IsClientScriptIncludeRegistered(me Type, "ActivityAddJavaScript")) Then
            Me.ClientScript.RegisterClientScriptInclude(meType , "ActivityAddJavaScript", "ActivityAdd.js")
        End If
    End Sub

 
Old August 11th, 2006, 03:05 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're either going to laugh out loud, or cry out loud.... Take a look at this:

public function alerthello()
{
    alert("Hey!From Activity Add page.");
}

You got carried away with .NET code too much where you need to specify access modifiers for functions. Try this instead:

function alerthello()
{
    alert("Hey!From Activity Add page.");
}


BTW, I got an error about a missing semicolon of each page I accessed on your site....


If you post code here, can you please format it a little with line breaks? Right now, this page is almost impossible to read...

Cheers,

Imar
 
Old August 11th, 2006, 06:07 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Imar:
1. I removed the "Public" as you found and it works AOK. Thanks. Been stuck on this for 3 full workdays.
2. Wife says I was talking all night in my sleep -- something about "registering a function..." This stuff can get to ya.
3. I wondered about that giant file. Please confirm that is what you wanted because I was tempted to send the source html -- big enough in of itself.
4. I left the very long strings of alphabet soup code without linebreaks because I thought you would not actually go into them, looking for something. Next time I'll break them up, but the file will be even longer then.
5. As for missing semicolons. Not seeing that here. Am using VWD Express and VB only, not VC#. Anyway, I thought ending semicolons were optional now.

Thanks again for your help. I work alone and there is no one on whom to bounce ideas, or another pair of eyes. You know...

VV



 
Old August 11th, 2006, 11:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Great, glad it's working.

The problem with these situations is that the actual cause of the error can be anywhere. It can be in the call to the function, in the function itself, in the way you're including the external file and so on.

That's why I asked you to post the final HTML so I can see what code ended up in the browser. Of course, with hindsight, posting only the code for the <head> section and the actual onclick call was more than enough to find the problem. But hey, once you know the solution, every problem is easy... ;)

I still get the error about the semi-colon, but I think this is caused by the same "public function" issue.

And I know what you mean by working alone and missing a second set of eyes. I have done that for a while (couple of years ago) and it isn't easy indeed. Then again, you have 50664 extra sets of eyes according to the homepage of P2P ;) (http://p2p.wrox.com/default.asp)

Cheers and have a good weekend.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Please...inherited controls are locked leorochab C# 2005 1 May 21st, 2006 03:41 AM
Please...inherited controls locked ??? leorochab C# 0 May 19th, 2006 12:36 PM
Inherited Controls locked (padlock) leorochab C# 0 May 14th, 2006 09:09 AM
Masterpage Question and Misprint on page 269 stanguss BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 February 24th, 2006 11:31 AM
Inherited Shadowing DoorHandle Pro VB.NET 2002/2003 1 September 7th, 2004 11:02 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.