Simple question ??

G

Guest

Dear all,

I need to build a web application which will contains articles (long or short)
I was wondering on what is the correct way to retrive those article on web
page.
In orther words, when there is such information to be displayed are they
coming from imported files, database ?

Where and how this type of information is stored ?
What is the way to retrieve such information in order to display it in page ?

Thanks for your reply

regards
serge
 
P

Peter Rilling

Your questions are too vague to really be able to answer. Information
storage and display our dependent upon your particular situation and without
knowing the exact content that you want to process, it is hard to give an
answer.

You have to ask yourself what makes more sense. Will the articles be
relating to other pieces of information, if so then maybe a database. Are
the articles static content, then maybe just store them as files on the
disk. You will need to evaluate any security issues with your content. For
instance, if they are stored on your local disk and you only want the user
to access them through your pages, then you might have to place them outside
of your virtual folder, but then you have to consider additional security to
allow IIS to access them. Are the articles already formatted? Will the
user be submitting new articles? Where will the articles come from?

I would suggest that you work out the requirements for your application,
then ask specific questions about your project or scenario. There is also
the tried and true method of implementing alternative solutions to see which
might be better.

Basically, there is no "correct way".
 
S

Steve H.

The easiest ways though ASP.NET is to use the dataset object. The dataset draws it's information either from an XML file or a database. XML is best if you are unfamiliar with databases, it's rather strait forward.

example...

-------
private DataSet theDataStore;

private string theRootDirectory = "c:\";

theDataStore = new DataSet();

theDataStore.ReadXmlSchema(theRootDirectory + "Database.xsd");

theDataStore.ReadXml(theRootDirectory + "Database.xml");

-------

This is pretty basic. Use visual studio to design a xsd and xml file to work with. I use XML on one site because there is no database servers available.

If your just beginning with ASP.NET programming, then learning what all the dataset can do is one of the most central parts. As you move forward, you might stray away from the dataset because it's a bit general. But as a beginner, you should go with the best documented and versital solution. Any and All sites that are big should rely on a true database, not XML.

I figured that you'll get the normal SQL solutions in response, XML is another possibility.

Good luck
 
K

Kevin Spencer

I need to build a web application which will contains articles (long or
short)
I was wondering on what is the correct way to retrive those article on web
page.
In orther words, when there is such information to be displayed are they
coming from imported files, database ?

So far, we can glean that your requirements include:

