This time I’ll show how to call C# methods from page javascript using Atlas library.
I had task to implement adding comments to blog post in the Ajax way. Because of I used Atlas in this project I decided to use Atlas Update Panel. But I got problem – after Atlas postback Tiny text editor which I used didn’t got working. So I decided to transfer fields text in some another way… but there was one problem I still needed atlas postback to refresh datalist after comment is added. And I found simple solution.

Atlas has feature very similar to Ajax.NET to use C# methods from javascript. Then I decided to add obvious html button and after comment is posted I wanted to make postback of this update panel so I did it:
<atlas:UpdatePanel ID="UpdatePanel2" runat="server" Mode="Conditional">
<ContentTemplate>
<button id="MyButton" onclick="MyButtonClick()" type="button">
<asp:Button ID="btnAddComment" runat="server" Text="Add Comment" OnClick="btnAddComment_Click" CssClass="hiddenBtn" />
<atlas:ControlEventTrigger ControlID="btnAddComment" EventName="Click"></atlas:ControlEventTrigger>
tinyMCE.triggerSave(true,true);
PageMethods.SaveComment(comment, $("txtName").value, $("txtCode").value, Add_Complete, Add_Timeout, Add_Error); //method with callbacks
$("result").innerText = arguments[0].toString();
if(arguments[0].toString()=="Comment posted")
$("ctl00_ContentPlaceHolder1_btnAddComment").click();//do postback
public string SaveComment(string comment, string name,string code)
string msg = GetValidationMessage(comment, name, code);
taComments.Insert(new Guid(postId), comment, name, BlogUtil.UserId);
msg = "Comment posted";
msg = "Comment not posted - server error";

Thanks for mentioning
Zsss
thanx but actually i need a
please send me the tutorial
This tutorial is a really
what will be the code for changing connectionstring for the foll
Hi
Thanks
Thanks for the tip. I
Something big, I'll read it
Hi Dude,
I have a similar kind of problem. I have a A TextBox which is placed inside an updatePanel and on textchange i need to get the autocomplete functionality. I have already done it using Javascipt/CSS and server code without UpdatePanel but now i need to do it using UpdatePanel in 3.5 and for which i do not have an idea of how to call the server code from the JavaScript and hence show them up in the div as autocomplete.
Can u suggest something on the same?
ASAP