By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,963 Members | 1,749 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,963 IT Pros & Developers. It's quick & easy.

detect components in a web form

P: n/a
hi im kind of new to C#.
i am doing a Ritch text editor dll, for a webform that im going to
need.
the components runs fine it does all it need to do, and exposes all
the properties i need it to expose. the proble that i have is when i
drop two of my componentes into the webform there area few conflicts.
I am generating all the javaScript functions that do the BOLD,ITALIC
for the buttons. since i am doing that if two controls are droped the
java script is generated twice. there fore creting an error in java
script.
i found quick solution for that by just naming the function like this

functionName_"the id of the control"

this generated diferent function for diferent controls. which is fine
and works. but also as it is generating twice the javaScript. with
just two components i get 300 line of code. i think this is a big
problem. i want to create a unique function for all of the controls
that get droped into the webform. jus by calling a function and
sending the name of the caller
kind o like this

changeFont(var fontSize, "name of the control that call the
function");

so i gues the question is: is there a way to detect how many of my
controls ahve been droped into the webform?

with this info i would only generate one set of function for all of
the controls.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can call the RegisterClientScriptBlock method, which emits script blockd
with the same name only once.

"julk" <cr*********@hotmail-dot-com.no-spam.invalid> wrote in message
news:40**********@Usenet.com...
hi im kind of new to C#.
i am doing a Ritch text editor dll, for a webform that im going to
need.
the components runs fine it does all it need to do, and exposes all
the properties i need it to expose. the proble that i have is when i
drop two of my componentes into the webform there area few conflicts.
I am generating all the javaScript functions that do the BOLD,ITALIC
for the buttons. since i am doing that if two controls are droped the
java script is generated twice. there fore creting an error in java
script.
i found quick solution for that by just naming the function like this

functionName_"the id of the control"

this generated diferent function for diferent controls. which is fine
and works. but also as it is generating twice the javaScript. with
just two components i get 300 line of code. i think this is a big
problem. i want to create a unique function for all of the controls
that get droped into the webform. jus by calling a function and
sending the name of the caller
kind o like this

changeFont(var fontSize, "name of the control that call the
function");

so i gues the question is: is there a way to detect how many of my
controls ahve been droped into the webform?

with this info i would only generate one set of function for all of
the controls.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #2

P: n/a
that is just what i was looking for thanks alot.
now my control can be more efficient
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.