Displaying XML with ASP.NET
I said in my first post that I would be back when I find myself stuck again, well...I'm stuck again.
Kind of at least. I haven't gotten to the point of being stuck since I need a point in the right direction first.
Now, enough of that. My next goal is finding the best way to go about displaying XML as HTML. In my ASP.NET studies, I've read about the neat @render function to create layout pages. It was a big step in the right direction. I'm trying to find a way to play off that.
A big part of my project is a database of articles. Each article shares the common sections 'title,' 'date,' 'author,' 'category,' and 'content.' I'd like to create an article layout page, then have it refer to a particular XML sheet for each article and replace the corresponding divisions on the layout page with the correct sections of the article.
I'm not sure if this makes sense here, I can see it in my head though. Is there some way to make a @render type function pull information from the XML and place it in it's correct spot on the page?
I just recently heard about XSLT, but I do not know enough about it yet to know if this will be useful. I will continue my reading in the meantime.
Any feedback, or a friendly point in the right direction will be greatly appreciated.
bdenny20 trying to learn more then one coding program at a time will make you the proverbial "Jack of all trades, master of none".
Go here to learn xsl and xml for that matter.
Probably not the best approach, but every time I start reading up on something, I usually get a warning that I must have a basic understanding of 'X' concepts. I just can't resist.
There is a bright side though, I'm not cornering myself. I'm picking up and learning new techniques by the hour, less than even. I've finally gotten ContentPlaceHolders under control, and it looks like it's doing exactly what I was trying to accomplish. No XML, but this still works like a charm.
P.S. My bad sunfighter, I thought that last part was part of your signature. That's the exact same resource I was reading. In fact, 80% of my reading comes from w3schools. Neat site there!
learning .net myself too. I suspect you need to look at the XmlDataSource control. This page is out of date but it gets the idea across in a simple way.
Thanks for the heads up man!
Do you know if this is the most up-to-date way to do something like this? I've been harked at once here already for using old, out-of-date techniques, and I don't want to be there again...
Regardless, I'll read up on this. So much homework to do.
i cant answer best practice questions, but i use visual studio 10 with .net 4.0 and it's still a valid control in VS10, so im sure it's fine. No one else has piped up so I hope this helps.
( I spend alot of time on MSDN these days)
- oh ther is an asp.net forum btw, might wanna try there in regards to best practice or use of xmldatasource
|All times are GMT +1. The time now is 11:26 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.