Click here to Skip to main content
15,903,030 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
hi all
on this website(http://bizonline.ir/samsung/83--samsung-i9190-galaxy-s4-mini.html[^]) when i change drop down and choose one of the items the price(id="our_price_display") will change.i have accessed to that webpage and captured the whole webpage and now when i change selected item in drop down by code ,it does not affect on that id.how can i change it?i think it is a javascript function.can you help me to do that?
it a Persian website ,sorry i could not find English sample
Posted
Updated 21-Feb-14 21:02pm
v2
Comments
Sergey Alexandrovich Kryukov 21-Feb-14 20:43pm    
There is no such thing as "java script". Java is not a scripting language. If you mean "Javascript", this is something totally unrelated. So, Java or Javascript?

Not clear. Why doing it? How is that related to Javascript or Java by C#?

—SA
Farshad72 22-Feb-14 3:00am    
i mean JavaScript.i think it has a function that i need to execute to achieve that new id after choosing item

1 solution

Though your question is not very clear but what I understood going through the web page you have provided -

Changing the item will change the price on fly.
And you are doing auto postback for it and thus a whole page refresh occurred and your page gets suck completely and doing nothing for some reason.

The ideal way to handle this is to use Ajax using Javascript or Jquery.
Javascript is a scripting language that can be used with any language you use to develop web app.
The calling is same as javascript is not C# based and it's completely processed in client's end using client's resource.

C#, PHP, JSP any other web language, you can use javascript.

The fundamentals of using ajax here -
1. execute client side dropdown change event
2. Use Ajax to call the server side method.
3. Pass the id of the product item you select in drop down to server side through ajax
4. Charge a sp or inline query to get the price and other details you need to show
5. use a JSON format of data or your custom data format to get all the values and pass it to client side
6. Once you get the data in client side, use javascript to display in the desired controls.

Now if you ask me for the code, I will suggest you to google and you will get tons of such code.

Good luck!
Cheers
Sandip
 
Share this answer
 
Comments
Farshad72 22-Feb-14 4:00am    
they say it needs "System.Web.UI" dll.but i do not have this dll.can you upload it for me?
i have added system.web but there is no UI in my C# class.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900