Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2011-09-23
3
Medium Priority
?
242 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 36

Accepted Solution

by:
Miguel Oz earned 668 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 664 total points
ID: 36594332
mas_oz2003 solution + server.transfer can perform with better performance
0
 
LVL 5

Assisted Solution

by:eridanix
eridanix earned 668 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Integration Management Part 2
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

876 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