ASP.Net + javascript

  • Thread starter Alexander Vasilevsky
  • Start date
A

Alexander Vasilevsky

there is a Default.aspx page:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="AyreonsWorld.Default" %>

<!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" lang="en">
<head id="homePageHead" runat="server">
<title>Title</title>
<script type="text/javascript" language="javascript">
window.onload = function()
{
var button = document.createElement("input");
button.type = "button";
button.id = "testButton";
var mainDiv = document.getElementById("mainDiv");
mainDiv.appendChild(button);
};
</script>
</head>

<body background="Images/Back.bmp">
<form id="home_form" runat="server">

<div id="mainDiv"></div>

</form>
</body>
</html>

How can I attach to created button an event that would be described in
Default.aspx.cs and worked after pressing? Thank in advance.


http://www.alvas.net - Audio tools for C# and VB.Net developers + Christmas
Gift
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top