473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Having One Page Produce Multiple Views

I'm trying to figure out how to make one aspx file produce multiple views
depending on the value of a query string, etc. I've done this in classic
ASP before where you might key off a URL like
www.mysite.com/myfile.aspx?step=3. So, in myfile.aspx I would be checking
the value of 'step' and would write out the appropriate web controls. Maybe
step=3 means we're on the third page of a wizard-type web page and I need to
display certain controls, text etc.

In ASP.NET it's not readily apparent to me how to do this. Since the visual
content and the code-behind are separated I'm not sure how to make the
content (in the aspx file) different (since it appears to be static)
depending on something like a query string variable. Maybe I'm wrong, but I
haven't seen any examples of aspx files that have code like "If step=2
display these controls, but if step=3 display these controls". Could anyone
show me a quick example how to do this, or point me somewhere that does?

I'd need to see how this is done, but if this is not the 'best practice'
approach for this requirement in ASP.NET I'd like to hear any additional
suggestions as well.

Thanks,

Tim Rogers
Nov 17 '05 #1
3 1275
Server.Execute could be an option (the called page can access to the
original QueryString parameters and then it could modify its behaviour) for
simple web apps.

"Tim Rogers ro****@excite.com>" <tim<removethis> wrote in message
news:68***************************@msgid.meganewss ervers.com...
I'm trying to figure out how to make one aspx file produce multiple views
depending on the value of a query string, etc. I've done this in classic
ASP before where you might key off a URL like
www.mysite.com/myfile.aspx?step=3. So, in myfile.aspx I would be checking
the value of 'step' and would write out the appropriate web controls. Maybe step=3 means we're on the third page of a wizard-type web page and I need to display certain controls, text etc.

In ASP.NET it's not readily apparent to me how to do this. Since the visual content and the code-behind are separated I'm not sure how to make the
content (in the aspx file) different (since it appears to be static)
depending on something like a query string variable. Maybe I'm wrong, but I haven't seen any examples of aspx files that have code like "If step=2
display these controls, but if step=3 display these controls". Could anyone show me a quick example how to do this, or point me somewhere that does?

I'd need to see how this is done, but if this is not the 'best practice'
approach for this requirement in ASP.NET I'd like to hear any additional
suggestions as well.

Thanks,

Tim Rogers

Nov 17 '05 #2
Jj
you can implement each "view" as a "UserControl" and add these controls
dynamically based on the "step" parameter on to your aspx page.

Jianjun
"Tim Rogers ro****@excite.com>" <tim<removethis> wrote in message
news:68***************************@msgid.meganewss ervers.com...
I'm trying to figure out how to make one aspx file produce multiple views
depending on the value of a query string, etc. I've done this in classic
ASP before where you might key off a URL like
www.mysite.com/myfile.aspx?step=3. So, in myfile.aspx I would be checking
the value of 'step' and would write out the appropriate web controls. Maybe step=3 means we're on the third page of a wizard-type web page and I need to display certain controls, text etc.

In ASP.NET it's not readily apparent to me how to do this. Since the visual content and the code-behind are separated I'm not sure how to make the
content (in the aspx file) different (since it appears to be static)
depending on something like a query string variable. Maybe I'm wrong, but I haven't seen any examples of aspx files that have code like "If step=2
display these controls, but if step=3 display these controls". Could anyone show me a quick example how to do this, or point me somewhere that does?

I'd need to see how this is done, but if this is not the 'best practice'
approach for this requirement in ASP.NET I'd like to hear any additional
suggestions as well.

Thanks,

Tim Rogers

Nov 17 '05 #3
I can recommend to download DotNetNuke (from dotnetnuke.com)
The whole site is done with only one default.aspx.

But pretty much you got the answer.

George.

"Jj" <ji*******@yahoo.com> wrote in message
news:q9********************@comcast.com...
you can implement each "view" as a "UserControl" and add these controls
dynamically based on the "step" parameter on to your aspx page.

Jianjun
"Tim Rogers ro****@excite.com>" <tim<removethis> wrote in message
news:68***************************@msgid.meganewss ervers.com...
I'm trying to figure out how to make one aspx file produce multiple views depending on the value of a query string, etc. I've done this in classic ASP before where you might key off a URL like
www.mysite.com/myfile.aspx?step=3. So, in myfile.aspx I would be checking the value of 'step' and would write out the appropriate web controls. Maybe
step=3 means we're on the third page of a wizard-type web page and I

need to
display certain controls, text etc.

In ASP.NET it's not readily apparent to me how to do this. Since the visual
content and the code-behind are separated I'm not sure how to make the
content (in the aspx file) different (since it appears to be static)
depending on something like a query string variable. Maybe I'm wrong,

but I
haven't seen any examples of aspx files that have code like "If step=2
display these controls, but if step=3 display these controls". Could

anyone
show me a quick example how to do this, or point me somewhere that does?

I'd need to see how this is done, but if this is not the 'best practice'
approach for this requirement in ASP.NET I'd like to hear any additional
suggestions as well.

Thanks,

Tim Rogers


Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
by: asj | last post by:
awhile back, eBay decided to switch from a Microsoft/.NET/Windows architecture on the backend to a J2EE one, which might explain why their java backend will handle up to 1 BILLION page views a day!...
1
by: kongsballa | last post by:
Hi! I have a webapp. that holds a lot of documents. Some of the documents needs to be produced from a database on-the-fly, some are static documents like PDF, Word documents, etc... In the end,...
3
by: KemperR | last post by:
Hello Experts outhere, may be someone can tell me whats going wrong with my ADOX trial. I have an Access 2002 database with some tables and queries (views) The code listed below works well up...
0
by: jon | last post by:
Using Visual C++ and MFC, one could generate a very nice MMI using CFormView and the method detailed in the MSDN "vswap" example to allow multiple forms to be viewed ( switched to ) within a single...
8
by: hb | last post by:
Hi, I need to declare a variable who's value can be preserve through the same ASP.Net page. I tried the following code, only the static variable s2 keeps its value=22 after lnk1_Click followed...
0
by: dbuchanan | last post by:
How do I make multiple DataGridTableStyles serve the same table? (I can get multiple styles for the same datagrid, but not multple styles for the same *table* on the same datagrid) I want to do...
5
by: Ron L | last post by:
I have a DataTable that is being maintained in a Model class. I also have a View class which creates a DataView from the DataTable that the Model passes it. The view class then has methods to...
2
by: beargrease | last post by:
I'm kind of comfortable with basic joins, but a current project requires a complex query of many tables. The GROUP_CONCAT(DISTINCT ...) function has been very useful as returning my values as comma...
2
by: doverj | last post by:
Is there a way to delete from multiple tables/views a column with a specific name? For example, a database has 50 tables and 25 views all have a column named ColumnA. Is it possible to write a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.