hoelzro
01-08-2007, 10:22 PM
I'm new to ASP.NET, and I'm making a website, the contents of which depend on data provided via GET. It's something like this:
<html>
<head>
string page; // retrieved via GET
</head>
<body>
<% if(page.Equals("1")) {
%> <asp:Label id="label" runat="server" Text="Label one" />
<% } else if(page.Equals("2")) {
%> <asp:Label id="label" runat="server" Text="Label two" />
<% } %>
</body>
</html>
Yes, I know the above example is trivial, and there's a "simple" way to solve it by writing different Text attributes based on page, but what I'm wondering is the following:
Is there a way to reuse a control name in a page if the two seperate instances won't appear together?
Thanks!
<html>
<head>
string page; // retrieved via GET
</head>
<body>
<% if(page.Equals("1")) {
%> <asp:Label id="label" runat="server" Text="Label one" />
<% } else if(page.Equals("2")) {
%> <asp:Label id="label" runat="server" Text="Label two" />
<% } %>
</body>
</html>
Yes, I know the above example is trivial, and there's a "simple" way to solve it by writing different Text attributes based on page, but what I'm wondering is the following:
Is there a way to reuse a control name in a page if the two seperate instances won't appear together?
Thanks!