Solved

How to Dynamically Build Another Web Page From Another ASP.NET/C# ASPX page

Posted on 2011-09-23
3
202 Views
Last Modified: 2012-05-12
I have successfully built a website that allows users to query a database and a series of ten values are returned from selection criteria that a user has entered. I am now attempting to write the line of values that are in a dataset within C# that has successfully queried the database table. (The results can contain thousands of results, and all of the results need to be displayed in a table format on another web page.)

I am new to C# and ASP.NET, and I was wondering if someone could point me in the right direction of how to take the data that I have on one page and dynamically build another aspx page, which will have its own controls on it, in a table format. Thank you to anyone in advance that can help me find direction with my current web page project.

(For simplicity, say that I used table1 and pulled back values a, b, c, d, e, f, g, h, i, j, k. How can I get the values in table1 being returned in the dataset to display in a table on a webpage called results.aspx from an original aspx page called default.aspx.)
0
Comment
Question by:thenthorn1010
3 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 167 total points
ID: 36590433
Try saving you dataset result into the session object.
Session["MyCommonDataset"] = your_dataset_ instance_ here.
Then use the same session on both pages to build the contents.

Check:
http://www.codeproject.com/KB/aspnet/ExploringSession.aspx
0
 
LVL 15

Assisted Solution

by:Eyal
Eyal earned 166 total points
ID: 36594332
mas_oz2003 solution + server.transfer can perform with better performance
0
 
LVL 5

Assisted Solution

by:eridanix
eridanix earned 167 total points
ID: 36707854
Hi,

why don't you get results of the query on the second page?

For example:
1)On page1.aspx users fill their selection criteria and click on submit button. The form on page1.aspx will have action set to page2.aspx and method post.
2)On page2.aspx get select criteria by Request.Form, do database query database to select data and view data as you need.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now