Hi guys... My code :
<%@ Page Language="C#" %>
<script runat="server">
void button_Click(object sender, EventArgs e)
{
label.Text = "Refreshed by server side event handler at " + DateTime.Now + ".<br>Value provided:" + text.Text;
}
</script>
<html>
<head>
<title>How to update an UpdatePanel with JavaScript</title>
<script type="text/javascript">
function UpdPanelUpdate(id) {
var obj = document.getElementById("<%= text.ClientID %>");
obj.value = id;
__doPostBack("<%= button.ClientID %>", "");
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<a href="javascript:UpdPanelUpdate('Value passed by javascript')">Update the Panel</a>
<asp:TextBox ID="text" runat="server" Style="display: none;"></asp:TextBox>
<asp:Button ID="button" runat="server" OnClick="button_Click" Style="display: none;" />
<asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional" ChildrenAsTriggers="false">
<contenttemplate>
<asp:Label ID="label" runat="server"></asp:Label>
</contenttemplate>
<triggers>
<asp:AsyncPostBackTrigger ControlID="button" EventName="Click" />
</triggers>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
That works great, but when I use it with a Masterpage, the link does´t seems to work... No error, but nothing happens...
Any idea?
Thanks!