How to Call a client Script from Code behind

  • Thread starter Thread starter Chung
  • Start date Start date
C

Chung

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.Attribute["onclick"] = "javascript:scriptfuntion()";

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 said:
-----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.Attribute["onclick"] = "javascript:scriptfuntion()";

Good Luck!!!!
 
Therefore, No way for doing something like this.

-----Original Message-----
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.


-----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.Attribute["onclick"] = "javascript:scriptfuntion()";

Good Luck!!!!


.
 
Correct. See my first reply.


Chung said:
Therefore, No way for doing something like this.

-----Original Message-----
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.


-----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.Attribute["onclick"] = "javascript:scriptfuntion()";

Good Luck!!!!


.
 
Back
Top