<div>
<asp:ScriptManager EnablePageMethods="true" ID="ScriptManager1" runat="server" />
</div>
<div id="div1">
</div>
<input id="otherUser" type="hidden" name="otherUser" runat="server" />
<script language="JavaScript" src="js/rs.js"></script>
<script type="text/javascript" language="JavaScript">
function button_clicked()
{
RS.Execute("Chat1.aspx", "SendMessage",document.Form1.txtMsg.value,document.Form1.otherUser.value, callback, errorCallback);
document.Form1.txtMsg.value="";
document.Form1.txt.scrollIntoView("true");
PageMethods.MyFirstParameterPageMethod(document.Form1.txtMsg.value,onSucceeded,onFailed);
}
function onSucceeded(result,userContext,methodName)
{
$get('div1').innerHTML=result;
}
function onFailed(error,userContext,methodName)
{
alert("An error occurred")
}