You see this form is supposed to run on server side. So it'll try to call procedures on the server and not the client. If you want to perform this task, you have some options like: write a function in C# on server side like this public void Hello() {MessageBox.Show("Hello World")} or do not use an asp button. Use HTML button like or as said by somebody above, you can use onClientClick event handler.. Hope this will clarify all your doubts Don't forget to rate the comments
mihsathe
Posts
-
Basic Javascript error -
ASP.Net DevelopmentYes. You can use AJAX for that. I'd prefer the raw AJAX. Use javascript to open your async connection with the server with XmlHttp or Activex object (for IE). Set your target as another aspx page or PHP page. Do all your processing in that page. Generate a response and then use responseText to retrieve it in ur page. No need to refresh at all..
-
.aspx page not opening as it should !Understand that all the server pages like .asp , .aspx , .php etc can only be served by your server. In this case, your IIS server. In case you want to acces your page on localhost from outside Visual Studio, go to "C:/inetpub/wwwroot/" and then address of your page will be as : http://localhost:port/foldername/file.aspx..It can be then accessed by your HTML pages in same folder. If you want to avoid all this trouble, simply put that HTML page in same project of VS. Then everything will be fine...