A web application.
It has something to do with "articles" (undefined).
These "articles" are stored somewhere (you don't know where)
They are displayed in a web page.


"Articles" indicates some kind of document. Could be pure text, scanned
newspaper articles in TIFF format, HTML, XML, PDF, RTF, Word documents,
Excel documents, who knows? Well, if you're writing the app, I would have to
say you ought to.

Where are they stored? I don't know. Where are they supposed to come from?
Who is creating or has created them? Is the only requirement that they be
displayed in a web page, or are there other requirements? Is this an
Internet or an Intranet? How many of them are there? Will they be edited
online? Whose idea was this in the first place? Perhaps he/she would know.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
K

Kevin Spencer

How do you store a PDF document in an XML file? In a CDATA section?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

The easiest ways though ASP.NET is to use the dataset object. The dataset
draws it's information either from an XML file or a database. XML is best
if you are unfamiliar with databases, it's rather strait forward.

example...

-------
private DataSet theDataStore;

private string theRootDirectory = "c:\";

theDataStore = new DataSet();

theDataStore.ReadXmlSchema(theRootDirectory + "Database.xsd");

theDataStore.ReadXml(theRootDirectory + "Database.xml");

-------

This is pretty basic. Use visual studio to design a xsd and xml file to
work with. I use XML on one site because there is no database servers
available.

If your just beginning with ASP.NET programming, then learning what all the
dataset can do is one of the most central parts. As you move forward, you
might stray away from the dataset because it's a bit general. But as a
beginner, you should go with the best documented and versital solution. Any
and All sites that are big should rely on a true database, not XML.

I figured that you'll get the normal SQL solutions in response, XML is
another possibility.

Good luck
 
G

Guest

Thnaks peter,
Ok let's be general in the sense that how dynamic web page content iare
usually handle ?
 
G

Guest

Thnaks kevin.

More generaly how dynamic web page content works ?
The idea is that I need to build a web site for a customer who will be able
to easily change its content (talking about an article or news). I have to
consider that people who will be able to update document knows nothing about
htm, xml or whatever stuff.

Just a simply way to update document or introduce new one

What I was wondering also is that if we condider that document can be any
file format, does a database can store those file object or they could be
only path in tables ?

I kow it is not clear yet but just have a brif idea on how usually people
process with dynamic content

serge
 
S

Steve H.

I dont... and i apologize.

I must have misunderstood the problem. Even if it's possible, the general
idea of a 1mb pdf in a xml file doesnt sound too attractive. I thought he
meant general data like html content.
 
K

Kevin Spencer

Hi serge,
More generaly how dynamic web page content works ?

A web page is basically an HTML document. HTML is a pure text markup
language that enables data to be displayed in a formatted manner. ASP.Net is
a technology that, at the most basic level, delivers HTML to a web browser.
Originally, HTML documents were simply files on a server. When a Request
came to the server for "somePage.htm," the server opened "somePage.htm" from
its file system, and streamed it back to the browser, which then parsed and
formatted the document. What ASP.Net does, again at base level, is to bypass
the "open a file" part, and simply stream HTML to the browser. It controls
the HTML that is streamed to the browser as an HTML document. It is
therefore, "dynamic content."

Now, of course, browsers can deal with many other forms of documents,
images, files, and so on. An HTML page can "contain," for example, an image.
However, it doesn't actually contain the image. It is pure text. It contains
an image markup tag that tells the browser where to download the image from,
where to place it in the page, how to resize it, etc. A browser can also
display a non-HTML file directly, assuming that the browser supports that
file format. Internet Explorer, for example, can display Word documents,
Excel Files, RTF files, GIF images, JPG images, and several other file
formats straight out of the box. Adobe makes browser add-ons for PDF files,
as well as do any number of other vendors. And ASP.Net can also deliver any
file format to a browser in its native state.

In fact, ASP.Net can work with anything that a browser can work with, and
other web technologies as well, including XML Web Services, Remoting, and so
on.
The idea is that I need to build a web site for a customer who will be
able
to easily change its content (talking about an article or news). I have to
consider that people who will be able to update document knows nothing
about
htm, xml or whatever stuff.

Now you're thinking like a User. If you want to program, you have to think
like a programmer. Humans don't see data the same way that computers do. We
see "an article" (some form of written language and/or media communication)
in a newspaper, on a web page, in a newsgroup, on television, what-have-you,
and our brain automatically extracts the information from it, converts it
into abstract thought, and we don't consciously think of one medium as being
different from another. In fact, we don't consciously think of the delivery
mechanism at all; we think of the thought information we extract from it.

To write a program, however, you don't think of data as "an article."
"Aritcle" is a generic and broad abstraction that is useful to humans,
because humans are sophisticated enough to get a general idea of what is
being discussed, and often glean more information (only the information that
is pertinent to the listener) from the context in which it is used. But to a
computer, and in reality, it is data. It is in some format. It is stored in
some location. It requires parsing, munging, and all of that other stuff
which our brains do automatically, to be done by a computer program. The
program knows nothing but what we tell it. It is not capable of
interpretation, abstraction, or intelligent thought. It cannot do anything
the programmer does not tell it explicitly to do. In short, humans are very
very smart. Computers are actually very very stupid.

To us, a "document" is something we read, from any number of sources, and
what the format is is not of any importance. To a computer, a "document" is
a one-dimensional stream of bits (1s and 0s). How it is handled depends
entirely on what format those bits are arranged in.
What I was wondering also is that if we condider that document can be any
file format, does a database can store those file object or they could be
only path in tables ?

The first thing you need to do is to start thinking like a programmer. You
need to define the terms "article" and "document" very specifically, or you
will not be able to tell the program how to deal with them. What are the
specific definitions of those sets of data that will be defined as
"articles?" Are they multi-page TIFF files, Word documents, pure text
documents, multi-media presentations, PDF files, etc.?

When you talk about "updating" you're opening up another can of worms. A
text file is relatively easy to edit, but not in a browser. And as the
browser is only looking at a downloaded copy of a file, how does the end
user save the changes back to the server? A PDF document, on the other hand,
requires some specific Adobe software to be installed on the client machine
to be edited. And the same kinds of problems with regards to getting it back
to the web server exist for PDF and any other document format as well.

And of course, we have not yet discussed how the "articles" will be stored.
That also depends on the answers to the questions I posed above.
Just a simply way to update document or introduce new one

Again, you're thinking like a User. Computer programs look simple to users
because programmers go to a great deal of difficulty to make them seem that
way. The more user-friendly an interface is, the more programmer-UNfriendly
the program actually is. An example of a "simple" ASP.Net application might
be to create a page that dynamically writes "hello world" to the browser. It
takes no user input from the user. it contains no logic. It simply outputs a
string. THAT is simple. Almost everything else is complex in one way or
another, and to a greater or lesser degree.

I hope this gives you an idea of where you need to start. Perhaps a "hello
world" ASP.Net web page would be a good place to start. You can work your
way up from there, one piece at a time. If you take small steps, you're much
less likely to fall.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 
G

Guest

Thnaks a lot

Kevin Spencer said:
Hi serge,


A web page is basically an HTML document. HTML is a pure text markup
language that enables data to be displayed in a formatted manner. ASP.Net is
a technology that, at the most basic level, delivers HTML to a web browser.
Originally, HTML documents were simply files on a server. When a Request
came to the server for "somePage.htm," the server opened "somePage.htm" from
its file system, and streamed it back to the browser, which then parsed and
formatted the document. What ASP.Net does, again at base level, is to bypass
the "open a file" part, and simply stream HTML to the browser. It controls
the HTML that is streamed to the browser as an HTML document. It is
therefore, "dynamic content."

Now, of course, browsers can deal with many other forms of documents,
images, files, and so on. An HTML page can "contain," for example, an image.
However, it doesn't actually contain the image. It is pure text. It contains
an image markup tag that tells the browser where to download the image from,
where to place it in the page, how to resize it, etc. A browser can also
display a non-HTML file directly, assuming that the browser supports that
file format. Internet Explorer, for example, can display Word documents,
Excel Files, RTF files, GIF images, JPG images, and several other file
formats straight out of the box. Adobe makes browser add-ons for PDF files,
as well as do any number of other vendors. And ASP.Net can also deliver any
file format to a browser in its native state.

In fact, ASP.Net can work with anything that a browser can work with, and
other web technologies as well, including XML Web Services, Remoting, and so
on.


Now you're thinking like a User. If you want to program, you have to think
like a programmer. Humans don't see data the same way that computers do. We
see "an article" (some form of written language and/or media communication)
in a newspaper, on a web page, in a newsgroup, on television, what-have-you,
and our brain automatically extracts the information from it, converts it
into abstract thought, and we don't consciously think of one medium as being
different from another. In fact, we don't consciously think of the delivery
mechanism at all; we think of the thought information we extract from it.

To write a program, however, you don't think of data as "an article."
"Aritcle" is a generic and broad abstraction that is useful to humans,
because humans are sophisticated enough to get a general idea of what is
being discussed, and often glean more information (only the information that
is pertinent to the listener) from the context in which it is used. But to a
computer, and in reality, it is data. It is in some format. It is stored in
some location. It requires parsing, munging, and all of that other stuff
which our brains do automatically, to be done by a computer program. The
program knows nothing but what we tell it. It is not capable of
interpretation, abstraction, or intelligent thought. It cannot do anything
the programmer does not tell it explicitly to do. In short, humans are very
very smart. Computers are actually very very stupid.

To us, a "document" is something we read, from any number of sources, and
what the format is is not of any importance. To a computer, a "document" is
a one-dimensional stream of bits (1s and 0s). How it is handled depends
entirely on what format those bits are arranged in.


The first thing you need to do is to start thinking like a programmer. You
need to define the terms "article" and "document" very specifically, or you
will not be able to tell the program how to deal with them. What are the
specific definitions of those sets of data that will be defined as
"articles?" Are they multi-page TIFF files, Word documents, pure text
documents, multi-media presentations, PDF files, etc.?

When you talk about "updating" you're opening up another can of worms. A
text file is relatively easy to edit, but not in a browser. And as the
browser is only looking at a downloaded copy of a file, how does the end
user save the changes back to the server? A PDF document, on the other hand,
requires some specific Adobe software to be installed on the client machine
to be edited. And the same kinds of problems with regards to getting it back
to the web server exist for PDF and any other document format as well.

And of course, we have not yet discussed how the "articles" will be stored.
That also depends on the answers to the questions I posed above.


Again, you're thinking like a User. Computer programs look simple to users
because programmers go to a great deal of difficulty to make them seem that
way. The more user-friendly an interface is, the more programmer-UNfriendly
the program actually is. An example of a "simple" ASP.Net application might
be to create a page that dynamically writes "hello world" to the browser. It
takes no user input from the user. it contains no logic. It simply outputs a
string. THAT is simple. Almost everything else is complex in one way or
another, and to a greater or lesser degree.

I hope this gives you an idea of where you need to start. Perhaps a "hello
world" ASP.Net web page would be a good place to start. You can work your
way up from there, one piece at a time. If you take small steps, you're much
less likely to fall.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.
 

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,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top