I got this to work fine: (it may not like the semi-colon at the end of your
confirm statement).
Here's my entire script -
<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e)
{
test.Attributes.Add("onClick", "javascript:return confirm('Are you
sure you want to Delete?')");
}
</script>
<form runat="server">
<input type="button" value="test" id="test" runat="server" />
</form>
</body>
</html>
-----Original Message-----
From: sundar srinivasan [mailto:ssrinivasan3@n...]
Sent: 06 December 2002 16:28
To: ASPX_Professional
Subject: [aspx_professional] RE: client-side script
> try putting 'javascript:'
right in front of return confirm
e.g.
btnDelete.Attributes.Add("onClick", "javascript:return confirm('Are you
sure
you want to Delete?');")
Phil
-----Original Message-----
From: sundar srinivasan [mailto:ssrinivasan3@n...]
Sent: 06 December 2002 15:20
To: ASPX_Professional
Subject: [aspx_professional] client-side script
I dis this in my aspx page on page load:
btnDelete.Attributes.Add("onClick", "return confirm('Are you sure you want
to Delete?');")
It does nothing on the client side on-click..What's wrong?
Sundar
Phil,
It does not work..Strangely, VStudio underlined the entire statement
like a URL..
sundar