Hi All,
Can anyone tell me how can I call a client script
(javascript) from Code behind server code (c#)?
Chung 5 7807
You can't. Client scripts run on the client, not the server.
"Chung" <an*****@hotmai l.com> wrote in message
news:01******** *************** *****@phx.gbl.. . Hi All,
Can anyone tell me how can I call a client script (javascript) from Code behind server code (c#)?
Chung -----Original Message----- Hi All,
Can anyone tell me how can I call a client script (javascript) from Code behind server code (c#)?
Chung .
Hi, you can do it in this way, for example:
buttonName.Attr ibute["onclick"] = "javascript :scr iptfuntion()";
Good Luck!!!!
Of course, that's not really calling the client-side script from the
code-behind. That's creating a client-side event handler from the server.
The script still is executed client-side.
"Marcelo W. Lopez" <an*******@disc ussions.microso ft.com> wrote in message
news:02******** *************** *****@phx.gbl.. . -----Original Message----- Hi All,
Can anyone tell me how can I call a client script (javascript) from Code behind server code (c#)?
Chung . Hi, you can do it in this way, for example:
buttonName.Attr ibute["onclick"] = "javascript:scr iptfuntion()";
Good Luck!!!!
Therefore, No way for doing something like this. -----Original Message----- Of course, that's not really calling the client-side
script from thecode-behind. That's creating a client-side event handler
from the server.The script still is executed client-side.
"Marcelo W. Lopez" <an*******@disc ussions.microso ft.com>
wrote in messagenews:02******* *************** ******@phx.gbl. .. >-----Original Message----- >Hi All, > > Can anyone tell me how can I call a client script >(javascript) from Code behind server code (c#)? > >Chung >. > Hi, you can do it in this way, for example:
buttonName.Attr ibute["onclick"]
= "javascript:scr iptfuntion()"; Good Luck!!!!
.
Correct. See my first reply.
"Chung" <an*****@hotmai l.com> wrote in message
news:02******** *************** *****@phx.gbl.. . Therefore, No way for doing something like this.
-----Original Message----- Of course, that's not really calling the client-side script from thecode-behind. That's creating a client-side event handler from the server.The script still is executed client-side.
"Marcelo W. Lopez" <an*******@disc ussions.microso ft.com> wrote in messagenews:02******* *************** ******@phx.gbl. .. >-----Original Message----- >Hi All, > > Can anyone tell me how can I call a client script >(javascript) from Code behind server code (c#)? > >Chung >. > Hi, you can do it in this way, for example:
buttonName.Attr ibute["onclick"] = "javascript:scr iptfuntion()"; Good Luck!!!!
. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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);");
//and then in the HTML-code of this side:
function ShowPic(int x)
|
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 write a very complicated stored procedure (with all the dynamic SQL problems and ....), as I have a (generated) script, that is working quite fine.
Thanks for help in advance
Regards
|
by: Brett Robichaud |
last post by:
I understand how code-behind can handle events for a page, but can I call a
code-behind method from within a <script> tag in my ASP.Net page, or can I
only call methods defined in other <script> sections? I can't seem to
figure out the syntax for for calling code-behind directly. The method is
within the class my page inherits from and is public, but when I try to call
it from my page I get this error:
CS1520: Class, struct, or...
|
by: Antonio |
last post by:
Hi,
I would like to have my TreeNode to call window.close(); without posting
back, how can I do that? At the same time, I prefer to have a SelectAction
property that allows my TreeNode to appear as hyperlink with hand-cursor
when hover.
For your information, my TreeView control is on a master page. I have done
some tricks but when clicking the node, it does the post-back and my page
appears empty with nothing on it except the popup...
|
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>
| |
by: vksundari |
last post by:
I am executing a select query in a C# component and populating a ASP Grid in Search.aspx.
Now one of the columns in the Grid in Search.aspx is Policy Number(hyper link)
Basicallly I want to call a ASP.net method by sending parameters from that link.
For example
Select a, b, policy_number from x
Policy_Number is the hyperlink.
Now I want to call a ASP.net method sending in a and b as input parameters.
|
by: Mike |
last post by:
Ok, here is my story. I took over a web site that is using the asp.net wizard. This wizard has buttons within it, now, on one of the steps in the wizard I have a drop down. Depending if 'Delete' is selected in the drop down, I need to show a message box to ask the user 'you sure you want to delete?" if they click 'OK' it deletes, if they click cancel it does nothing.
So within the button click event, how can I show an confirmation box only...
|
by: visweswaran2830 |
last post by:
Hi,
I have a function in aspx.vb (code behind fucntion). Now I want to call this function using javascript... How can I call?
|
by: pearlmca |
last post by:
I am using .Net 3.5, withupdatepanel, Its a registration form based on email availability , I call java script function within the button click function,i try a lot but not working.
<asp:ImageButton ID="imgbut_save" ImageUrl="images_test/button-save.gif" OnClientClick ="return pagevalidationnew();" runat="server"
OnClick="imgbut_save_Click" />
protected void imgbut_save_Click(object sender,...
|
by: raulbolanos |
last post by:
I guys, I got 2 days trying to go thought this and I cannot figure out how to solve it, hope you can help me out here.
I have a ASP Web Application, as simple as this;
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" %>
<%@ Import Namespace="System.IO" %>
<HTML>
<HEAD>
<script type="text/javascript">
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |