Question:
Help with Javascript confirmation box in an html/C# website?
Mike
2011-03-15 07:36:34 UTC
Hello, in my efforts to learn a little more about programming I am building a fairly simple website that will enhance productivity at my work.

I have created the page in HTML with C# back side. It’s getting its information from a SQL 2000 table. The page loads with a data table listing permissions levels. I want to allow supervisors to be able to put in a request to have a users permissions removed. To do this they click a button next to the member, and it prompts a JavaScript confirmation box, asking you to confirm this action. All of the above works just fine.

However, I am stuck trying to get the confirmation box to tell the page to write the members information to a designated table for later viewing.

This is my code for the confirmation box so far. (Again the box works fine, I just need it to go back to the C# and tell it to conduct a stored procedure that I've already created and tested.





Thanks for the help, I have been trying to figure this out for hours now.
Four answers:
fantabulum
2011-03-15 07:53:29 UTC
You need a form to submit the data back to the server. I use PHP, but I don't know anything about C#, so I can't say if if can do this. AJAX may even be able to do something similar, but again, that's an area I'm a bit unfamiliar.



Edit

=========

Thanks for the input Colanth but nobody said anything about C# on the client-side (e.g. the browser). PHP doesn't run on the client-side either. IIt's true that AJAX can retrieve/update information without reloading the page, but it still requires something on the server-side to handle the requests; and as I said, I don't know the limitations/implementations of C#.
anonymous
2011-03-15 08:01:05 UTC
C# runs on the server, generating the page to send to the user. Javascript runs in the user's browser, there's no C# in the browser. Javascript has to cause the browser to submit something to the server to execute a SQL query. Learn AJAX if you want it all to occur without having to reload the page. (C# is a particularly poor choice of language for this. PHP would be best, or ASP.net if you must use a .net language.)
?
2011-03-15 15:43:57 UTC
What do you mean by you have C# in the back end? Is your site an ASP.NET Web App, or ASP.NET MVC Web App, or what... If you explain how C# supports your site I might be able to give you better help.
anonymous
2016-10-19 12:30:01 UTC
attempt this:
Loading...