Posted on: 3/16/2014 4:26:54 AM | Views : 442

I am trying to figure out a better way to execute ajax code. Right now from aspx file  I call a ashx file in which I put html code combined with C# code.
However it's seems not the best solution. Is there a way to call an html or aspx that will return the results after C# code executed?
Like a template where you replace placeholders with actual values returned by the C# code.
Thank you.
Here is a sample code:
ASPX file:
 var accountID = $("#<%= hdnAccountID.ClientID %>").val();                    $.ajax({                 type: "POST",                 url: "/MyCourses/Handlers/defaultCourse.ashx?&AccountID=" + accountID, &n ...

Go to the complete details ...