Embedding ASP.NET Server Variables in Client JavaScript (www.west-wind.com)

published 1 year, 11 months ago, submitted by rstrahlrstrahl(7085) 1 year, 11 months ago

Getting Server Variables embedded into a page and using them from JavaScript code can be a pain. Following Jon Galloway's post a few days ago I thought that maybe a solution that doesn't rely on ASP.NET AJAX and is more generic might be useful to make the task easier and apply much broader scope. The result is an easy to use, generic class that generates a JavaScript object from key value pairs created on the server from static values or dynamic control/object properties.

1 comment | category: | Views: 97

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:

posted by hismightinesshismightiness(520) 1 year, 11 months ago

Great solution to get JavaScript and .Net to play nice together. There is a bit more to be done, but overall - very well done!

information Login or create an account to comment on this story