In my specific situation, I have several solutions for my problem. I want to know which one is more feasible. In this case, I can also achieve my goal by returning a JSON object from my server-side code; however, I do not know how this is done and what is the best way to do this.
Firstly, I don't need a full aspx page, since I only need the answer returned from the code. So, am I using web services, a handler, or is there any other way to do this?
Is this possible? Am I StringBuilder JSON string using the StringBuilder class and StringBuilder that string into the aspx landing page? Are there any precautions or things that I should be aware of?
I appreciate your ideas.
Hello,
Kemal
------------ UPDATE! ------------
Suppose I have a JSON object in my userlist.aspx page, which I then use with jQuery ...
{"menu": { "id": "color1", "value": "color", "popup": { "menuitem": [ {"value": "Red"}, {"value": "Green"}, {"value": "Yellow"} ] } }}
Now that I want to add new menu items from my aspx page, what should I do ... I think that my question is more specific ...
Suppose I create a new line in my aspx code, as such, "{"value": "Blue"} . How can I do this in an existing list of elements on the landing page? Or is this not the right approach to this situation? If not, then how else can this be achieved?
Also, if I wanted to fire the jQuery event when a new item is added to this list, how is this achieved?
------------ UPDATE 2 August 26, 2015 ------------
By the time I asked this question, the way I approached the problem was in another aspect. Now I am more competent in this matter and I can gladly accept the most voted answer, since the approach to this question should not explicitly include the existing JSON and derive new code from the code that @DavGarcia also offers.