From: Alfonso M.
Sent on: Monday, March 23, 2009, 12:31 PM
Thanks I did try this. This actually works but not how I structured my code. here is an example.

main.aspx
---------------------------
...
sub page_load
   label1.text = "hello"
end sub
....
<html>
<head></head>
<body>
<%reponse.writefile( Session("page") ) %>
</body>
</html>

template1.ascx
----------------------
...
<form runat="server">
<span id="info">
<asp:Label id="label1" runat="server" />
</span>
</form>


I get this error when I pull up main.aspx:
Compiler Error Message: BC30451: Name 'lable1' is not declared.

however, if have take away the label1.text = "hello" at the main.aspx page_load. It works fine. The problem with this is that all the templates have a label (label1) that need to be filled. Perhaps if I add page_load to all the template files, but I don't know if that'll work.


> Date: Mon, 23 Mar[masked]:59:54 -0700
> From: [address removed]
> To: [address removed]; [address removed]
> Subject: Re: [The-San-Francisco-NET-User-Group] Programming Question
>
> Did you try this.
>
> http://support.microsoft.com/kb/306575
>
> Thanks
> Vijai
>
> Alfonso Martinez wrote:
> > Hello All,
> >
> > First of all, I am a newbie with VB .NET. I am working on a small
> > VB.NET project and have been stuck on something for a while... Perhaps
> > one of you experts can advise me. Here is my problem:
> >
> > I have a page that dynamically includes 1 page out of a group of pages
> > (template1.inc, template2.inc, template3.inc, etc..). Here is where I
> > run into problems. I've tried
> >
> > this works <!-- #include file="templates/template.inc" --> but this
> > doesn't <!-- #include file="templates/<%Session("page") %>.inc" -->
> >
> > I also tried this, but I run into problems because all the templates
> > the same web control id's. ASP.NET actually compiles all the pages.
> >
> > <%
> > Dim whichpage
> > whichpage = Session("page")
> > Select Case whichpage
> > Case "template"
> > %>
> > <!-- #include file="templates/template.inc" -->
> > <% Case "template2" %>
> > <!-- #include file="templates/template2.inc" -->
> > <% Case "template3" %>
> > <!-- #include file="templates/template3.inc" -->
> > <% Case Else %>
> > <!-- #include file="templates/template4.inc" -->
> > <%End Select%>
> >
> > Key Points:
> > *I am referencing template web controls from the main page (the page
> > including the template).
> > *All the templates have similar web control id's
> >
> > I am very frustrated with this. Please help!!!
> >
> > Thank you much!
> >
> >
> >
> > ------------------------------------------------------------------------
> > Internet Explorer 8 ? Now Available. Faster, safer, easier. Download
> > FREE now! <http://clk.atdmt.com/MRT/go/141323790/direct/01/>
> >
> >
> >
> > --
> > Please Note: If you hit "*REPLY*", your message will be sent to
> > *everyone* on this mailing list
> > ([address removed]
> > <mailto:[address removed]>)
> > This message was sent by Alfonso Martinez
> > ([address removed]) from The San Francisco .NET User Group
> > <http://www.meetup.com/The-San-Francisco-NET-User-Group/>.
> > To learn more about Alfonso Martinez, visit his/her member profile
> > <http://www.meetup.com/The-San-Francisco-NET-User-Group/members/8990173/>
> > To unsubscribe or to update your mailing list settings, click here
> > <http://www.meetup.com/account/comm/>
> >
> > Meetup Support: [address removed]
> > 632 Broadway, New York, NY 10012 USA
>
>
> --
> Thanks
> Vijai
>


Hotmail? is up to 70% faster. Now good news travels really fast. Find out more.