473,396 Members | 2,108 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.

jScript call from the code-behind (aspx.cs)

Does someone know if it is possible do call a jScript-function from the
code-behind (aspx.cs)?
For exemple

// in the aspx.cs
this.ImageButton1.Attributes.Add("onClick","ShowPi c(43);");
//and then in the HTML-code of this side:
function ShowPic(int x)
{
how ever
}

Thanks a lot for every answer
Patrick Marti
Jul 21 '05 #1
2 1395
Hi Patrick,

Yup, try it--you can do it exactly as you suggested. Add the button
attribute on Page.Load().

- Mike

Patrick Marti wrote:
Does someone know if it is possible do call a jScript-function from the
code-behind (aspx.cs)?
For exemple

// in the aspx.cs
this.ImageButton1.Attributes.Add("onClick","ShowPi c(43);");
//and then in the HTML-code of this side:
function ShowPic(int x)
{
how ever
}

Thanks a lot for every answer
Patrick Marti

Jul 21 '05 #2
Patrick,

You can do it, and than add the J function using

registerstartup

http://msdn.microsoft.com/library/de...cripttopic.asp

I hope this helps

Cor
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hartmut Schroth | last post by:
Hi, is it possible to call a Windows function from VB code behind an aspx page? Shell seems not to work?? Task: I want to execute an SQL script for SQL Server and want to avoid to be forced to...
3
by: CW | last post by:
I find it necessary to mix code-behind and non-code behind techniques sometimes. I have utility functions defined in a VB module. Is there anyway for me to call functions defined in VB module...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
19
by: Alan Silver | last post by:
Hello, I have been developing ASP.NET with a text editor so far (better way to learn initially), and have now been trying Visual Web Developer. I want to create a project for an existing site...
2
by: Patrick Marti | last post by:
Does someone know if it is possible do call a jScript-function from the code-behind (aspx.cs)? For exemple // in the aspx.cs this.ImageButton1.Attributes.Add("onClick","ShowPic(43);"); ...
2
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
1
by: archana | last post by:
Hi all, I am new to asp.net. I have one question regarding code- behind model. I have written page_load event in code behind as well as in aspx page. Means i am doing mixing of code-behind...
4
by: sajithkahawatta | last post by:
i want to call a java script function from code behind. in page1.aspx page i placed script' <script language="javascript"> function SetSelected() { infoTextBox.select(); } </script>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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:
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.