absolutePositioning attribute of Custom webcontrol

  • Thread starter Alessandro Zifiglio
  • Start date
A

Alessandro Zifiglio

Hi, does anybody know if its possible to code for the absolute positioning.
I have noticed that vs.net applies these attributes to any webcontrol. This
is how you are able to move your control around in the designer.
I'd like to include the left and top as properties of my custom control and
have them updated everytime the control is being moved in the designer.

This has to be possible somehow. Anybody ? ;)
 
V

Victor Garcia Aprea [MVP]

Hi Alessandro,

Simply inheriting from WebControl should work. If you're inheriting from
Control you may be in trouble then.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
 
A

Alessandro Zifiglio

hi victor, I'm inheriting from a webcontrol. Is why i got the default top
and left css attributes added for my control and i'm able to drag it on the
vs.net designer. WHat i want is have top and left properties exposed by my
custom control and have it somehow associated with what vs.net does for me
at design time that way when i drag the control and as i move it the top
left are updated in the property gird as well as in html view.

So far i see vs.net does this for me automatically but in html view
Thanks for the resonse ;)
 
A

Alessandro Zifiglio

Just in case someone else has this same need and is stuck like me, here is
what you need to do in order to retrieve left and top positions set by
vs.net on webcontrols when dragging them within the vs.net designer.

The designer automatically assigns CSS position information to our control.

To use this position information, we need to read it from the Style
collection which is a System.Web.UI.CssStyleCollection.


protected override void OnPreRender(EventArgs e)

{
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top