简体   繁体   中英

How to make request from Class files(serverside) to .aspx file(clientside)?

This is different problem for me. I used ASP.NET2.0 with AJAX,C#.

Regularly client make request from HTML (client side) to any class(.cs) file(server side). And then make updation on that class files through Object or in database.

But I want to make request from Class file (server side) to HTML file (client side) based on that Object.

I m also used HashTable for containing Key and related to that Object.

If you are not able to understand then I try to Explain you my problem differently, I will give you one simple Example :I m calling any function from javascript to my class function, now I want call from class function to javascript function.

please explain me in brief, Please Help me.

You can actually change the contents of an UpdatePanel during a partial page postback. So if the client clicks something on your ASPX page which alters your object on the server-side, you can update the controls on the ASPX page during that round trip.

If you need to simply update your view occasionally with no user interaction, then the ASP.NET AJAX Timer control will help.

There are three methods for interacting with server side code from the client side:

  1. Update panels: This uses a partial postback where the page essentially does a full postback to the server and then ignores everything except whats in the update panel then sends the result back.

  2. Page methods - This might not be quite what you are looking for since page methods require that the method be static on the page itself.

  3. Web service methods - These are the same web services you may use from your aspx code behind but you will need a script manager on the page to use them from javascript.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM