How to retrieve data from parse?

How to retrieve data like a Blog Post in ASP.net?

  • Hello Friends! I am working on my College Major Project. My project contains a part, where the Admin will post News (using Editor like a Blog). This News is then stored in Database. Now I want to retrieve "top 2" news and post them on Home page. I am retirieving data and displaying it all in a Label Control on Home page. I want to provide the following Format to the News : ========================== Title With Hyperlink ------------------------------ News News News.... .... ... ..... News. ========================= I am using the following Code to retrieve the data, but I am not able the get the above mentioned layout. foreach (DataRow dr in DS.Tables[0].Rows) { for (int j = 0 ; j < 2 ; j++) { lblNews.Text = "<b> <font size=4>" + lblNews.Text + " " + Convert.ToString(dr[j]) + "</font></b>"; } } Is there any other way to access all the Retrieved data?

  • Answer:

    you are retrieving correctly but the formatting should not be done that way. The solution is rather than writing blNews.Text = "<b> <font size=4>" + lblNews.Text + " like this use the formatting style of bold and fontsize =4 in .aspx file So for the label in aspx page write like this <asp:lable font-size="4" font-bold="true" ... REMEMBER if you want hyperlink you have to use <asp:hyperlink /> tag rather than label.

Dhaval Malte at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.