473,785 Members | 2,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid RSS created by ASP.NET page

I'm trying to create an RSS feed that is written dynamically by an
ASP.NET page. I know there are several ways to do it, but the quickest
for me was to follow the Scott Mitchell tutorial at
http://msdn.microsoft.com/library/de...ssw-aspnet.asp.

I think the problem is that the <@ page > directive at the top of the
ASP.NET page creates a blank first line in the outputted XML. This
blank line makes the RSS feed invalid, and News Readers such as
NewzCrawler won't parse it.

Is it possible to output xml (or anything for that matter) from an
ASP.NET page with the @ Page directive in without leaving the first
line blank?

Many thanks

Henry

Nov 19 '05 #1
5 1443
If the <%@Page %> is being emitted to the client, then it sounds like the
page isn't being processed on the server normally. Perhaps ASP.NET isn't
propery registered on the server?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm trying to create an RSS feed that is written dynamically by an

ASP.NET page. I know there are several ways to do it, but the quickest

for me was to follow the Scott Mitchell tutorial at

http://msdn.microsoft.com/library/de...ry/en-us/dnasp
p/html/aspnet-createrssw-aspnet.asp.

I think the problem is that the <@ page > directive at the top of the
ASP.NET page creates a blank first line in the outputted XML. This
blank line makes the RSS feed invalid, and News Readers such as
NewzCrawler won't parse it.

Is it possible to output xml (or anything for that matter) from an
ASP.NET page with the @ Page directive in without leaving the first
line blank?

Many thanks

Henry


Nov 19 '05 #2
Thanks Brock

