Cruel ASP.NET

shad0wr1d3r

New Member
Messages
8
Reaction score
0
Points
0
I am getting a very annoying error that I don't seem to be able to resolve :dunno:
It's a very simple page that is meant to display current time using
<% response.write(now()) %>

I added the mono stuff using the apache extensions
I uploaded all the files in the publish folder from visual studio 2008

I took a screenie take a look:
omg.jpg
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
From what I can see in your asp.net code, you're missing a semicolon.
Code:
<% response.write(now()) %> //needs semi after now())
The error that's displayed is because you have it set to not show the error message for security reasons; go into the web configuration file for your project, and replace the "Off" on customErrors mode="Off" to On. Been a while since I've messed with Asp.net though, not sure exactly where that file would be in your project :S
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Did you try following the suggestion it gave you? Without the output from the error, it'll be really hard to track down.

Is the function now() defined in the scope in which you are using it? I get two errors when using your code, but this works:

<% Response.Write(System.DateTime.Now); %>

As livewire said, the semicolon is a problem.
 
Last edited:

shad0wr1d3r

New Member
Messages
8
Reaction score
0
Points
0
here is the full code:
Code:
[SIZE=2]
<%[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]@[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]Page[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]Language[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="vb"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]AutoEventWireup[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="false"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]CodeBehind[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="Default.aspx.vb"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]Inherits[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="TheTime._Default"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] %>
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<![/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]DOCTYPE[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]html[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]PUBLIC[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"-//W3C//DTD XHTML 1.0 Transitional//EN"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]html[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]xmlns[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="http://www.w3.org/1999/xhtml"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
<[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]head[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]runat[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="server">
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]title[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]Current Time[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]title[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]head[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
<[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]body[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]form[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]id[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="form1"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#ff0000][SIZE=2][COLOR=#ff0000]runat[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]="server">
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]div[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]<% Response.Write(Now())%>
[/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]div[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]form[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]body[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
</[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]html[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]>
[/COLOR][/SIZE][/COLOR][/SIZE]

and it runs on the test server at home with no probs

BTW: You don't use semicolons in vb :biggrin:

Can someone tel me how to enable the error thing cause It doesn't work when I try LOLZ
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
OH, VB. I was using C# :p

What are you using to generate the files? When I use visual web express from Microsoft, the output almost always works without a problem when I change from my computer to the server, though I don't really use ASP.NET much.

You're missing some whitespace. That seems to be the biggest problem when I import your code. I'm looking it over more now.

EDIT: Yeah, looks just like a whitespace issue.
 
Last edited:

shad0wr1d3r

New Member
Messages
8
Reaction score
0
Points
0
I am using visual studio 2008 (proper one)

here is the another screen shot:
untitled.jpg

That is the custom error thingy, right?

The strange and somewhat funny part is that the file (Default.aspx) is the main page! =*(
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Yeah, your error page is helpful now. I get the same error. Does a file named "Default.aspx.vb" exist in the same directory as well as the file that defines TheTime._Default (which should be the same file)?
 
Last edited:

shad0wr1d3r

New Member
Messages
8
Reaction score
0
Points
0
Yeah, your error page is helpful now. I get the same error. Does a file named "Default.aspx.vb" exist in the same directory as well as the file that defines TheTime._Default (which should be the same file)?

default.aspx.vb was not in the publish folder =(. Uploading low, see if anything changes
Edit:
uploaded default.aspx.vb and the default.aspx.designer.vb and no change =(

NVM, I'll learn PHP instead =*(((((((((((
 
Last edited:

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
:p I did the same thing. I love PHP and I'm glad I never looked back.

Your Default.aspx.vb should have a "public partial class" (I think this is the same in VB) called _Default. I don't know why it's in a different namespace ("TheTime")
 

shad0wr1d3r

New Member
Messages
8
Reaction score
0
Points
0
I suck at PHP, can barelly code Data entry pages for MySQL

and no there is no more crappy files like you mentioned
 

garrettroyce

Community Support
Community Support
Messages
5,609
Reaction score
250
Points
63
Well, you can try deleting the "inherits" and "codebehind" sections and see if it works, as long as you don't have anything in the .vb file, which it sounds like you don't.

If you want to go the php route, let me know, I'm more able to help you with that.
 
Last edited:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Try "CodeFile", which takes a source file, rather than "CodeBehind", which takes a compiled assembly. See the attributes of the @Page directive for more info.

NVM, I'll learn PHP instead =*(((((((((((

Yeah, coding VB always makes me feel unclean. C# is surprisingly a decent language. F# looks like a big win for web apps.
 

shad0wr1d3r

New Member
Messages
8
Reaction score
0
Points
0
Try "CodeFile", which takes a source file, rather than "CodeBehind", which takes a compiled assembly. See the attributes of the @Page directive for more info.



Yeah, coding VB always makes me feel unclean. C# is surprisingly a decent language. F# looks like a big win for web apps.

F#???????? :wtf:
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
F# is a variant of the ML functional language. Functional programming is stateless, just like HTTP (though you'd use a little bit of state in F#).

Note that I'm heavily biased towards functional programming.
 
Top