473,399 Members | 2,478 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,399 software developers and data experts.

Class from Panel

I have a panel on an asp page that has about 20 controls on it, an
ajax update panel within it- text boxes, listboxes, imgbuttons etc.
I would like to be able to copy this panel- ie put similar but
independent functionality elsewhere on the page - it seems like a
class but information on the web is confusing.

How can I reuse code and controls/ positioning etc many times within
an asp page?

I am using VB in VS2005

Mar 21 '07 #1
3 1239
Place that panel and associated code in a User Control (i.e. ascx)

Mar 22 '07 #2
On Mar 22, 1:19 am, "DanWeaver" <danofwea...@googlemail.comwrote:
I have a panel on an asp page that has about 20 controls on it, an
ajax update panel within it- text boxes, listboxes, imgbuttons etc.
I would like to be able to copy this panel- ie put similar but
independent functionality elsewhere on the page - it seems like a
class but information on the web is confusing.

How can I reuse code and controls/ positioning etc many times within
an asp page?

I am using VB in VS2005
Hi...

Build a user Control and add all the stuff that you need in that user
control....
after you have all the reusable functionality on the user control....
put as many user control as you want in page :)...

Thanks...
Masudur
http://www.kaz.com.bd
http://munnacs.blogspot.com

Mar 22 '07 #3

Thanks guys, that's just what I did and am extremely happy with the
result- just what I wanted- and update panels can happily go in a user
control to be deployed via a panel placed anywhere using VS 2005-
I wonder if you might know how to 'fix' my page- currently Firefox
wont render my VS2005 produced page- img buttons are replaced with
some garbled text, listboxes are the wrong size (in fact between
VStudio an IE there is a discrepancy- it is not WYSIWYG) and some
scriptaculous javascript I have doesn't work.
Is it all to do with absolute positioning? Code below:

Image buttons: (dont dislplay in firefox- garbled text instead)

<asp:imageButton ID="CmdAdd" ImageUrl="C:\Dan\Images\Candidates
\addhot.gif" runat="server"
Style="z-index: 102; left: 138px;position: absolute; top: 8px"
CausesValidation="False"
ToolTip="blah" />

SCriptaculous script registration (in head):

<script src="C:\DanOnC\prototype.js" type="text/javascript"></script>
<script src="C:\DanOnC\scriptaculous.js" type="text/javascript"></
script>

......and initialisation after /body and before /html
<script type="text/javascript">

Sortable.create('DragAgentsDiv',{tag:'FONT', overlap:'horizontal',
constraint:false});
function Getorder5()
{document.getElementById('txtAgentorder').value =
(Sortable.serialize('TestDiv'))
};

</script>
listbox (in firefox displays differnelty to IE)

<asp:ListBox ID="LBHot" runat="server" Height="97px"
Style="z-index: 108; left: 105px; position: absolute; top: 36px"
Width="96px"></asp:ListBox>

Dan

On Mar 22, 3:07 am, "Masudur" <munn...@gmail.comwrote:
On Mar 22, 1:19 am, "DanWeaver" <danofwea...@googlemail.comwrote:
I have a panel on an asp page that has about 20 controls on it, an
ajax update panel within it- text boxes, listboxes, imgbuttons etc.
I would like to be able to copy this panel- ie put similar but
independent functionality elsewhere on the page - it seems like a
class but information on the web is confusing.
How can I reuse code and controls/ positioning etc many times within
an asp page?
I am using VB in VS2005

Hi...

Build a user Control and add all the stuff that you need in that user
control....
after you have all the reusable functionality on the user control....
put as many user control as you want in page :)...

Thanks...
Masudurhttp://www.kaz.com.bdhttp://munnacs.blogspot.com

Mar 23 '07 #4

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

Similar topics

2
by: Andrea Gavana | last post by:
Hello NG, this may seem a stupid (or even impossible) question, but my knowlegde of Python is quite limited. I have basically a simple graphical user interface that contains a Panel, another...
3
by: Anonymous | last post by:
Hi, I have the following code. ( Sorry if it is a little rough or improperly written ). <########## CODE BEGIN ##########> public class TestClass : System.Windows.Forms.UserControl { public...
1
by: David | last post by:
I have a custom control that contains a class that Inherits the panel control. I am trying to catch a keydown event in this class and then supress it from the rest of the control as well as the...
8
by: TS | last post by:
I am trying to get set a property of a control on the inherited class from base class. I imagine i have to use reflection, so could someone give me the code to do it? something like this?...
3
by: NWx | last post by:
Hi, I defined a base class, Panel, based on System.Web.UI.UserControl, as below: Public MustInherit Class Panel Inherits System.Web.UI.UserControl ..... In another module, I want to...
10
by: steve bull | last post by:
I have a class SwatchPanel which takes Swatch as a parameter type. How can I call a static function within the Swatch class? For example the code below fails on TSwatch.Exists. How can I get the...
0
by: Steve Richter | last post by:
my composite control does not render correctly the 2nd time it is made visible. When I change the base class from CompositeControl to WebControl, the control works as it should. public class...
1
by: bruce628 | last post by:
I want to use SWT tab compnent and make it be multiline,but I fail.please see the class TabFolderExample. Can aneone help me? import java.awt.BorderLayout; import...
1
by: Kburge03 | last post by:
Hi!! I've been working on this assingment for class where I have to design and implement an application that displays two Die objects, a button, and a label. Every time the button is pushed, the...
2
by: Reggie | last post by:
Hi and TIA! I have a class file located in my root directory with all me web pages. I call/use the class and it works fine. I have no imports statements aspx or codebehind. My question is why? ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.