In my virtual shop site I need to send product data (single or array) to server. In a case when I work with ASPX and runat="server", I'm organizing OnClick event and delegate. Is it possible in JavaScript? Is there any working example?
Asked
Active
Viewed 406 times
2
-
1Can you post some code? It's not very clear what you're describing. – Xymostech Mar 28 '13 at 15:04
-
1what would you want to do with the data on the server? Process it and refresh the page? – Axarydax Mar 28 '13 at 15:04
-
Can you give us a little more detail? Maybe some code you have so far? – Mike Schwartz Mar 28 '13 at 15:04
-
look at this: http://stackoverflow.com/questions/10481811/how-to-call-c-sharp-button-click-method-from-javascript – Seyed Morteza Mousavi Mar 28 '13 at 16:31
2 Answers
2
I would use a webmethod for that and call the webmethod from javascript. Here is a good tutorial how to do that.
http://www.xdevsoftware.com/blog/post/Call-WebMethod-from-Javascript-in-ASPNET.aspx

Marseld
- 174
- 5
0
Assign your value/values to hidden field on the page using JS - then access it in code behind and do your job.

Eugene Pavlov
- 688
- 5
- 18