Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,109 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,148 people online right now. Registration is fast and FREE... Join Now!




How to run an aspx page? (Getting error: Invalid Character)

2 Pages V  1 2 >  
Reply to this topicStart new topic

How to run an aspx page? (Getting error: Invalid Character), Dumbass question, total beginner

gabehabe
post 8 Oct, 2008 - 07:05 AM
Post #1


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


I literally just started *trying* to learn ASP.NET a few minutes ago. But I've already run into a problem, with the template code (provided by #Develop, but I think it's the same as VS anyway)

The problem is with this bit:
asp
<%@ Page
Language = "C#"
AutoEventWireup = "false"
Inherits = "webpage.Default"
ValidateRequest = "false"
EnableSessionState = "false"
%>

When I try to open "Default.aspx" in my web browser, it just pops up saying "Invalid character at line 1, col 2" which is that % symbol... but what does that mean? I've seen a few pages in the past, and I'm pretty sure it's supposed to be there?

Thanks in advance
-Danny
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 07:22 AM
Post #2


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


QUOTE(gabehabe @ 8 Oct, 2008 - 08:05 AM) *

I literally just started *trying* to learn ASP.NET a few minutes ago. But I've already run into a problem, with the template code (provided by #Develop, but I think it's the same as VS anyway)

The problem is with this bit:
asp
<%@ Page
Language = "C#"
AutoEventWireup = "false"
Inherits = "webpage.Default"
ValidateRequest = "false"
EnableSessionState = "false"
%>

When I try to open "Default.aspx" in my web browser, it just pops up saying "Invalid character at line 1, col 2" which is that % symbol... but what does that mean? I've seen a few pages in the past, and I'm pretty sure it's supposed to be there?

Thanks in advance
-Danny


It means there's a problem with that area. It could be the spacing of the items or that you have the sharp character.

Whatever it is, it doesn't like what in the Page code.

This post has been edited by MacAnimeGirl: 8 Oct, 2008 - 07:24 AM
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 8 Oct, 2008 - 07:27 AM
Post #3


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


Well I just got rid of that whole block and now it works...

Does it serve any purpose? laugh.gif

EDIT:
The appearance works, but now the functionality doesn't.

I'm getting there, slowly but surely sleep.gif
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 07:33 AM
Post #4


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


Lol.

Yeah you need it for the functionality. Did you try to taking out the spacing? ASP.NET is a lot like VB.NET but also very different from it.

ASP.NET can be a little weird about spacing, I've found at least. You may need to try having it all one line instead of divided up like it was.
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 8 Oct, 2008 - 07:38 AM
Post #5


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


Even just this bit with the language gives the same error:
<%@ Page Language="C#" %>

That's just confused me even more, I've definitely seen that on other pages unsure.gif
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 07:43 AM
Post #6


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


QUOTE(gabehabe @ 8 Oct, 2008 - 08:38 AM) *

Even just this bit with the language gives the same error:
<%@ Page Language="C#" %>

That's just confused me even more, I've definitely seen that on other pages unsure.gif



Okay. I'm going to open up my asp.net and see what I get. Give me a few moments.

But you should be getting some kind of box coming up (like it does for VB) showing you the applicable statements(arguments?) to put in. Does it?

This post has been edited by MacAnimeGirl: 8 Oct, 2008 - 07:44 AM
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 07:54 AM
Post #7


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


Try closing the tab and then reopening it.

CODE

<%@ Page Language="C#" AutoEventWireup="false" CodeFile="App_Code/class1.cs" Inherits="_Default" %>


Then you'll need to change to the CodeFile to a C# coding file. It'll need the .cs extension.

Otherwise you'll get an error about the coding language not being consistent.

This post has been edited by MacAnimeGirl: 8 Oct, 2008 - 08:01 AM
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 8 Oct, 2008 - 07:57 AM
Post #8


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


Still nothing.
error on line 1 at column 2: StartTag: invalid element name
Same error~ (I've tried removing all elements, too~ still nothing)

((NOTE: I changed yours where it said .vb to .cs smile.gif))

EDIT: Even just putting <%@ %> gives the same error~
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 08:06 AM
Post #9


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


QUOTE(gabehabe @ 8 Oct, 2008 - 08:57 AM) *

Still nothing.
error on line 1 at column 2: StartTag: invalid element name
Same error~ (I've tried removing all elements, too~ still nothing)

((NOTE: I changed yours where it said .vb to .cs smile.gif))

EDIT: Even just putting <%@ %> gives the same error~


Are you really dying to code this C#? Because everytime I've changed things for the C# I just get more errors. Lol.

Error 1 'ASP.default_aspx.SupportAutoEvents': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website1\ae4449e3\d6ea81b4\App_Web_hnsvexyu.0.cs

Error 2 'ASP.default_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website1\ae4449e3\d6ea81b4\App_Web_hnsvexyu.0.cs

Error 3 'ASP.default_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website1\ae4449e3\d6ea81b4\App_Web_hnsvexyu.0.cs

Error 4 'ASP.default_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\website1\ae4449e3\d6ea81b4\App_Web_hnsvexyu.0.cs

Just for this bit of code.

CODE
<%@ Page Language="C#" AutoEventWireup="false" CodeFile="class1.cs" Inherits="_Default" %>


You can do it, but it doesn't seem like anything will be precoded for you. Be careful!

Mind I'm no longer getting errors for the bit of code but these errors are cause by it. But now there's nothing wrong with the syntax in there. The syntax is correct.

This post has been edited by MacAnimeGirl: 8 Oct, 2008 - 08:07 AM
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 8 Oct, 2008 - 08:33 AM
Post #10


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


LMAO~

Yeah, C# wub.gif
Can't stand VB mad.gif
User is offlineProfile CardPM

Go to the top of the page

MacAnimeGirl
post 8 Oct, 2008 - 09:07 AM
Post #11


D.I.C Head

**
Joined: 30 Sep, 2008
Posts: 132


My Contributions


I've never learned C#. My husband's getting a 24 hour learning program that has 24 hour long tutorials. I'm going to sit down with him and hopefully learn it.

Okay. Is there anything else that's giving you a problem. I don't know if yours has been solved yet. Has it?

This post has been edited by MacAnimeGirl: 8 Oct, 2008 - 09:08 AM
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 8 Oct, 2008 - 10:14 AM
Post #12


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


Not at all. I've still got no idea what's causing it, either~ I even tried copy/pasting someone else's working code, and I still got the same error. sad.gif
User is offlineProfile CardPM

Go to the top of the page

2 Pages V  1 2 >
Fast ReplyReply to this topicStart new topic
Time is now: 11/21/08 09:48AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month