How to call javascript function from code behind server side Asp.net C#

0
Our Reader Score
[Total: 0 Average: 0]
Overview: Calling Javascript funtion from server side .i.e code behind in Asp.net C#.This article explains how to call a JavaScript function from server side (code behind) in Asp.net C# . First we add page and write a JavaScript function on our .aspx page, here default.aspx is our newly added  page.

Code : Add a JavaScript function on default.aspx page under head tag.

 

 Server side : using below given code we able to call JavaScript function from server-side.

 

as our JavaScriptript function name as helloWorld() so our final code would be like as given below

 

If you have  used Asp.net UpdatePanel in your Design page (.aspx page ) then the code will be like

 


Get your Printable Copy

NO COMMENTS

LEAVE A REPLY