Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have hyperlink inside gridview while click on the hyperlink i need to show confirmation message.
Posted

try this...:)


C#
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" width="241px" onrowdatabound="GridView1_RowDataBound" xmlns:asp="#unknown">
  <columns>
    <asp:templatefield>
      <itemtemplate>
      <asp:hyperlink id="HyperLink1" runat="server" onclientclick="return confirm('Do you really want?')>HyperLink</asp:hyperlink><br mode=" hold=" />                    </itemtemplate><br mode=" gender=" /><br mode=">
      </asp:hyperlink>
      </itemtemplate>
    </asp:templatefield>
  </columns>
</asp:gridview>
 
Share this answer
 
v2
<a href='#' onclick="return confirm('Are you sure you want to delete?')" >[Delete]</a>


OR

XML
<asp:TemplateField HeaderText="Description" HeaderStyle-HorizontalAlign="Center"
   ItemStyle-HorizontalAlign="Left" HeaderStyle-Width="50%" ItemStyle-Width="50%"><ItemTemplate><asp:Button ID="btnDelete" runat="server" Text="Delete" class="seaBtn"OnClick="btnDelete_Click"OnClientClick="return confirm('Are you sure you want to delete?');" /></ItemTemplate>
</asp:TemplateField>
 
Share this answer
 
<asp:linkbutton runat="server" id="Review" xmlns:asp="#unknown">
CommandName="Select" CommandArgument="Review" Text="Review" CssClass="selectbutton btn-custom"/>

Use command arguments.to handle operations inside grid
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900