R
rolf.oltmans
Hello,
I've been trying to access the html element "Body" in my server side
code. I've searched the archives of this group and have been able to
put together an example that doesn't work![Smile :) :)](/styles/default/custom/smilies/smile.gif)
Actually, I am want to raise an event at client side and want to
perform some action on the server side when that event at client is
triggered. So here is what I am trying to do,
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="__Default"%>
<html>
<head>
</head>
<body runat="server" id="mybody">
<form id="form1" action="Default.aspx" runat="server" method="post">
</form>
</html>
---
Now in my code behind file, I wrote
public partial class __Default : System.Web.UI.Page
{
void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl mybody = new HTMLGenericControl();
mybody.Attributes.Add("onload","javascript:alert(' hello !
');");
}
}
But nothing seems to be working , page loads and alert message doesn't
show up. What I am missing here?
Any help will be highly appreciated.
--Oltmans
P.S --I am working on ASP.NET 2.0
I've been trying to access the html element "Body" in my server side
code. I've searched the archives of this group and have been able to
put together an example that doesn't work
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
Actually, I am want to raise an event at client side and want to
perform some action on the server side when that event at client is
triggered. So here is what I am trying to do,
<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="__Default"%>
<html>
<head>
</head>
<body runat="server" id="mybody">
<form id="form1" action="Default.aspx" runat="server" method="post">
</form>
</html>
---
Now in my code behind file, I wrote
public partial class __Default : System.Web.UI.Page
{
void Page_Load(object sender, EventArgs e)
{
HtmlGenericControl mybody = new HTMLGenericControl();
mybody.Attributes.Add("onload","javascript:alert(' hello !
');");
}
}
But nothing seems to be working , page loads and alert message doesn't
show up. What I am missing here?
Any help will be highly appreciated.
--Oltmans
P.S --I am working on ASP.NET 2.0