|
-
Dec 30th, 2002, 01:42 AM
#1
Thread Starter
New Member
User Control
I'm about to create a portal. I would like to know are there any possible ways of including a sidebar in my page?
The sidebar will have to run functions and retrieve data from database, i've used "include virtual" to include another form as a sidebar, but it can't support multiple forms in one page.
Is using a customised user control an easier way? I'll have to create a sidebar and include it as an user control in everypage, will it be possible to pass session around if i click a link from the side bar?
Thanks!
-
Dec 30th, 2002, 03:49 AM
#2
New Member
You can put a placeholder where ever you want to load the control. for example:
in your aspx page you could have something like:
html code....
<asp:PlaceHolder id="phContent" runat="server" />
html code....
Then create a control (.ascx) with the content and code you need.
in the code behind of your ascx you can place any code that you need to be processed, including session information.
In your code behind for you .aspx page you can simply call have in VB:
Protected WithEvents phContent As PlaceHolder
Private Sub Page_Load....
phContent.Controls.Clear()
phContent.Controls.Add(LoadControl("path/yourcontrol.ascx"))
End Sub
- Justin_
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|