troubleshooting Question

Working Between Server Side and Client Side Code for Offline Web App

Avatar of jschlemmer
jschlemmer asked on
JavaScript.NET ProgrammingASP.NET
4 Comments1 Solution428 ViewsLast Modified:
I have a .Net 4 Web Application (c#) that will mostly be accessed via mobile devices.  We want to allow as much of the site as possible to be available offline using HTML5.  The only issue I am really struggling with is creating communication between the server side code and the javascript (and vice versa) to do this.  For example, if the employee uses the site to update the status of the job they are working on, I want On Submit to have javascript check for connectivity.  If not connected,store values in Web Sql or Cookie until connectivity is obtained.  Or if connected execute server side code from the code behind syncing the new values with the server.  So really two questions:

1)  Is there a way to execute a code behind method from javascript in aspx page? Definitely preferred if possible.
2)  If I utilize ClientScript.RegisterStartupScript to run the javascript side of things so that everything would be done from code behind, would this functionality still truly be available offline.  

I genuinely do not even wish for the server side code to even attempt to execute if there is no connectivity which is why an answer to question 1 would be most preferred.  Rather, I'd like it to simply alert the user that they are not connected, save the data locally and the data will sync later, essentially failing gracefully allowing the user to continue using the site.  
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros