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

calling jscript file in .aspx file

hi guys i have a code like this
Expand|Select|Wrap|Line Numbers
  1. <asp:Button runat="server" id="cmdCalendar" onclick="cbfshowcalendar('frmOrder', 'txtDate', 'btn1');event.cancelBubble=true;" />
  2.  
  3.  
but it keeps telling me that it doesnt see my cbfshowcalendar functino in side the javascript file. i did include that file in the aspx page

<script language="JavaScript" type="text/javascript" src="calendar.js"></script>

please help me thanks.
Jul 15 '08 #1
1 1433
ShadowLocke
115 100+
hi guys i have a code like this
Expand|Select|Wrap|Line Numbers
  1. <asp:Button runat="server" id="cmdCalendar" onclick="cbfshowcalendar('frmOrder', 'txtDate', 'btn1');event.cancelBubble=true;" />
  2.  
  3.  
but it keeps telling me that it doesnt see my cbfshowcalendar functino in side the javascript file. i did include that file in the aspx page

<script language="JavaScript" type="text/javascript" src="calendar.js"></script>

please help me thanks.
Your using an ASP control, if you want to run javascript from that button you need to use the property "OnClientClick". The "OnClick" property of the ASP button points to a server side function.

Also, if you dont want the page to post back using that button be sure the cbfshowcalendar function returns false.
Jul 16 '08 #2

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

Similar topics

5
by: benc | last post by:
Hi Can some good soul help on this. I need to call jscript functions from C#. I have hosted a web control and displayed an html page successfully, but just can't find a way to call jscript...
3
by: Charles A. Lackman | last post by:
Hello, I wrote a jscript function within the HTML window of my webpage and would like to call it from inside the ASPX code-behind page. Any suggestions? or I would like to cause an alert box...
4
by: RFS666 | last post by:
Hello, I have the following problem: I have a web project where I display an activeX control that displays 2D-graphs on an aspx-page. I use jscript to access and modify the properties of the...
4
by: Peter Bons | last post by:
Hi all, I have an asp.net page with a button that has a javascript onclick method attached to it to display a modal dialog like this: If reportHasParameters Then 'add client side onclick()...
7
by: RFS666 | last post by:
Hello, I would like to use variables with a type in jscript.NET. I declare them as follows: var x : double = 5.03; This doesn't work in my script, that I write to the page in codebehind with...
0
by: tvin | last post by:
Hello all, I have a problem to use jscript.js file in aspx page: I wrote jscript file in Notepad and I compiled this jscript file,after compiled and .exe in command prompt,i see that the...
2
by: Jer425 | last post by:
Hello, I'm coding in VB and trying to include a jscript file. This will not work because you can only use one language in asp.net. Is there a way that I can use the jscript without having to...
7
by: Frank | last post by:
Hi, I simply wish to code a JS function ONCE, in a .js file, include the .js file in the Master page, and then in several but not all pages, I wish to execute the function on pageload. I...
4
by: Ajvan | last post by:
Hi everybody, I have one problem, and I hope some of you guys can help me with this. I`m working in C# (Visual Studio 2005)...writing simple web site . I place grid on Default.aspx and put one...
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:
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
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?
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
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...

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.