The <%@Page %> isn't being output to the browser, but line one of the
XML output to the browser is blank, because (i'm guessing) this is
where the directive sits in the .aspx before it delivers its output.
The problem is getting the output from the aspx file to begin on line
one not line 2. Any ideas?

Henry

Brock Allen wrote:
If the <%@Page %> is being emitted to the client, then it sounds like the page isn't being processed on the server normally. Perhaps ASP.NET isn't propery registered on the server?

-Brock
DevelopMentor
http://staff.develop.com/ballen
I'm trying to create an RSS feed that is written dynamically by an

ASP.NET page. I know there are several ways to do it, but the quickest
for me was to follow the Scott Mitchell tutorial at

http://msdn.microsoft.com/library/de...ry/en-us/dnasp p/html/aspnet-createrssw-aspnet.asp.

I think the problem is that the <@ page > directive at the top of the ASP.NET page creates a blank first line in the outputted XML. This
blank line makes the RSS feed invalid, and News Readers such as
NewzCrawler won't parse it.

Is it possible to output xml (or anything for that matter) from an
ASP.NET page with the @ Page directive in without leaving the first
line blank?

Many thanks

Henry


Nov 19 '05 #3
IMO this is because it outputs the line feed that follows the directive.

The first solution I see would be then to have the first tag, just after the
page directive (on the same line)...

Patrice

--

<he**********@h otmail.com> a écrit dans le message de
news:11******** *************@z 14g2000cwz.goog legroups.com...
I'm trying to create an RSS feed that is written dynamically by an
ASP.NET page. I know there are several ways to do it, but the quickest
for me was to follow the Scott Mitchell tutorial at
http://msdn.microsoft.com/library/de...ssw-aspnet.asp.
I think the problem is that the <@ page > directive at the top of the
ASP.NET page creates a blank first line in the outputted XML. This
blank line makes the RSS feed invalid, and News Readers such as
NewzCrawler won't parse it.

Is it possible to output xml (or anything for that matter) from an
ASP.NET page with the @ Page directive in without leaving the first
line blank?

Many thanks

Henry

Nov 19 '05 #4
> I'm trying to create an RSS feed that is written dynamically by an
ASP.NET page. I know there are several ways to do it, but the quickest for me was to follow the Scott Mitchell tutorial at
http://msdn.microsoft.com/library/de...ssw-aspnet.asp.
I think the problem is that the <@ page > directive at the top of the
ASP.NET page creates a blank first line in the outputted XML. This
blank line makes the RSS feed invalid, and News Readers such as
NewzCrawler won't parse it.

Is it possible to output xml (or anything for that matter) from an
ASP.NET page with the @ Page directive in without leaving the first
line blank?


Just use Response.Clear first, ie:

Response.Clear( );
Response.Conten tType = "text/xml";
Response.Write( rss1.RSSData); //rss1 is the ipworks RSS control in this sample Response.End();

Regards,
Lance R.
/n software
http://www.nsoftware.com/

-

Nov 19 '05 #5
Patrice, Lance

Thank you both for your ideas, both of which I think would work
depending on how I was doing it. However, sometimes the simplest ideas
are best, and Patrice was spot on. I moved my Repeater object to line
one, like so:

<%@ Page Language="vb" ContentType="te xt/xml" AutoEventWireup ="false"
Codebehind="ind ex.aspx.vb" Inherits="rss.i ndex" %><asp:Repeate r
id="RssRepeater " runat="server"> <HeaderTemplate ><?xml version="1.0"
encoding="UTF-8" ?>

and hey presto, the output starts on line one. So simple, why didn't I
think of it myself?

Thanks guys.

Henry

Lance R. wrote:
I'm trying to create an RSS feed that is written dynamically by an
ASP.NET

page. I know there are several ways to do it, but the quickest
for me was to

follow the Scott Mitchell tutorial at


http://msdn.microsoft.com/library/de...ssw-aspnet.asp.

I think the problem is that the <@ page > directive at the top of the
ASP.NET page creates a blank first line in the outputted XML. This
blank line makes the RSS feed invalid, and News Readers such as
NewzCrawler won't parse it.

Is it possible to output xml (or anything for that matter) from an
ASP.NET page with the @ Page directive in without leaving the first
line blank?


Just use Response.Clear first, ie:

Response.Clear( );
Response.Conten tType = "text/xml";
Response.Write( rss1.RSSData); //rss1 is the ipworks RSS control in this sample Response.End();

Regards,
Lance R.
/n software
http://www.nsoftware.com/

-


Nov 19 '05 #6

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

Similar topics

5
3437
by: Nick Flandry | last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my development environment (Win2K server running IIS 5) and a test environment (also Win2K server running IIS 5), but fails on IIS 6 running on a Win2003 server. The web uses Pages derived from a custom class I wrote (which itself derives from Page) to provide some common functionality. The Page_Load handler the failing webpage starts out like this: ...
0
1600
by: Mark Phanides | last post by:
My ASP.NET application intermittantly (but always at same point) redirects to the 'Invalid Syntax Error' web page for some unknown reason. I've created a ASP.NET application written in VB.NET with just two ASPX pages, Login.aspx and Main.aspx (both dynamically generated on each load). Users first hit Login.aspx which prompts for login details, and then performs some custom authenication and creates some session variables. If authentication is...
2
783
by: Brad | last post by:
I have an intranet app that has just started sporadically getting the following error "The viewstate is invalid for this page and might be corrupted." By sproadic I mean 3-4 times during the past two days out of 100's of hits. The error just started yesterday and this app has been running for quite some time without this error and has not been updated just before or after the error started. Reseaching this error I've checked the...
3
3688
by: Mr.KisS | last post by:
Hello all, I'm working with : WinXP PRO SP1, MS SQL 2005 Express, Visual Web Dev 2005 Express. I have an aspx page which must execute a stored procedure : ______________ try { myCommand.ExecuteNonQuery();
1
4905
by: Hifni Shahzard | last post by:
Hi, I got a stored procedure, where it returns a value. But if I execute it. It gives an error as "Invalid cast from System.Int32 to System.Byte.". To make clear how do I execute this, below I'm specifiying my code: The Code used in Visual Studio: Function GetRank(ByVal ID As Integer, ByVal Comp As String, ByVal Sec As String, ByVal iDate As Date) As String 'Dim Ret As Integer
5
4165
by: Ed L. | last post by:
I have 5 corrupted page headers as evidenced by these errors: ERROR: Invalid page header in block 13947 of ... The corruption is causing numerous queries to abort. First option is to try to salvage data before attempt restore from backup. I want to try to edit the file to zero out the bogus headers. I realize there may be data lost from this attempt. I have scalpel (binary editor) in hand. Which bytes should I edit, and what do...
6
1952
by: dpomt | last post by:
I have a quite strange problem with the Menu control. I have ten languages and each language has a SiteMapDataSource and a Menu. For better performance, I am creating a hashtable (language -> (Menu, SitemapDataSource)) and holding this hashtable in the Cache object. On each page request, I am inserting the menu corresponding to the specified language to page. Hence, DataBinding is only done once per each language (when inserting the Menu...
2
2177
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application. -------------------------------------------------------------------------------- Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/in configuration or <%@ Page EnableEventValidation="true"...
0
260
by: Chris | last post by:
I have been getting a very intermitant error on a page: Invalid postback or callback argument. Event validation is enabled. I understand that in .net 2.0 things like hiding controls on the page can cause this sort of error. My page has controls which are created dynamically. The controls created are always the same and are always in the same order so the hiding of controls is not such an issue. Can anyone point me in the right direction. I...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10090
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9949
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5380
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.