Hi
Since you are using a regular button ( not submit )
myBtn.Attributes.Add("onclick","confirmDel(" + iItemID + ")");
Client
function confirmDel(iItemID){
if(confirm("Delete item?")) location.replace("pageToGo.aspx?iItemID=" +
iItemID);
// Or if you want submit the form
//if(confirm("Delete item?")) document.forms[0].submit();
}
If you use submit/ image button just return true/false
function confirmDel(){
return confirm("Delete item?");
}
--
Best Regards
Vidar Petursson
==============================
Microsoft Visual: Scripting MVP 2000-2004
http://www.icysoft.com/ http://www.deus-x.com/ Instant e-commerce
http://www.microsoft.com/technet/scriptcenter/
Playground:
http://213.190.104.211/ ( IE 5.5+ only )
No matter where you go there you are
==============================
"Arne" <an*******@discussions.microsoft.com> wrote in message
news:66**********************************@microsof t.com...
How do I make a web form control react to a client side event in the
browser.
THe onclick event to server based. I am looking for onclick event on the
client.
I need something like this from a webform button control:
<input type=button onclick="return OK()>"><script language="javascript">
function OK()
{
return confirm("Delete News Item. OK?");
}
</script>
But I need the server event also.