Login checking inline... im confused

  • Thread starter Thread starter Tarun Mistry
  • Start date Start date
T

Tarun Mistry

Hi everyone. I want to perform some login checking in one of my webforms to
decide on what content to show, is this possible? Should i be doing this
differently (btw im a new .net programmer moving from PHP).

So depending on the value of x and y (defined in my code behind) i want todo
something like this in the code.

<% if(x > y) {%>

<p>HELLO WORLD</p>

<%} else {%>

<p>BYE WORLD</p>

<% } %>

Please help! :D

Appreciate any words of wisdom.

Kind Regards
Taz
 
Im terrible sorry, the work "login" shuold read "logic"!!

Thanks,
Tarun
 
But i have huge chunks of HTML, this wouldnt be feasable would it?

Surely there must be a better way.

Thanks,
Taz
 
Then have a look to user controls. It allows to design an HTML fragment and
even companion code and to reuse this on several pages.
Here you could have two user controls and load one of them dynamically on
the page as needed...

Another option would be also to have this code in the page and just set the
visible property of its container (so that the HTML markup is just not
rendered).

Basically the idea is that ASP.NET expose the current page throught an
object model so it's likely best to start thinking of your page as objects
you interact with rather than rendering directly the HTML markup as we are
more likely used with previous tools...

See :
http://samples.gotdotnet.com/quickstart/aspplus/doc/webpagelets.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top