Question: Minor personalization

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

Simple scenario:
I have a ASP.NET website that users log into. Everyone has a personal page
which they're redirect to after login. Everyone is redirected to the SAME
HTML page, with the exception of this: Near the header it says, "Hi <insert
name>. You live in <city>. Welcome!" Their login name is inserted here,
as well as their <city> which comes from a db. This is the only dynamic
portion of the personal page.

What is the best way to do this? Suggestions?

Thanks!
 
One cheap trick is to use <%=Function%> where Function is declared as
Protected in the code-behind and returns a string.
 
If you want to do it in a more ASP.NET kind of way you could add
labels to the page.

Hi <asp:Label id="lblName" runat="server"></asp:Label>. You live in
<asp:Label id="lblCity" runat="server"></asp:Label>

Then write:
lblName.Text=theName;
lblCity.Text=theCity;
in the page load event handler.

/Hugo
 
Back
Top