This question already has an answer here:
This is what i m trying. calling the function of the inline js. but i didn't working.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="javascript_Tutorials.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>javaScript Tutorials</title>
<script type="text/javascript" language="javascript">
function objects() {
alert("Well come");
}
</script>
</head>
<body>
<form runat="server" id="myform">
<asp:Button onclick="<% objects(); %>" runat="server" />
</form>
</body>
</html>
and have the following error:
CS1061: 'ASP.webform1_aspx' does not contain a definition for 'objects' and no extension method 'objects' accepting a first argument of type 'ASP.webform1_aspx' could be found (are you missing a using directive or an assembly reference?)
onclientclick
. Anyway "it doesn't work, here's my code" is not how it's done. – CodeCaster Mar 21 at 11:02