2

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?

4
  • 1
    Can you post some code? It's not very clear what you're describing. Commented Mar 28, 2013 at 15:04
  • 1
    what would you want to do with the data on the server? Process it and refresh the page? Commented Mar 28, 2013 at 15:04
  • Can you give us a little more detail? Maybe some code you have so far? Commented Mar 28, 2013 at 15:04
  • look at this: stackoverflow.com/questions/10481811/… Commented Mar 28, 2013 at 16:31

2 Answers 2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.