ASP not working on my site

matty1980

New Member
Messages
6
Reaction score
0
Points
0
Hello.

ASP does not seem to be working on my site here at x10. However, it works on my local machine. I created the page with MS Visual Web Developer using VB and uploaded all of the associated files to x10's server. Like I said the very basic "Hello World" web app works on my local machine. Here is my site's error message

Server Error in '/' Application

Compilation Error

Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.
Compiler Error Message: VBNC30506: Handles clause requires a variable declared with WithEvents.
/Default.aspxVersion information: Mono Version: 2.0.50727.1433; ASP.NET Version: 2.0.50727.1433




If you need my specific coding that I used or the versions of ASP.NET just tell me otherwise

PLEASE HELP!

Thank You
Novice
 

garrettroyce

Community Support
Community Support
Messages
5,603
Reaction score
246
Points
63
The problem is with your code, not with the server. If this code worked on your own computer, but not on your website, it is because X10 has no Windows servers and only supports ASP.NET through mono and mono does not fully support everything ASP.NET for Windows does.

See the documentation for MONO for more information: http://mono-project.com/Main_Page

With that being said, you're getting a Visual Basic error number 30506: http://msdn.microsoft.com/en-us/library/32787dt6(VS.80).aspx

Check your code where you have your handlers defined, and make sure that they are correctly defined.
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,603
Reaction score
246
Points
63
Could you post the code where the error is coming from? I'm not very big on VB, but I can probably fumble through it.

Oh, I see it now.

Any element that can raise an event, must be declared WithEvents, similar to public, private, etc.

For example:

Code:
// A regular button
Protected Button As LinkButton

// A button with events
Protected WithEvents Button As LinkButton
 
Last edited:

matty1980

New Member
Messages
6
Reaction score
0
Points
0
Yeah.

Here is the default.aspx.vb code:

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Label1.Text = "Hello World"

End Sub
End Class
 

garrettroyce

Community Support
Community Support
Messages
5,603
Reaction score
246
Points
63
You never define Button1.

Protected WithEvents Button1 As LinkButton

I hope that's right....I've never used VB, but I've used VC# and that looks right to me :p
 

Hue Kares

New Member
Messages
38
Reaction score
6
Points
0
Garrett, I hope you don't mind me butting in; there's nothing wrong with your code (apart from you defined a LinkButton, rather than a Button), but he'll run into more issues this way. FYI, Button1 will already be defined in the html, as so:
Code:
<asp:Button id="Button1" Text="Blah" />
matty1980, I have been assisting someone else with ASP.net/VB in another thread here, and I explain how to solve your exact problem in the last post of the thread, so I won't repeat it here.

Go check that thread out, and If you're still having trouble, come back. Good luck.
 

garrettroyce

Community Support
Community Support
Messages
5,603
Reaction score
246
Points
63
Not at all :p

It's nice to see that Microsoft's documentation of this error is terrible and unhelpful :D
 

matty1980

New Member
Messages
6
Reaction score
0
Points
0
Thanks.
I think there is something wrong with my code because i tried using no whatever.aspx.vb file just plain asp and it worked so i'll check the other thread
 

garrettroyce

Community Support
Community Support
Messages
5,603
Reaction score
246
Points
63
Yeah, the server will only recognize .aspx I think. The .aspx.vb files are meant to be included by your main file and not to be viewed directly though, I think.
 

matty1980

New Member
Messages
6
Reaction score
0
Points
0
THANKS

It works now. Now I know what to do and how to code it. Now I just need to come up with a theme for my site. But this is not the forum for that topic, btw here is my site's URL http://dotcom.x10hosting.com. Once again thanks again.:biggrin:
 
Top