473,320 Members | 2,145 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

UserControl Code Libraries???

I want to create basic usercontrol code libraries. Is the
following possible? If so, how?

As a front-end developer being exposed to the concept of
usercontrols, I thought (asked the question), with .net
it must be possible to have template files that contain
similar front-end static or dynamic code from which code
be called, much in the same way a javascript functions
can be called from a js library.

FOR INSTANCE
I work on a site with multiple sections. Each section has
an asp header file with a tab on state fro navigation.
With .net, I want to replace my multiple header asp files
with a 'Headers' usercontrol library file from which i
can call any header.

E.G.
----------------HEADER_USERCONTROL.ASPX FILE--------------
-------------
<%@ COMMON CODEBEHIND FOR HEADERS %>

<% HEADER_X START TAGNAME="HEADX" %>
header_x html code, (could be static or dynamic)
<% HEADER_X END %>
<% HEADER_Y START TAGNAME="HEADY" %>
header_y html code, (could be static or dynamic)
<% HEADER_Y END %>
<% HEADER_Z START TAGNAME="HEADZ" %>
header_z html code, (could be static or dynamic)
<% HEADER_Z END %>
----------------HEADER_USERCONTROL.ASPX FILE--------------
-------------
----------------PARENT PAGE.ASPX FILE---------------------
------
<%@ SITE DEFAULT CODEBEHIND %>
<%@ Register TagPrefix="UserControl_LIB"
Src="HEADER_USERCONTROL.ASPX" %>
<html>
<body>
<UserControl_LIB:HEADZ runat="server" />
</body>
</html>

----------------PARENT PAGE.ASPX FILE---------------------
------

If you understood that lot, great. That's pretty much
what I hope is possible within .net.

Can anyone help??

Cheers, kevin
Jul 21 '05 #1
0 977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Friedman | last post by:
I can't seem to figure out how to get a reference to a UserControl in the code-behind for the page that contains the control. All the examples I've seen show how to pass property values from the...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
0
by: kevin | last post by:
I want to create basic usercontrol code libraries. Is the following possible? If so, how? As a front-end developer being exposed to the concept of usercontrols, I thought (asked the question),...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
2
by: lotus | last post by:
HI All.. I'm realtively new to C#. I have MainForm which includes Parent usercontol, and this parent usercontrol also contains child usercontrol. MainForm --> Parent usercontrol --> child...
0
by: oliver | last post by:
QUESTION: How to access an object embedded in a UserControl through Javascript file? Another way to ask this question: How to execute script from a UserControl, accessing other objects in that...
6
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.