Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Having One Page Produce Multiple Views

Reply
Thread Tools

Having One Page Produce Multiple Views

 
 
Tim Rogers
Guest
Posts: n/a
 
      11-07-2003
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


 
Reply With Quote
 
 
 
 
Andrea D'Onofrio
Guest
Posts: n/a
 
      11-07-2003
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 http://www.velocityreviews.com/forums/(E-Mail Removed)>" <tim<removethis> wrote in message
news:68ee7$3fabb10a$44a50e67$(E-Mail Removed) 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
>
>



 
Reply With Quote
 
 
 
 
Jj
Guest
Posts: n/a
 
      11-09-2003
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 (E-Mail Removed)>" <tim<removethis> wrote in message
news:68ee7$3fabb10a$44a50e67$(E-Mail Removed) 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
>
>



 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      11-10-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 (E-Mail Removed)>" <tim<removethis> wrote in message
> news:68ee7$3fabb10a$44a50e67$(E-Mail Removed) 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
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataSourceControl with multiple views and data binding order Bill Sexton ASP .Net 1 01-26-2007 01:31 PM
can java produce .exe? if it can produce jar,how do you do? aungkopyay@gmail.com Java 5 10-27-2006 02:07 AM
Design pattern for multiple views Ruben Java 3 03-27-2006 07:16 PM
One billion page views Senti Computer Support 8 03-01-2006 03:11 AM
Multiple Input XML documents to produce one output XML SV XML 1 08-16-2005 10:37 AM



Advertisments