D
Dessip
Hey,
this is probbly a really simple answer, but im useing ASP.NET V1.1 and
im trying to create a dynamic header, but a static footer. But i dont
want to use place holders. thou its probbly the best way.
What i am doing is useing Response.write, so heres a example
Function.vb
---------------------------------------------------------------------------
---------------
Public Function Header(strTitle as string, bolUserLoggedIn as Boolean)
as string
Header = ("<html><head><title>" & strTitle & "</title></head><body>")
If bolUserLoggedIn = True Then
Header += ("Welcome: " & strUser & "<br> <a
href='/logout.aspx'>LogOut</a>")
Else
Header += ("Welcome, Please <ahref='/login.aspx'>log in</a>")
end if
End Function
Public Function Footer() as String
Footer = ("Created By: <br> </body> </html>")
End Function
index.aspx.vb
---------------------------------------------------------------------------
-------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Write(Header("Test Page",UserLoggedIn))
Response.Write(Footer)
End Sub
index.aspx (Just got a button on at the moment that dont do anything)
---------------------------------------------------------------------------
----------------
<form runat="server" ID="Form1">
<asp:button id="Test" runat="server" Text="Test"></asp:button>
</form>
That is what i am doing, but as the page is loading, it is putting the
header and footer, then the body. So is there anyway that i can have it
going Header Body Footer. Thou liek i said i dont really want to use
palce holders. but also i dont want to ahve to write the whole of hte
body out for each page, in response.write
So whats the best method of creating headers and footers. i have read
so many different ways, and quite a few ways of useing Placeholders,
but it has jsut confused me.
Also another reason i have used response,write for the header is
because of the title, so you might be in the same page, but the title
will change for the users.
Also i would like to be able to use response.write for other things in
the web page, but without them being placed at the top of the page, but
below the header.
I cant use ASp.NET V1.1 else i would just use a masterpage, its got to
be Version 1.1 sorry.
Regards, and Thank You In Advance
Chris
this is probbly a really simple answer, but im useing ASP.NET V1.1 and
im trying to create a dynamic header, but a static footer. But i dont
want to use place holders. thou its probbly the best way.
What i am doing is useing Response.write, so heres a example
Function.vb
---------------------------------------------------------------------------
---------------
Public Function Header(strTitle as string, bolUserLoggedIn as Boolean)
as string
Header = ("<html><head><title>" & strTitle & "</title></head><body>")
If bolUserLoggedIn = True Then
Header += ("Welcome: " & strUser & "<br> <a
href='/logout.aspx'>LogOut</a>")
Else
Header += ("Welcome, Please <ahref='/login.aspx'>log in</a>")
end if
End Function
Public Function Footer() as String
Footer = ("Created By: <br> </body> </html>")
End Function
index.aspx.vb
---------------------------------------------------------------------------
-------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Write(Header("Test Page",UserLoggedIn))
Response.Write(Footer)
End Sub
index.aspx (Just got a button on at the moment that dont do anything)
---------------------------------------------------------------------------
----------------
<form runat="server" ID="Form1">
<asp:button id="Test" runat="server" Text="Test"></asp:button>
</form>
That is what i am doing, but as the page is loading, it is putting the
header and footer, then the body. So is there anyway that i can have it
going Header Body Footer. Thou liek i said i dont really want to use
palce holders. but also i dont want to ahve to write the whole of hte
body out for each page, in response.write
So whats the best method of creating headers and footers. i have read
so many different ways, and quite a few ways of useing Placeholders,
but it has jsut confused me.
Also another reason i have used response,write for the header is
because of the title, so you might be in the same page, but the title
will change for the users.
Also i would like to be able to use response.write for other things in
the web page, but without them being placed at the top of the page, but
below the header.
I cant use ASp.NET V1.1 else i would just use a masterpage, its got to
be Version 1.1 sorry.
Regards, and Thank You In Advance
Chris