Sunday, March 18, 2012

ASP.NET Ajax PageMethods

Ajax PageMethods in asp.net

<script type="text/Javascript">
function CallPageMethod()
{
var sDate= document.getElementById('<%=txtSDate.ClientID%>').value;
var eDate=document.getElementById('<%=txtEDate.ClientID%>').value;
PageMethods.GetValue(sDate, eDate);
}
</script>
  
.aspx.cs

[WebMethod]
 public void GetValue(DateTime dtsDate,DateTime dtEDate)
 {
    Cert.StartDate = dtsDate;
    Cert.EndDate = dtEDate;
 }

No comments:

Post a Comment

Comments

Search

Custom Search
Protected by Copyscape Plagiarism Software