Hi i am explaining you here how to call a javascript function from server side code for retrieving Another page into the Div of a same page
Here is my javascript function
<script src="Js/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script language ="javascript" >
function f1() {
$("#shibashish").load("TestMaster.aspx", {}, function () { });
}
</script>
Here is my Sourcecode
Here is my event code
Thanks Shibashish Mohanty
Here is my javascript function
<script src="Js/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script language ="javascript" >
function f1() {
$("#shibashish").load("TestMaster.aspx", {}, function () { });
}
</script>
Here is my Sourcecode
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script src="Js/jquery-1.4.1.js" type="text/javascript"></script>
<script src="Js/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script language ="javascript" >
function f1() {
$("#shibashish").load("TestMaster.aspx", {}, function () { });
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<div>
<%--<input type ="button" value ="get page" onclick ="f1()" />--%>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Button
ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</ContentTemplate>
</asp:UpdatePanel>
<br />
Hi this is static
<asp:UpdateProgress ID="UpdateProgress1" class="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="images/animations-photoshop-26.gif" style="height: 40px" />
</ProgressTemplate>
</asp:UpdateProgress>
<br />
<div id="shibashish">
hi this dynamic
</div>
</div>
</form>
</body>
</html>
Here is my event code
Collapse | Copy Code
protected void Button1_Click(object sender, EventArgs e)
{
System.Threading.Thread.Sleep(3000);
string script = "<script language="'javascript'">f1();</script>";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), Guid.NewGuid().ToString(), script, false);
}Thanks Shibashish Mohanty
No comments:
Post a Comment
Please don't spam, spam comments is not allowed here.