Class from Panel

D

DanWeaver

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
 
M

Masudur

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
 
D

DanWeaver

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top