Changing properties of a custom control in code-behind

G

Guest

Hi,

I've written a web server custom control. If it's attributes are set at
design time in the HTML it works fine. But I want to also be able to
dynamically change some of the properties in the code behind file. Is there
any way to do this? When I write the code for the button_click event to set
the properties, the control doesn't render with the changed properties the
way it should.

Any ideas?

Philip
 
A

Alvin Bruney

Use this:
Control1.Attributes.Add("left","10");
put this in the page load. Any html attribute would follow that same format.
When the control renders clientside, these settings override the default.
regards
 

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

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top