dinotom Posted September 20, 2011 Share Posted September 20, 2011 I am new to ASP.Net but pretty good in VB.Net. I am trying to populate an ASP.Content page using a text file. I will be updating the textfile each week with new topics and I want the page load to automatically read the lines in the text file and load them into the content place holder <p> tags Link to comment Share on other sites More sharing options...
justsomeguy Posted September 20, 2011 Share Posted September 20, 2011 What are you having problems with? If you're writing this with VB.net then you should be able to open the file and read it. Are you having an issue writing the content to where you want it? Link to comment Share on other sites More sharing options...
dinotom Posted September 20, 2011 Author Share Posted September 20, 2011 Yes i can read the file but I'm uncertain as to how to apply it to the content. Here is the current hardcoded way I'm getting the topics in. <asp:Content ID="Content1" ContentPlaceHolderID="TopContentLeft" Runat="Server"><h1 class="text1"style="font-size: x-large; text-decoration: underline; font-weight: bold; color: #446908;">Did you know that?</h1><p class="text1" style="font-size: large; line-height: 125%; font-weight: bold; color: #446908;">--- We recently completed an evaluation for a large Ocean Tug fleet showing 70% particulate reduction, 11% NOx reduction and an 8% fuel economy improvement.</p><p class="text1" style="font-size: large; line-height: 125%; font-weight: bold; color: #446908;">--- Our product was added to the Grainger catalog as its primary emissions and fuel efficiency Catalyst.</p> <p class="text1" style="font-size: large; line-height: 125%; font-weight: bold; color: #446908;">--- Our product is recommended by Mann-Hummel to promote better performance in Diesel Particulate Filters.</p></asp:Content> Link to comment Share on other sites More sharing options...
justsomeguy Posted September 20, 2011 Share Posted September 20, 2011 I'm not sure of the specifics with ASP, but in general you'll need to parse the text into an array or some other structure, and loop through it to display each item. You may use a DataSet class, for example, or maybe just a simple loop. Link to comment Share on other sites More sharing options...
dinotom Posted September 22, 2011 Author Share Posted September 22, 2011 for your own edification, you read the lines into an HTML string and attach it to a literal control within the asp:contentplaceholder Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.