Hi Ashish,
For eg :
In the ButtonClick event of your Toolbar,
If you have 2 buttons with button text Save and print ,
if (sender.GetType().ToString() ==
"Microsoft.Web.UI.WebControls.ToolbarButton")
{
Microsoft.Web.UI.WebControls.ToolbarLabel LblButton =
(Microsoft.Web.UI.WebControls.ToolbarLabel)sender;
if(LblButton.Text.IndexOf(" Save") > -1)
{
LiteralControl li1=new LiteralControl();
li1.Text="<script>alert('Button Save is clicked.');</script>";
Page.Controls.Add(li1);
}
else if(LblButton.Text.IndexOf("Print") > -1)
{
LiteralControl li2=new LiteralControl();
li2.Text="<script>alert('Button Print is clicked.');</script>";
Page.Controls.Add(li2);
}
}
Hope this helps.
Regards,
Marshal Antony
..NET Developer
http://www.dotnetmarshal.com
"Ashish" <no****@myself.com> wrote in message
news:e$****************@TK2MSFTNGP12.phx.gbl...
Hello,
I am sick and tired of ochestrating server and client side scripts.
Basically I am using toolbar from IE web controls and want to attach
javascript to one of the buttons' click event. The problem is that button
doesnt exposes attribute collection. I can attach javascript to whole
toolbar but 1. it would defeat the purpose of only attaching client
scripts to some buttons 2. i would have no means of identifying which button was
clicked....
Please help !!! Thanks !!!
Ashish