Creating pages and such

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2005
Posts: 10
Reputation: KG800 is an unknown quantity at this point 
Solved Threads: 0
KG800 KG800 is offline Offline
Newbie Poster

Creating pages and such

 
0
  #1
Apr 27th, 2005
Hello,

I'm currently trying to work on a project and I am stuck. I need to take products from a database and show them on multiple pages according to manufacturer and category. I also will then need to have the pages written out in html, because of were I need to upload them doesn't support asp.net. (Don't ask just go along with it.) I've been able to create a loop that makes my table and separates my categories, but they all show up on one page. Any direction in help would be greatly appreciated.


Thanks,
KG
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Creating pages and such

 
0
  #2
Apr 28th, 2005
I would suggest using a control that supports custom paging, but that wouldn't help in your environment.

I would have a loop, reading your products out of a database. Write pure HTML out to a file. Use a counter, when your loop iterates through a given number of products, close the current HTML file, and open a new one. Your one loop will generate any number of HTML files.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 10
Reputation: KG800 is an unknown quantity at this point 
Solved Threads: 0
KG800 KG800 is offline Offline
Newbie Poster

Re: Creating pages and such

 
0
  #3
Apr 28th, 2005
Sorry, forgot to mention that I am new to asp.net and asp in general. So how would I write html out to a file?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Creating pages and such

 
0
  #4
Apr 28th, 2005
If I understand your situation, you want to write an ASP.NET application that will produce a set of static HTML pages, which you can then upload to a separate site.

To produce HTML files (or any other files), you would use the StreamWriter class or one of its overloads (TextWriter).
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 10
Reputation: KG800 is an unknown quantity at this point 
Solved Threads: 0
KG800 KG800 is offline Offline
Newbie Poster

Re: Creating pages and such

 
0
  #5
Apr 28th, 2005
I tried to incorporating the StreamWriter but I am having a hard time with visual studio.net 2003 accepting it. I tried to find some tutorials and tried there code and it is not accepting it. Do you know how I can get the StreamWriter accepted?
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Creating pages and such

 
0
  #6
Apr 28th, 2005
It's part of the System.IO namespace.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 10
Reputation: KG800 is an unknown quantity at this point 
Solved Threads: 0
KG800 KG800 is offline Offline
Newbie Poster

Re: Creating pages and such

 
0
  #7
Apr 28th, 2005
Yeah I found/figured that, but finally found tutorial that was helpful. Thanks.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 10
Reputation: KG800 is an unknown quantity at this point 
Solved Threads: 0
KG800 KG800 is offline Offline
Newbie Poster

Re: Creating pages and such

 
0
  #8
May 5th, 2005
Hello,

I'm trying to use the StreamWriter, but I'm running into a problem. I'm using a Select statement to separate my categories and under each case I'm trying send it to a new page. But streamwriter wants the file closed when it goes back in to write. I've thought about using an append method. But if I were to run the program to update the pages after period of time I'm afraid that will just append to what I already have and then I'll have a big mess. I've thought about doing some kind of if statement, but not exactly sure how to execute it. Any direction would be great.


KG
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 10
Reputation: KG800 is an unknown quantity at this point 
Solved Threads: 0
KG800 KG800 is offline Offline
Newbie Poster

Re: Creating pages and such

 
0
  #9
May 5th, 2005
I'm guessing I need an if statement of something like this:
If Firsttime in file then
Overwrite
Else
Append

But not sure how to ask if first time in file
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP.NET Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC