How to call this a method from code page to Javascript.

Posted by Naga116 under C# on 7/23/2011 | Points: 10 | Views : 1562 | Status : [Member] | Replies : 2
From Grid view control to javascript.

Having a method in code page. How to call this a method from code page to Javascript.

Nagaraju


Responses

Posted by: A4u_6178 on: 7/23/2011 [Member] Starter | Points: 25

Up
0
Down
Hi,
If i understood ur question correctly, u are asking how to use javascript function from code behind file (aspx.cs)??
then below code might be useful for u...
ClientScriptManager script = Page.ClientScript;

if (!script.IsClientScriptBlockRegistered(this.GetType(), "SubmitScript"))
{
script.RegisterOnSubmitStatement(this.GetType(), "SubmitScript", "return confirm('Are You Sure You Want To Submit!!')");
}


Thanks & Regards,

Naga116, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: RaviRanjanKr on: 7/23/2011 [Member] Starter | Points: 25

Up
0
Down
hey! You should learn about Client-Callback Implementation. take a look at given links
http://msdn.microsoft.com/en-us/library/ms178210.aspx
or have a go through the given link having same question with entitled "Calling ASP.NET Code Behind function from Javascript"
http://stackoverflow.com/questions/2521352/calling-asp-net-code-behind-function-from-javascript

Thanks
Ravi Ranjan Kumar
http://raviranjankr.wordpress.com

Naga116, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response