<head id="Head1" runat="server">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.0/jquery.min.js"></script>
</head>
<body>
<form id="form1" runat="server">
<script type="text/javascript">
$(function () {
$('#btnTest').click(function () {
$('#divTest').fadeOut(5000);
});
});
</script>
<input id="btnTest" type="button" value="Test" />
<div id="divTest" style="background-color: Gray; color: White;">
Data is Saved...!
</div>
</form>
</body>
</html> i am not using any ajax call i just want to give call to my jquery from code behind. thats it. Thanks
Hi,
We can use the code like this:
string jquery = "$('#divTest').fadeOut(5000);" Page.ClientScript.RegisterStartupScript(typeof(Page), "a key", "<script type=\"text/javascript\">"+ jquery +"</script>");
http://stackoverflow.com/questions/6178811/
http://www.c-sharpcorner.com/UploadFile/cd7c2e/call-jquery-from-code-behind-in-Asp-Net-application/
Since this case not related to SharePoint, I suggest you post it to a suitable forum, you will get more help and confirmed answers from there.
Best Regards
not working in my sharepoint project.but working in my asp.net web application.
how to make it workable in sharepoint
Hi,
We can create a web part in SharePoint and use the code in web part, here are two articles for your reference:
Creating a Web Part with Client-side Scripts (Anweshi Deverasetty)
How to run a popup window from code behind in web Part writen in C#
Best Regards