User control with Javascript function

L

Lukas Kurka

Hi,

I have an User Control which uses css and javascript files. How should I add
them to the main page? When I place this User Control twice on the page, how
to add reference to these files only once.

Thanks
Lukas
 
O

Onwuka Emeka

Why don't you add the links to the javascript and css files to the
containing page?
 
B

bruce barker \(sqlwork.com\)

you can use RegisterClientScriptBlock to include the javascript, either the
actual code or link. The style is more difficult. most control just have a
property to set the class name, and don't worry about defining the class.

you could write a style control, that allowed your user control to register
their css links.

-- bruce (sqlwork.com)
 
L

Lukas Kurka

I will probably do it this way. I just wanted to make my code more
understandable, this way adding the user control is not enough, you have to
know that you must add this javascript and css reference as well.

Lukas
 

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
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top