Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Flow control in the HTML?

Status
Not open for further replies.

columbo2

Technical User
Jul 14, 2006
97
GB
This is a beginners question - sorry in advance if it is a bad question...

In classic ASP you could put script into the html to change what HTML is shown.
E.G. If I want to show one table if a querystring equals acertain value and another table if the querystring equals someother value - i could do this...

<% an if statement %>
some html
<% an else statement %>
some other html

Can you do this style of thing in ASP.net?
Or is it considered bad (or not possible).
I'm basically trying to avoid having separate pages for an input form to a DB and a display form from the DB

Thanks in advance


 
one option is to design WebUserControls for each dynamic section. then you can place these WUCs on any page you want. there are a couple of ways to implement them.

1. place both WUCs on a page. on the Init or Load event hide the one that is not needed.
2. dynamically load the required control in the Init event based on a condition. Note: dynamically created controls need to be added at every postback and must be done in the Init phase to ensure the page life cycle events apply to the WUC.

for future reference there is a forum specifically dedicated to forum855

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks, thats put me on the right track like your last post did.
The 4guys from Rolla site is great - I'm getting somewhere now - enought to realise now that my last two posts were in the wrong forums - thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top