473,396 Members | 2,113 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,396 software developers and data experts.

script function call from ASP.net

27
Hi,

i have a code in my ascx file like this that links the onclick event of link button to a javascript function ColSelected()

LinkButton.Attributes.Add("OnClick", "ColSelected(" + LinkButton.Text + "," + myValue + ");")

i get an exception on this line like as below

System.InvalidCastException {"Conversion from string "ColSelected(4.598," to type 'Double'

is not valid."} System.InvalidCastException


Am i missing any quates?

mp
Oct 19 '07 #1
2 878
Plater
7,872 Expert 4TB
myValue is a Double isn't it?
It's trying to perform math on a string and a double.

Use myValue.ToString()

(and if you're using VB.NET, string concatination is done with a & and not the + )
Oct 19 '07 #2
mpl
27
thanks it works fine

myValue is a Double isn't it?
It's trying to perform math on a string and a double.

Use myValue.ToString()

(and if you're using VB.NET, string concatination is done with a & and not the + )
Oct 21 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Richard Trahan | last post by:
I want a js function to call a Perl script residing on a server. The Perl script will return a string, to be used by the js. Pseudo code: <script> stringvar = perlfunc_on_server(stringarg)...
5
by: P4tryk | last post by:
I load some page using XMLHttpRequest. It has some java script on it. I add this page (using innerHtml) to another but then the java script doesn't run. The main page has <script> function...
6
by: Bart Schelkens | last post by:
Hi, how can I execute a piece of Java-script after a piece of vb-net-code has been executed? Thx
12
by: tshad | last post by:
I am not sure why I am getting this error: I have the following code I want to run from another include file that holds all my functions. functions.inc...
18
by: Ed Jay | last post by:
<disclaimer>js newbie</disclaimer> My page has a form comprised of several radio buttons. I want to poll the buttons to determine which button was selected and convert its value to a string. I...
6
by: simon | last post by:
hello, what code would i use to kick off a javascript script after i had registered it? If (Not Page.IsClientScriptBlockRegistered("jsScript")) Then Page.RegisterClientScriptBlock("jsScript",...
3
by: Tobius | last post by:
I want to be able to define a custom onerror event that detects an attempt to call a known function and load a file if it's not already loaded and re-call the function. The only problem is that any...
5
by: sfeher | last post by:
Hi, Is there a way to know when a function is available for me to call it from a dynamically loaded a javascript? I use this code to load the include.js file and then I call testIncludeFn()...
19
by: thisis | last post by:
Hi All, i have this.asp page: <script type="text/vbscript"> Function myFunc(val1ok, val2ok) ' do something ok myFunc = " return something ok" End Function </script>
3
by: Angus | last post by:
I have a web page with a toolbar containing a Save button. The Save button can change contextually to be a Search button in some cases. Hence the button name searchsavechanges. The snippet of...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.