button on HTML page that calls code

  • Thread starter Thread starter Andy G
  • Start date Start date
A

Andy G

I have many html pages that I need to put a button on. When this button is
clicked I need to call a stored procedure that updates a record.

-How do I add a button to html page that will call a .vbs or .js file (if
that what I should even call, I would rather call a .vb class I have created
but don't know if that is possible)?

Thanks for the help, hopefully this is enough to go off of. I just need to
get pointed in the right direction.

Andy
 
These html pages reside inside an already developed ASP.NET web application.
I'm sure there is a way I can put a button on a html page without turning it
into a .aspx page and get it to call a script or class file.

Any ideas?
 
Eliyahu said:
No, there is no such a way. Since you want an html button to invoke a server
action, you essentially want to turn it into a server control. You do it by
adding runat=server. Server controls can live only on aspx pages.

Eliyahu

Couldn't you do some sort of a submit to a CGI program on the server,
that CGI code would be written in a .NET language and hence use
SqlCommand to invoke the stored procedure? Does IIS support CGI? Can
a CGI program be written in .NET?

-Steve
 
Andy,

Database access is a server-side task. On server side you can make either a
web application or a webservice. In the former case you will need to turn
your html pages into aspx pages. In the latter case you will need to get
your html pages to call the webservice that you will have to implement. Your
..vb class will be a part of either your web application or your webservice.

Eliyahu
 
No, there is no such a way. Since you want an html button to invoke a server
action, you essentially want to turn it into a server control. You do it by
adding runat=server. Server controls can live only on aspx pages.

Eliyahu
 
Steve,

Since, I started programming for web straight with asp.net, I have a very
little idea about CGI. Post this in a separate thread with an appropriate
subject.

Eliyahu
 
Back
Top