473,385 Members | 1,769 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,385 software developers and data experts.

Registered script not getting executed - Please help

1
Hello All,

I have registered a javascript into my web application in C#.NET.
For some reason, this script is not getting executed.
Could you please help.
Here is the code i have written.

ClientScriptManager cs = Page.ClientScript;
string csname = "ButtonClickScript";
Type cstype = this.GetType();
StringBuilder cstext = new StringBuilder();
if (!cs.IsClientScriptBlockRegistered(cstype, csname))
{
cstext.Append("function Shape(){");
cstext.Append(" map = new VEMap('myMap');");
cstext.Append("map.LoadMap();");
cstext.Append("var routeLine = new VEShape(VEShapeType.Polyline,['" + GlobalVariables.displaypoints + "']);");
cstext.Append("map.AddShape(routeline);}");
}
Page.ClientScript.RegisterClientScriptBlock(this.G etType(), "ButtonClickScript", cstext.ToString(), true);
Button1.Attributes.Add("onClick","return Shape();");


Waiting desperately for the reply.

Thanks.
Oct 13 '09 #1
0 1325

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

Similar topics

1
by: Matt | last post by:
Hello I have spent the last weeks trying to solve this problem but with no luck at all, I have a piece of code that looks like this declare @bestnr int, @artnr varchar(25), @journalnrrow...
4
by: Russ | last post by:
I have a form page with a submit button. When the submit is successfull (good return from web service), I insert a script to put up a message box saying "Form submitted". That works fine, but...
0
by: VB Programmer | last post by:
I tried to make a VB.NET version of this: http://neevia.com/ex036csharp.htm I keep getting this error: Server Error in '/ProposalGenerator' Application....
2
by: John Walker | last post by:
Hi, On my Webform my ASP:Button does not execute the Javascript code which is 'added' to it on the page load, and I'm trying to figure out why. Please take a look at my code and the error message...
4
by: pbd22 | last post by:
Hi. In my script the below code creates a new element on the page with an associated delete button: var row_element = new Element( 'div', { 'class':'container', 'events':{
1
by: vinitfichadia | last post by:
hey pals, I m developing project related shipping services in VB.Net and MS-SQL and at the time of running one of the application out of it, i m getting following error and i had google a lot many...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
7
by: rajkumarbathula | last post by:
Hi I am creating a usercontrol in .net and using that as webpart in sharepoint site. i want to make use of ajax in my user control. and hence i added scriptmanager, updatepannel and update...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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,...

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.