Mas

Mas

  • NA
  • 478
  • 71.1k

How to open the POPUP on hyperlink with Grid structure

Mar 24 2020 1:18 AM
Hello Members,
 
Hope you are doing good!!
 
How can i open the popup on same window, When i am clicking on the Hyperlink with some grid.
 
when i am clicking on check box, How i can display the button.
 
Below I am adding the code.
 
can any one guide me here.
 
Thank you in advance!!
 
ASPX PAGE:

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="Findcandidates._default" %>  
  2. <!DOCTYPE html>  
  3. <html xmlns="http://www.w3.org/1999/xhtml">  
  4. <head runat="server">  
  5. <meta charset="utf-8" />  
  6. <meta name="viewport" content="width=device-width, initial-scale=1" />  
  7. <title>Candidate details</title>  
  8. <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css" />  
  9. <link rel="stylesheet" href="/resources/demos/style.css" />  
  10. <script src="https://code.jquery.com/jquery-1.12.4.js"></script>  
  11. <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>  
  12. <script>  
  13. $( function() {  
  14. $( "#tabs" ).tabs();  
  15. });  
  16. $(document).ready(function() {  
  17. var $submit = $("#submit_prog").hide(),  
  18. $cbs = $('input[name="prog"]').click(function() {  
  19. $submit.toggle( $cbs.is(":checked") );  
  20. });  
  21. });  
  22. </script>  
  23. <style>  
  24. #GridView1 {  
  25. font-family: Segoe UI;  
  26. font-size: 10px;  
  27. }  
  28. #GridView1 {  
  29. font-family: 'Segoe UI';  
  30. border-collapse: collapse;  
  31. width: 80%;  
  32. font-size: 10px;  
  33. }  
  34. .  
  35. #GridView1 td, #GridView1 th {  
  36. border: 1px solid #ddd;  
  37. padding: 8px;  
  38. }  
  39. GridView1 tr:nth-child(even) {  
  40. background-color: #f2f2f2;  
  41. }  
  42. #GridView1 th {  
  43. padding-top: 4px;  
  44. padding-bottom: 4px;  
  45. text-align: center;  
  46. background-color: cornflowerblue;  
  47. color: white;  
  48. }  
  49. </style>  
  50. </head>  
  51. <body>  
  52. <form runat="server">  
  53. <input type="submit" id="submit_prog" value='Send email' style="font-family: 'Segoe UI'; font-size: 10px; text-align: center;" />  
  54. <div id="tabs">  
  55. <ul>  
  56. <li><a href="#tabs-1" style="font-family: 'Segoe UI'; font-size: 10px; text-align: center; width: 80px;">Sophus IT solutions</a></li>  
  57. <li><a href="#tabs-2" style="font-family: 'Segoe UI'; font-size: 10px; text-align: center; width: 80px;">Ceipal</a></li>  
  58. <%--<li><a href="#tabs-3" style="font-family: 'Segoe UI'; font-size: 10px; text-align: center; width: 80px;">Monster</a></li>--%>  
  59. </ul>  
  60. <div id="tabs-1">  
  61. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" OnRowDataBound="OnRowDataBound">  
  62. <Columns>  
  63. <asp:TemplateField>  
  64. <ItemTemplate>  
  65. <asp:CheckBox ID="checkbox" runat="server" />  
  66. </ItemTemplate>  
  67. </asp:TemplateField>  
  68. <asp:BoundField DataField="resumetoJDmatch" HeaderText="Resume to JD match" ItemStyle-Width="140" />  
  69. <asp:BoundField DataField="mandatoryskillmatch" HeaderText="mandatory skill match" ItemStyle-Width="100" />  
  70. <asp:BoundField DataField="Datecreated" HeaderText="Date created" ItemStyle-Width="90" />  
  71. <asp:HyperLinkField DataTextField="Name" HeaderText="Name" ItemStyle-Width = "150" DataNavigateUrlFields="mandatoryskillmatch" DataNavigateUrlFormatString="~/WebForm1.aspx?Id={0}"/>  
  72. <asp:BoundField DataField="phonenumber" HeaderText="Phone number" ItemStyle-Width="100" />  
  73. <asp:BoundField DataField="email" HeaderText="E-mail" ItemStyle-Width="90" />  
  74. <asp:BoundField DataField="location" HeaderText="Location" ItemStyle-Width="120" />  
  75. </Columns>  
  76. </asp:GridView>  
  77. <%-- <input type="checkbox" name="prog" value="1" />--%>  
  78. </div>  
  79. <div id="tabs-2">  
  80. </div>  
  81. <div id="tabs-3">  
  82. </div>  
  83. </div>  
  84. </form>  
  85. </body>  
  86. </html> 
C#:
  1. using System;  
  2. using System.Collections.Generic;  
  3. using System.Linq;  
  4. using System.Web;  
  5. using System.Web.UI;  
  6. using System.Web.UI.WebControls;  
  7. using System.Data;  
  8. namespace Findcandidates  
  9. {  
  10.     public partial class _default : System.Web.UI.Page  
  11.     {  
  12.         protected void Page_Load(object sender, EventArgs e)  
  13.         {  
  14.             if (!this.IsPostBack)  
  15.             {  
  16.                 DataTable dt = new DataTable();  
  17.                 dt.Columns.AddRange(new DataColumn[7] { new DataColumn("resumetoJDmatch"), new DataColumn("mandatoryskillmatch"), new DataColumn("Datecreated"), new DataColumn("Name"), new DataColumn("phonenumber"), new DataColumn("email"), new DataColumn("Location") });  
  18.                 dt.Rows.Add( "100%","90%""13-may-2019","Suresh Kumar","1234567890","[email protected]""san Jose,CA");  
  19.                 dt.Rows.Add("100%""90%""13-may-2019""Suresh Kumar""1234567890""[email protected]""san Jose,CA");  
  20.                 GridView1.DataSource = dt;  
  21.                 GridView1.DataBind();  
  22.             }  
  23.         }  
  24.         protected void OnRowDataBound(object sender, GridViewRowEventArgs e)  
  25.         {  
  26.             DataTable dt = new DataTable();  
  27.             dt.Columns.AddRange(new DataColumn[7] { new DataColumn("resumetoJDmatch"), new DataColumn("mandatoryskillmatch"), new DataColumn("Datecreated"), new DataColumn("Name"), new DataColumn("phonenumber"), new DataColumn("email"), new DataColumn("Location") });  
  28.             foreach (GridViewRow row in GridView1.Rows)  
  29.             {  
  30.                 if (row.RowType == DataControlRowType.DataRow)  
  31.                 {  
  32.                     CheckBox checkbox = (row.Cells[0].FindControl("checkbox"as CheckBox);  
  33.                     if (checkbox.Checked)  
  34.                     {  
  35.                         string resumetoJDmatch = row.Cells[1].Text;  
  36.                         string mandatoryskillmatch = row.Cells[2].Text;  
  37.                         string Datecreated = row.Cells[3].Text;  
  38.                         string Name = row.Cells[4].Text;  
  39.                         string phonenumber = row.Cells[5].Text;  
  40.                         string email = row.Cells[6].Text;  
  41.                         string Location = row.Cells[7].Text;  
  42.                          
  43.                         dt.Rows.Add(resumetoJDmatch, mandatoryskillmatch, Datecreated, Name, phonenumber, email, Location);  
  44.                     }  
  45.                 }  
  46.             }  
  47.         }  
  48.     }  


Answers (4)