I have read many reference for this question but not getting result. So, I thought let me try to explain my scienario here.
This is my 3 script which is in view.ascx control. I want to call it in .cs file function and in click event.
view.ascx
<script type="text/javascript">
function startLoading() {
alert("load start");
var el = jQuery(".scp-entry-header");
App.blockUI(el);
}
function stopLoading() {
alert("load end");
var el = jQuery(".scp-entry-header");
App.unblockUI(el);
}
function getCalendarData() {
alert("calendarcalled");
}
</script>
view.ascx.cs
//ViewData button click
protected void btnGetData_Click(object sender, EventArgs e)
{
//How to call startLoading function here?
process from database;
//How to call stopLoading function here?
}
//simple function call
protected void showCalendar()
{
//How to call getCalendarData function here?
}
I have read about RegisterScript but not getting result. I don't understand where to RegisterScript and how to call it in function.
Can anybody please suggest me in detail how can I call javascript function here?
.csfile(not on button click only). I also want to call javascript in simple function of.csfile. I have edited my question to more clear it. Please correct me to stop misunderstanding.