473,385 Members | 1,400 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Parser Error: The server block is not well formed

Hi,

I have a login/logout application, which works fine using sessions. But
when the user logs out, they can navigate back to the previous page
usng the back button, apparently a perculiar querk of the cache.

The following code should apparently rectify this

<%@ Response.Expires = 0 %>
<%@ Response.ExpiresAbsolute = Now() -1 %>
<%@ Response.AddHeader "pragma", "no-cache" %>
<%@ Response.AddHeader "cache-control", "private" %>
<%@ Response.CacheControl = "no-cache" %>

I have placed this directly after the following line

<%@ Page language="c#" CodeBehind="AddAssess.aspx.cs"
AutoEventWireup="false" Inherits="PDTdb.AddAssess" %>

but when I try to view the page i get the following error:

"Parser Error: The server block is not well formed"

and the first line <%@ Response.Expires = 0 %> is highlighted.

Any idea what the problem is?

Thanks.

Nov 19 '05 #1
5 11902
I think you want to remove the @ from all of those.

or make use of the @OutputCache directive...

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Assimalyst" <c_******@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Hi,

I have a login/logout application, which works fine using sessions. But
when the user logs out, they can navigate back to the previous page
usng the back button, apparently a perculiar querk of the cache.

The following code should apparently rectify this

<%@ Response.Expires = 0 %>
<%@ Response.ExpiresAbsolute = Now() -1 %>
<%@ Response.AddHeader "pragma", "no-cache" %>
<%@ Response.AddHeader "cache-control", "private" %>
<%@ Response.CacheControl = "no-cache" %>

I have placed this directly after the following line

<%@ Page language="c#" CodeBehind="AddAssess.aspx.cs"
AutoEventWireup="false" Inherits="PDTdb.AddAssess" %>

but when I try to view the page i get the following error:

"Parser Error: The server block is not well formed"

and the first line <%@ Response.Expires = 0 %> is highlighted.

Any idea what the problem is?

Thanks.

Nov 19 '05 #2
Change:
and the first line <%@ Response.Expires = 0 %> is highlighted.


To:

<% Response.Expires = 0; %>

As KArl said, remove the @, but also note the semicolon.

-Brock
DevelopMentor
http://staff.develop.com/ballen

Nov 19 '05 #3
Thanks guys,
Thats solved the problem for the first two lines, i'd tried a few
combinations of < and @ etc, but it seems it needed the ;.

Still having trouble with the third line though. I've applied Brock's
idea to all the lines, but now the third is highlighted with the
following error:

Compilation error: CS1002: ; expected

any suggestions?

thanks again

Nov 19 '05 #4
AddHeader is a method -- it needs parenthesis around the parameters. And
then, yes, a semicolon at the end.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Thanks guys,
Thats solved the problem for the first two lines, i'd tried a few
combinations of < and @ etc, but it seems it needed the ;.
Still having trouble with the third line though. I've applied Brock's
idea to all the lines, but now the third is highlighted with the
following error:

Compilation error: CS1002: ; expected

any suggestions?

thanks again


Nov 19 '05 #5
AddHeader is a method -- it needs parenthesis around the parameters. And
then, yes, a semicolon at the end.

-Brock
DevelopMentor
http://staff.develop.com/ballen
Thanks guys,
Thats solved the problem for the first two lines, i'd tried a few
combinations of < and @ etc, but it seems it needed the ;.
Still having trouble with the third line though. I've applied Brock's
idea to all the lines, but now the third is highlighted with the
following error:

Compilation error: CS1002: ; expected

any suggestions?

thanks again


Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MistralZ | last post by:
Hi all! I am using Oracle XML parser ver 9.0.1.0.0 for C++ and I am having a strange problem with quotes. Parser throws a parsing error when trying to parse attributes containing quotes (even...
5
by: vc | last post by:
Hi, I'm looking for an XML parser that wouldn't stop if it finds a minor error in an XML file. I need to parse an HTML file and there are a lot of HTML pages that, for instance, don't enclose...
0
by: Garry | last post by:
I'm getting this error when I attemp to link a word document to a help screen. Description: An error occurred during the parsing of a resource required to service this request. Please review...
0
by: dfgasner | last post by:
I am very new at all of this and am using a book to put together an e-commerce website using VS.NET 2003. I have run into a problem and have looked around the web but with no help. I am getting...
6
by: Jan Danielsson | last post by:
Hello all, I guess this is a question for people who have written a parser. Does an XML parser ever need to be recursive? I mean like: &fo&bar;o; I know this particular example is in the...
9
by: Martin Plantec | last post by:
Hello, I have managed (with your help!) to make a working XSLT stylesheet; it works fine locally (Windows Apache + PHP with Sablotron 1.0), but it fails on the remote host (FreeBSD Apache + PHP...
39
by: eruanion | last post by:
Hi, I've been working on this for a while now and I can't seem to find out what is wrong with my code. I have 2 files one c3common.js which only contains javascript functions for my main html page...
1
by: LiveCycle | last post by:
Hi, I've got a longstanding project that's been working fine for about a year. I was working on one of the pages, a simple download page. After making a little tweak on the page, I tried to...
4
by: fbrewster | last post by:
I'm writing an HTML parser and would like to use Internet Explorers DOM parser. Can I use Internet Explorers DOM parser through a web service? thanks for the help
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.