Hideing of image button on some condition

Posted by Sushant under ASP.NET on 7/15/2013 | Points: 10 | Views : 919 | Status : [Member] | Replies : 1
<asp:DataList ID="dlLocationMaster" runat="server" OnItemCommand="dlLocationMaster_ItemCommand" style="width:100%;">
<ItemTemplate>
<table style="width:100%;">
<tr>
<td style="padding-left: 50px; width:1%;">
&nbsp;
</td>
<td style="padding-left: 10px; width:10%;">
<%#Eval("LocId") %>
</td>
<td style="padding-left: 10px; width:5%; display:none;">
<%#Eval("ParentId") %>
</td>
<td style="padding-left: 10px; width:16%;">
<%#Eval("City") %>
</td>
<td style="padding-left: 10px; width:60%;">
<%#Eval("LocationName") %>
</td>

<td style="padding-left: 10px; width:4%;">
<asp:ImageButton ID="imgEdit" runat="server" ImageUrl="images/edit.gif" CommandArgument='<%#Eval("LocId")%>'
CommandName="Edit" />
</td>
<td style="padding-left: 10px; width:4%;" id="tdDel" runat="server">
<asp:ImageButton ID="imgDelete" runat="server" ImageUrl="images/delete.gif" CommandArgument='<%#Eval("LocId")%>'
CommandName="Delete" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>

on Server side code is :------
try
{
SqlCommand cmd = new SqlCommand("sp_RetriveLocationMaster", cn);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sda.Fill(ds);
dlLocationMaster.DataSource = ds;
dlLocationMaster.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.Message.ToString());
}
finally
{
}

My Prob:-----
i want to hide image button "imgDelete" on condition "LocId==ParentId"


plz responce fast

Sushat


Responses

Posted by: aswinialuri-19361 on: 7/15/2013 [Member] Starter | Points: 25

Up
0
Down
hi,
refer this it might be useful to you
http://www.w3schools.com/jquery/jquery_hide_show.asp

Mark as Answer if it helps you
Thanks&Regards
Aswini Aluri

Sushant, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response