Static ASPx Webpage to dynamic Webpage

Hello Experts...

Static Webpage layout

I have a website that currently has a hardcoded page layout as follows:

Column1                   Column2                        Column3

Heading1                  Heading2                        Heading3
      Report1                  Report2                        Report3

Heading4                  Heading5                        Heading6
      Report5                  Report6                        Report7
      Report8                  Report9

Can you recommend a way for me to do this dynamically so an end user can define the  different headings and what reports  can go under which heading?  All data is stored in a database.  The report will always be a pdf file.

Thank you,

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexandre SimõesManager / Technology SpecialistCommented:
As I see it you should have 3 tables:
1. Reports  -> your current reports table that should have an ReportId column
2. ReportsGroups  -> ReportsGroupId; UserId; GroupName;
3. ReportsGroupsRelation  -> ReportsGroupId; ReportId;

To manage this just list all reports with a dropdown in front. This dropdown holds the available ReportGroups. Leave a blank option on this dropdown for the cases when the user don't want to see the report anywhere.

This can also be done only with one ReportsGroups table:
ReportsGroups  -> ReportsGroupId; UserId; GroupName; ReportId;

In this case you need to get the Distinct list of groups by user to give the options to the user and be aware of case sensitivity and spelling issues.
Alexandre SimõesManager / Technology SpecialistCommented:
Another customizations point you can give to the users if the group position.
For this just add another column to the ReportsGroups table:

2. ReportsGroups  -> ReportsGroupId; UserId; GroupName; GroupIndex

Use this column in the ORDER BY of the query that gets the user reports.
the_b1ackfoxCIOAuthor Commented:
Hello AlexCode,

Thank you for your response.  I can get the data to change dynamically, but I am trying to get the (currently static) web page to be dynamic as well.  So if the user sets their page to have only 3 headings, thats what they see.  Another user would see the 6 heading they selected and so on.

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

the_b1ackfoxCIOAuthor Commented:
I think I see how to do it,  I can't seem to sit by idle,  lol.  I found this code snippet it deals with VB, but it gives me what I think I needed(And no, I am not trying to do this with text boxes)  My comment are after the line of *******:


Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    ' Create dynamic controls here.
    TextBox1 = New TextBox()
    TextBox1.ID = "TextBox1"
    TextBox1.Style("Position") = "Absolute"
    TextBox1.Style("Top") = "25px"
    TextBox1.Style("Left") = "100px"

    TextBox2 = New TextBox()
    TextBox2.ID = "TextBox2"
    TextBox2.Style("Position") = "Absolute"
    TextBox2.Style("Top") = "60px"
    TextBox2.Style("Left") = "100px"

    ' CODEGEN: The Web Form Designer requires this method call.
    ' Do not modify it by using the code editor.
End Sub

So if I loop through a block of code like above based upon the SQL query, I should be able to have dynamic web pages based upon the users desire/design...  I will try and test this today!

Alexandre SimõesManager / Technology SpecialistCommented:
You can use the template language to generate your html dynamically at page load: <% %>

For instance, if on the page code behind you have a public property that returns a List<String>:
public List<String> Names { get { return new List<string>() { "Name 1", "Name 2", "Name 3" }; } }

Open in new window

You can add the following to generate a list of those name in a <ul>:
<% foreach (var name in Names) { %>
     <li><%= name %></li>
<% } %>

Open in new window

Try it...

You can now apply the same logic but with your reports, generating items based on the user configuration.

Keep me posted! :)

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
the_b1ackfoxCIOAuthor Commented:

You got me close enough to see a solution.  Thank you for helping me pierce the veil!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.