0

How to write text report on aspx page from the table by using c#.The report should like below and i don't want to sue repeater for this because i have multiple value with same name that way i don't want display them again and again on the page.

    parent: something
       categoey: something
           value: something

parent: something
       categoey: something
           value: something

parent: something
       categoey: something
           value: something

Any Help please?

Indra
  • 279
  • 2
  • 3
  • 16

1 Answers1

1

You can simply generate the HTML to show the content and add it to a literal control.

Place a Literal Control in your WebPage.

string Content="";
for(int i=0;i<10;i++)
{
Content +="Dynamic Content<br/>";
}
ltrlControl.Text=Content;

There are number of alternatives in asp.net to generate dynamic HTML. See this

For your Example,

string Content="";
    for(int i=0;i<10;i++)
    {
    Content +="parent: something<br/>";
    Content +="categoey: something<br/>";
    Content +="value: something<br/><br/><br/>";
    }
    ltrlControl.Text=Content;

I hope you are much familiar with HTML.

Community
  • 1
  • 1
Subin Jacob
  • 4,692
  • 10
  • 37
  • 69