473,383 Members | 1,866 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

detect components in a web form

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
2 1435
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Yasutaka Ito | last post by:
Hi, As you know, all the non-ui components (like Timer control, etc.) that sit on the form are contained in its private variable 'components'. How can I enumerate such components from any form...
19
by: Frank Rizzo | last post by:
I want to log the user out when there has been a period of inactivity in the application. The key here is inactivity of the application, not the system. I know that you can retrieve the...
1
by: MuZZy | last post by:
HI, I have a user control, say with one textBox. I need the following: when the user closes form (either calling Form.Close, or pressing "X" or anyhow), UserControl copies a file from a...
2
by: Al Murphy | last post by:
Hi, I've written a very basic windows application with a pushbutton and a listbox. When the user clicks on the button it should display a message in the listbox. Sounds simple right? Well mine...
1
by: Ludovic Lemarinel | last post by:
Hi, I've got a Tab Control, with a lot of tabs, and a lot of controls in each tab (textboxes, comboboxes, listviews, checkboces, etc...). As these controls are updating a Database, I need to...
9
by: Don | last post by:
Is there any way to detect when an item has been added to the Items collection of a combobox or listbox? I am inheriting a Combobox and want to validate items before they are added to the...
9
by: RichG | last post by:
In VB 5 I could have a form named frmTest and open it with frmTest.Show Now in VB.net I have to Dim frm as New frmTest frm.show The problem is I only want one instance of frmTest open, not a...
8
by: BJ | last post by:
Problem: How can I code up a client side process to detect if the network is available? Synopsis: I am writing ASP.NET input forms for a Panasonic Tuff book. The users will be walking around...
24
by: dE|_ | last post by:
I have started looking into scripts for screen size detect with the intention of using them to pick from a number of CSS style sheets tailored to the size. Is there a good reason why this is not...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.