Ask a Question related to ASP.NET General, Design and Development.
-
Rich #1
Response.Write not working
Hello,
in my ASP.NET c# project I can ouput text using
response.write from the code behind class. It works in the
aspx file using <asp:TextBox> controls too. It also works
using <%="Hello"%>. But using
response.write("hello");
I get the error
Compiler Error Message: CS1519: Invalid token '(' in
class, struct, or interface member declaration
Any Ideas why? Here is the complete code:
<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="CRS_Web.WebForm1" %>
<%@ Import Namespace="System.Data.SqlClient"%>
<%@ Import Namespace="CRS_Application"%>
<%@ Import Namespace="CRS_Web"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft
Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript"
content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body bgcolor="white" >
<script runat="server" language="c#">
Response.Write("Hello, Richard!" );
</script>
</body>
</HTML>
Rich Guest
-
response.write URL
I have a page which lists conferences and events which the company for which I coded the site attends or hosts themselves. They want to be able to... -
If response.write help
Hi, I am trying to code my asp page so that if you are on page Y, the link to page Y in the nav, is in the over state to help users identify where... -
quotes in response.write
Hi there, I want to do: response.write("bla bla bla "in quotes" bla bla") How do I show the quotes on the screen in asp like I have to do \"... -
Response.Write and Response.Redirect
On my Page_Load event, i need to do some validation and then either let them proceed, or display a error message and boot them back to the previous... -
asp response.write doesn't display
Maybe you could start with a more barebones file, especially one without an unclosed LINK tag: -
Marina #2
Re: Response.Write not working
Any code in a server side script declared via <script> tag, has to contain
functions only.
If you just need to run some lines, they need to be in <% %> blocks.
Better yet, avoid server side scripts alltogether. This is almost always
possible.
"Rich" <ms-news@richard-quinn.com> wrote in message
news:034601c3507b$608b5790$a101280a@phx.gbl...> Hello,
>
> in my ASP.NET c# project I can ouput text using
> response.write from the code behind class. It works in the
> aspx file using <asp:TextBox> controls too. It also works
> using <%="Hello"%>. But using
>
> response.write("hello");
>
> I get the error
> Compiler Error Message: CS1519: Invalid token '(' in
> class, struct, or interface member declaration
>
> Any Ideas why? Here is the complete code:
> <%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
> AutoEventWireup="false" Inherits="CRS_Web.WebForm1" %>
> <%@ Import Namespace="System.Data.SqlClient"%>
> <%@ Import Namespace="CRS_Application"%>
> <%@ Import Namespace="CRS_Web"%>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
> Transitional//EN" >
> <HTML>
> <HEAD>
> <title>WebForm1</title>
> <meta name="GENERATOR" Content="Microsoft
> Visual Studio .NET 7.1">
> <meta name="CODE_LANGUAGE" Content="C#">
> <meta name="vs_defaultClientScript"
> content="JavaScript">
> <meta name="vs_targetSchema"
> content="http://schemas.microsoft.com/intellisense/ie5">
> </HEAD>
> <body bgcolor="white" >
> <script runat="server" language="c#">
> Response.Write("Hello, Richard!" );
> </script>
> </body>
> </HTML>
>
Marina Guest



Reply With Quote

