Hi guys,
I have asp.net website,
Where i have one small code in javascript.
<script type="text/javascript">
function GetAlt(a, b, c) {
alert(a + "|" + b + "|" + c);
}
</script>
and i want to call this function on button click in a repeater.
<asp:ImageButton ID="imgEdit" runat="server" CommandArgument='<%# Eval("tc") + "," + Eval("JobName") + "," + Eval("Discount") %>'
OnClientClick='<%# "GetAlt(" + Eval("tc") + "," + Eval("JobName") + "," + Eval("Discount") + ");" %>' ToolTip="Edit" ImageUrl="~/images/Edit.png" Width="20"
Height="20" />
on button click its, just getting postback but not getting an popup box.
I changed imagebutton to simple html button.
<input type="button" name="E" id="E" value="E" onclick='<%# "GetAlt(" + Eval("tc") + "," + Eval("JobName") + "," + Eval("Discount") + ");" %>' />
Trying this code:
Button
<asp:ImageButton ID="imgEdit" runat="server" CommandArgument='<%# Eval("tc") + "," + Eval("JobName") + "," + Eval("Discount") %>'
CommandName="Edit" ToolTip="Edit" ImageUrl="~/images/Edit.png" Width="20"
Height="20" />
Repeater_Item...
if (e.CommandName == "Edit")
{
ImageButton btnedit = (ImageButton)e.Item.FindControl("imgEdit");
string[] cmdArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
String strJSFunctionCall = String.Format("return GetAlt({0},{1},{2})", cmdArgs[0], cmdArgs[1], 0);
btnedit.Attributes.Add("onclick", strJSFunctionCall);
}
But still i'm not getting this popup.
can any one please help me...
Thanks