Hi guys,
I have a repeater in which i have two imagebuttons,
one for edit & other for delete the record.
But unfortunately both are not firing up Onclick event.
Even i have created this repeater from scratch many times.
and i have tried changing the event name in 'onclick' then it throws the error
CS1061: 'ASP.sim_aspx' does not contain a definition for 'btnEdit_Click1' and no extension method 'btnEdit_Click1' accepting a first argument of type 'ASP.sim_aspx' could be found (are you missing a using directive or an assembly reference?)
Repeater
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table class="addgrid" width="100%">
<thead>
<tr style="background-image: removed('NewTheam/images/Background.png'); height: 30px;
color: Black; vertical-align: middle;">
<td style="width: 50px;">
S.No.
</td>
<td>
Mobile#
</td>
<td>
User
</td>
<td>
Department
</td>
<td>
Assigned
</td>
<td>
Short#
</td>
<td>
Cr.limit
</td>
<td>
Account#
</td>
<td>
Action
</td>
</tr>
</thead>
<tbody>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%# Container.ItemIndex + 1 %>
</td>
<td>
<%# Eval("MobileNo") %>
</td>
<td>
<%# Eval("Name") %>
</td>
<td>
<%# Eval("Department") %>
</td>
<td>
<%# Eval("AssignDate") %>
</td>
<td>
<%# Eval("ShortNo") %>
</td>
<td>
<%# Eval("CreditLimit") %>
</td>
<td>
<%# Eval("AccountNo") %>
</td>
<td>
<center>
<asp:ImageButton ID="btnEdit" runat="server" ImageUrl="~/NewTheam/images/Edit.png"
Width="20" Height="20" CommandArgument='<%# Eval("MobileNo") %>' OnClick="btnEdit_Click" />
<asp:ImageButton ID="btnDel1" runat="server" ImageUrl="~/NewTheam/images/Bin.png"
Width="20" Height="20" CommandArgument='<%# Eval("MobileNo") %>' OnClick="btndel_Click" />
</center>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</tbody> </table>
</FooterTemplate>
</asp:Repeater>
Events
protected void btnEdit_Click(object sender, EventArgs e)
{
string i = ((ImageButton)(sender)).CommandArgument.ToString();
Response.Redirect("updateSIM.aspx?SIMCODE=" + i);
}
<br />
protected void btndel_Click(object sender, EventArgs e)
{
string i = ((ImageButton)(sender)).CommandArgument.ToString();
Response.Redirect("del.aspx?SIMCODE=" + i + "&DOIF=" + 7);
}
Guys is there any issue in the coding or what...
Please help me guys, i'm stuck from two days....
Thanks