ASP Code not working on ASP.Net Page

M

mae

I have created 2 ASP pages that gives users the option of switching
back and forth between French and English. They click on the word
English and it converted the text to English and the French link
converts the text to French. In the ASP page with the form on it there
is an includes file pointing to the scripts page. The scripts page
holds the values for both languages. It works great in ASP but as soon
as I rename the page to a .aspx file I get this error "Compiler Error
Message: BC30451: Name 'changelang' is not declared.". I do not
understand why I the ASP page works and the ASPX page will not work.
It is the exact same code, the only difference is the page extension
name. I found something today that mentioned that ASP does not support
runat="server". The only problem with that is I need the
runat="server" because all my form fields are server side.


Does anyone know the reasoning for this or no a way around this?
 
K

Kevin Spencer

If you renamed a .vbs file to .bat, do you think it would run as a batch
file? Do you think it would run at all? The "X" in ASPX is not the only
thing that is different between ASP and ASP.Net. Try almost evertything
else.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
S

selena

Thanks Patrice.

I'll check this site out. This is all new to me to any help and advise
is greatly appreicated!!!

Thanks :)
 
J

Jan Peter Stotz

mae said:
I have created 2 ASP pages that gives users the option of switching
back and forth between French and English. They click on the word
English and it converted the text to English and the French link
converts the text to French. In the ASP page with the form on it there
is an includes file pointing to the scripts page. The scripts page
holds the values for both languages. It works great in ASP but as soon
as I rename the page to a .aspx file I get this error "Compiler Error
Message: BC30451: Name 'changelang' is not declared.".

You have to declare all your variables in asp.net (under asp had tp be
enabled by said:
I do not
understand why I the ASP page works and the ASPX page will not work.

ASP and ASP.net are two different languages.
It is the exact same code, the only difference is the page extension
name.

And the different page extension now uses vb.net instead of vbscript. That
is a difference like Win95 to WinXP...

Jan
 
S

selena

Hi Jan

I just declared all my variables and I am getting the same error... Any
suggestions? Should I email you the code?

Selena
 
S

selena

Can I mix ASP code into ASP.Net? Here is what I have in my ASPX HTML
file. Can you tell me what is wrong with it?



<!--#INCLUDE file="ITQSettings.asp"-->
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="test.aspx.vb" Inherits="FishHealth.test"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title><%=Heading1%></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="ITQForm" method="post" action="login.aspx?lang=<%=strLang%>">
<table width="100%" border="0" id="TABLE1">
<tr>
<td width="25%"><a
href="test.aspx?lang=<%=changelang%>"><%=changelangtext%></a></td>
<td width="50%" align="center"><b><font
size="5"><%=Heading1%></font></b></td>
<td width="25%" rowspan="2" align="center"></td>
</tr>
</table>
</form>
</body>
</HTML>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top