Click here to Skip to main content
15,919,613 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
-Muc_7-Oct-09 4:20
-Muc_7-Oct-09 4:20 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
Kannan Ar7-Oct-09 4:27
professionalKannan Ar7-Oct-09 4:27 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
-Muc_7-Oct-09 4:34
-Muc_7-Oct-09 4:34 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
Kannan Ar7-Oct-09 4:45
professionalKannan Ar7-Oct-09 4:45 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
-Muc_7-Oct-09 4:58
-Muc_7-Oct-09 4:58 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
dojohansen7-Oct-09 4:30
dojohansen7-Oct-09 4:30 
GeneralRe: How to transfer the collected values of javascript in ajax Pin
-Muc_7-Oct-09 4:37
-Muc_7-Oct-09 4:37 
AnswerRe: How to transfer the collected values of javascript in ajax Pin
dojohansen7-Oct-09 4:22
dojohansen7-Oct-09 4:22 
It's not very clear (at least to me) what exactly the problem is. Nor can we know what AJAX implementation you are using - and there are many available.

You could of course create your own ajax implementation, but it may be a good idea to take a look at what's out there first since you'll probably find something that fits your needs and can handle more than you need too, which is good since you'll then be less likely to have to find another as requirements evolve (and they *always* evolve, unless the app is so unsuccessful that it's scrapped right away).

In general, what you're describing would consist of the following steps:

1) Collect the information that is necessary in order to query the database from the UI. Since the UI is in the browser, you'll most likely do this in JavaScript.

2) Send a request to the web server that indicates an operation and includes the above information. This too is in JavaScript, but how exactly depends on what AJAX implementation you're using.

3) On the web server, build an IDbCommand (e.g. an SqlCommand) to query the database or call a stored procedure, and execute it to get the information you need and/or do any other work the operation includes.

4) Return something to the client.

What to return depends entirely on your requirements. You should always include some indication of success or failure, so the client can inform the user in the event of an error. It may be useful to include debugging information at least in your dev environment, such as an exception stack trace. If the UI is going to display data as a result of the operation, you have the choice of returning the data and use DHTML and JavaScript to modify the UI (more scalable), or rendering the HTML server-side and return it to the client (more powerful if you use an AJAX framework that allows you to do this).


There is a "default" ajax-implementation of asp.net, and although it's not very high performance it may be a good choice (and probably fast enough). Google for "asp.net callbacks" and "asp.net updatepanel" to find tons of tutorials, documentation and code. The great thing about this implementation is that it plays nice in combination with normal postbacks. (Changing almost anything on the client with js can cause problems (related to viewstate), but asp.net callbacks do not, which is both why it may be good and why it's slower than some "pure" ajax implementations.)

If you are already using some third-party ajax framework or a custom implementation of your own, at least clarify what step in this process you're struggling with and what (if anything) you are doing, errors you are getting, and so on.
GeneralRe: How to transfer the collected values of javascript in ajax Pin
-Muc_7-Oct-09 4:57
-Muc_7-Oct-09 4:57 
QuestionTarget Framework and/or compiler version with ASP.NET dynamic compilation Pin
dojohansen7-Oct-09 3:20
dojohansen7-Oct-09 3:20 
Questionproblem in click the FAQ or help title - will go to the corresponding content Pin
janani137-Oct-09 3:06
janani137-Oct-09 3:06 
AnswerRe: problem in click the FAQ or help title - will go to the corresponding content Pin
Manas Bhardwaj7-Oct-09 3:13
professionalManas Bhardwaj7-Oct-09 3:13 
GeneralRe: problem in click the FAQ or help title - will go to the corresponding content Pin
janani137-Oct-09 3:34
janani137-Oct-09 3:34 
QuestionTo get icepak model,problem files Pin
Muktish KG7-Oct-09 3:04
Muktish KG7-Oct-09 3:04 
AnswerRe: To get icepak model,problem files Pin
Manas Bhardwaj7-Oct-09 3:15
professionalManas Bhardwaj7-Oct-09 3:15 
QuestionGridview Row created Event Pin
4anusha47-Oct-09 2:57
4anusha47-Oct-09 2:57 
AnswerRe: Gridview Row created Event Pin
Kannan Ar7-Oct-09 4:17
professionalKannan Ar7-Oct-09 4:17 
GeneralRe: Gridview Row created Event [modified] Pin
4anusha47-Oct-09 18:26
4anusha47-Oct-09 18:26 
GeneralRe: Gridview Row created Event Pin
janani137-Oct-09 19:16
janani137-Oct-09 19:16 
GeneralRe: Gridview Row created Event Pin
sashidhar7-Oct-09 19:18
sashidhar7-Oct-09 19:18 
GeneralRe: Gridview Row created Event Pin
4anusha47-Oct-09 19:34
4anusha47-Oct-09 19:34 
Questionbind datasets in a single gridview Pin
rummer7-Oct-09 2:50
rummer7-Oct-09 2:50 
AnswerRe: bind datasets in a single gridview Pin
Sneha Bisht7-Oct-09 2:55
Sneha Bisht7-Oct-09 2:55 
AnswerRe: bind datasets in a single gridview Pin
Kannan Ar7-Oct-09 4:22
professionalKannan Ar7-Oct-09 4:22 
AnswerRe: bind datasets in a single gridview Pin
praveen.c@byzan.com8-Oct-09 0:29
praveen.c@byzan.com8-Oct-09 0:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.