Dienstag, 13. Oktober 2009

Javascript & .NET

Dieser Post ist nur ein kleiner Tipp, für alle, die sich mit Javascript Cookies schwer tun und gerne Javascript mit .Net Technologie verbinden. I hatte die Aufgabe in einer Applikation im Front-End viel Javascript zu verwenden und es anschliessend im Back-End zu verarbeiten und das über mehrere Postbacks. Meine Lösung war, Werte des Javascripts in einem .Net hidden-field zu speichern, dann über .Net auszulesen und weiterzuverarbeiten, sei es in einer Session, bzw. Datenbank. Somit erreicht man viel clientseitige Funktionalität ohne .Net Postbacks, mit .Net Vorzügen bei einem Postback.

This post is just a little hint for all people, who find javascript cookie handling hard to do and would like to combine it with .Net technology. My job was to include into the front-end a lot of javascript and then working with it in the back-end through multiple post-backs. My solution was, to store the javascript values in a .Net hidden-field and then to read it out through the .Net technology to proceed in storing in a database or session. The pro of this way is, that you have a lot of client-side functionality without .Net post-backs, with the advantage of .Net when performing a post-back.

Keine Kommentare:

Kommentar veröffentlichen