I need help with my logic...
Currently:
- A user inputs some data in a page from.
- The user clicks submit.
- Javascript places their data in a hidden input field.
- The page does a postback (reloads)
- C# registers that this is a postback and gets the hidden javascript field.
- C# puts it in the database.
The problem with the above is the reloading of the webpage. I do not want that. I have played around with a callback script that is not working (I have another question open on trying to debug that).
My question is about alternatives to accomplish my steps as defined above without a callback or postback? Is there a way to simply call the server-side function on demand from a client side function? (I know callbacks should do this very thing, but mine is not working)
If there is no such alternative, why is it that callbacks are so complicated (from a novice's point of view)? Why can I not simply call a callback like:
if (IsCallBack)
{
string test = Request.Form["saveTest"];
//do stuff
}
Thank you. Also, please do not 'close' or mark down my question without first critiquing me. Thanks.