TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mas
NA
478
71.2k
How to Open the popup on same webpage
Mar 24 2020 11:15 PM
Hello Members,
Hope you are doing good!!
Here I am trying to open the POPUP on same webpage, But it is opening in Webform1 page..
Here a, attaching the file.
Can anyone guide me here.
Thank you in advance!!
Default.ASPX page.
<%@ Page Language=
"C#"
AutoEventWireup=
"true"
CodeBehind=
"default.aspx.cs"
Inherits=
"Findcandidates._default"
%>
<!DOCTYPE html>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<meta charset=
"utf-8"
/>
<meta name=
"viewport"
content=
"width=device-width, initial-scale=1"
/>
<title>Candidate details</title>
<link rel=
"stylesheet"
href=
"//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"
/>
<link rel=
"stylesheet"
href=
"/resources/demos/style.css"
/>
<script src=
"https://code.jquery.com/jquery-1.12.4.js"
></script>
<script src=
"https://code.jquery.com/ui/1.12.1/jquery-ui.js"
></script>
<script type=
"text/javascript"
src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></script>
<script src=
"http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js"
type=
"text/javascript"
></script>
<link href=
"http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script type=
"text/javascript"
>
$(
function
() {
$(
"[id*=ShowPopup1]"
).click(
function
() {
Name();
return
false
;
});
});
function
Name() {
$(
"#dialog"
).dialog({
width: 400,
modal:
true
});
}
$(
function
() {
$(
"#tabs"
).tabs();
});
$(document).ready(
function
() {
var
$submit = $(
"#submit_prog"
).hide(),
$cbs = $(
'input[name="prog"]'
).click(
function
() {
$submit.toggle( $cbs.is(
":checked"
) );
});
});
</script>
<style>
#GridView1,#GridView2 {
font-family: Segoe UI;
font-size: 10px;
}
#GridView1,#GridView2 {
font-family:
'Segoe UI'
;
border-collapse: collapse;
width: 80%;
font-size: 10px;
}
#GridView1 td, #GridView1 th, #GridView2 td, #GridView2 th {
border: 1px solid #ddd;
padding: 8px;
}
GridView1 tr:nth-child(even),GridView2 tr:nth-child(even) {
background-color: #f2f2f2;
}
#GridView1 th,#GridView2 th {
padding-top: 4px;
padding-bottom: 4px;
text-align: center;
background-color: cornflowerblue;
color: white;
}
</style>
</head>
<body>
<form runat=
"server"
>
<input type=
"submit"
id=
"submit_prog"
value=
'Send email'
style=
"font-family: 'Segoe UI'; font-size: 10px; text-align: center;"
/>
<div id=
"tabs"
>
<ul>
<li><a href=
"#tabs-1"
style=
"font-family: 'Segoe UI'; font-size: 10px; text-align: center; width: 80px;"
>Sophus IT solutions</a></li>
<li><a href=
"#tabs-2"
style=
"font-family: 'Segoe UI'; font-size: 10px; text-align: center; width: 80px;"
>Ceipal</a></li>
<%--<li><a href=
"#tabs-3"
style=
"font-family: 'Segoe UI'; font-size: 10px; text-align: center; width: 80px;"
>Monster</a></li>--%>
</ul>
<div id=
"tabs-1"
>
<asp:GridView ID=
"GridView1"
runat=
"server"
AutoGenerateColumns=
"false"
OnRowDataBound=
"OnRowDataBound"
>
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID=
"checkbox"
runat=
"server"
/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField=
"resumetoJDmatch"
HeaderText=
"Resume to JD match"
ItemStyle-Width=
"140"
/>
<asp:BoundField DataField=
"mandatoryskillmatch"
HeaderText=
"mandatory skill match"
ItemStyle-Width=
"100"
/>
<asp:BoundField DataField=
"Datecreated"
HeaderText=
"Date created"
ItemStyle-Width=
"90"
/>
<asp:HyperLinkField DataTextField=
"Name"
HeaderText=
"Name"
ItemStyle-Width =
"150"
DataNavigateUrlFields=
"mandatoryskillmatch"
DataNavigateUrlFormatString=
"~/WebForm1.aspx?Id={0}"
/>
<asp:BoundField DataField=
"phonenumber"
HeaderText=
"Phone number"
ItemStyle-Width=
"100"
/>
<asp:BoundField DataField=
"email"
HeaderText=
"E-mail"
ItemStyle-Width=
"90"
/>
<asp:BoundField DataField=
"location"
HeaderText=
"Location"
ItemStyle-Width=
"120"
/>
</Columns>
</asp:GridView>
<div id=
"dialog"
style=
"display: none"
>
<asp:GridView ID=
"GridView2"
runat=
"server"
AutoGenerateColumns=
"false"
OnPageIndexChanging=
"OnPageIndexChanging"
PageSize=
"1"
AllowPaging=
"true"
>
<Columns>
<asp:BoundField DataField=
"CustomerId"
HeaderText=
"Word resume (download)"
ItemStyle-Width=
"80"
/>
<asp:BoundField DataField=
"Name"
HeaderText=
"LinkedIn"
ItemStyle-Width=
"150"
/>
<asp:BoundField DataField=
"Country"
HeaderText=
"Digital resume"
ItemStyle-Width=
"150"
/>
<asp:BoundField DataField=
"SourceId"
HeaderText=
"Source"
ItemStyle-Width=
"80"
/>
<asp:BoundField DataField=
"Workauthorization"
HeaderText=
"Work authorization"
ItemStyle-Width=
"150"
/>
<asp:BoundField DataField=
"HRworked"
HeaderText=
"HR worked"
ItemStyle-Width=
"150"
/>
</Columns>
</asp:GridView>
</div>
<%-- <input type=
"checkbox"
name=
"prog"
value=
"1"
/>--%>
</div>
<div id=
"tabs-2"
>
</div>
<%-- <div id=
"tabs-3"
>
</div>--%>
</div>
</form>
</body>
</html>
Default.cs Page
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Web;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Data;
using
MySql.Data.MySqlClient;
using
System.Configuration;
namespace
Findcandidates
{
public
partial
class
_default : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!
this
.IsPostBack)
{
DataTable dt =
new
DataTable();
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"
) });
dt.Rows.Add(
"100%"
,
"90%"
,
"13-may-2019"
,
"Suresh Kumar"
,
"1234567890"
,
"
[email protected]
"
,
"san Jose,CA"
);
dt.Rows.Add(
"100%"
,
"90%"
,
"13-may-2019"
,
"Suresh Kumar"
,
"1234567890"
,
"
[email protected]
"
,
"san Jose,CA"
);
GridView1.DataSource = dt;
GridView1.DataBind();
}
if
(!
this
.IsPostBack)
{
this
.BindGrid();
}
}
private
void
BindGrid()
{
string
constr = ConfigurationManager.ConnectionStrings[
"constr"
].ConnectionString;
using
(MySqlConnection con =
new
MySqlConnection(constr))
{
using
(MySqlCommand cmd =
new
MySqlCommand(
"SELECT CustomerId, Name, Country,SourceId,Workauthorization,HRworked FROM Customers"
))
{
using
(MySqlDataAdapter sda =
new
MySqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using
(DataTable dt =
new
DataTable())
{
sda.Fill(dt);
GridView2.DataSource = dt;
GridView2.DataBind();
}
}
}
}
}
protected
void
OnPageIndexChanging(
object
sender, GridViewPageEventArgs e)
{
GridView2.PageIndex = e.NewPageIndex;
this
.BindGrid();
ClientScript.RegisterStartupScript(
this
.GetType(),
"Popup"
,
"ShowPopup();"
,
true
);
}
protected
void
OnRowDataBound(
object
sender, GridViewRowEventArgs e)
{
DataTable dt =
new
DataTable();
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"
) });
foreach
(GridViewRow row
in
GridView1.Rows)
{
if
(row.RowType == DataControlRowType.DataRow)
{
CheckBox checkbox = (row.Cells[0].FindControl(
"checkbox"
)
as
CheckBox);
if
(checkbox.Checked)
{
string
resumetoJDmatch = row.Cells[1].Text;
string
mandatoryskillmatch = row.Cells[2].Text;
string
Datecreated = row.Cells[3].Text;
string
Name = row.Cells[4].Text;
string
phonenumber = row.Cells[5].Text;
string
email = row.Cells[6].Text;
string
Location = row.Cells[7].Text;
dt.Rows.Add(resumetoJDmatch, mandatoryskillmatch, Datecreated, Name, phonenumber, email, Location);
}
}
}
}
}
}
Webform1.aspx
<%@ Page Language=
"C#"
AutoEventWireup=
"true"
CodeBehind=
"WebForm1.aspx.cs"
Inherits=
"Findcandidates.WebForm1"
%>
<!DOCTYPE html>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head runat=
"server"
>
<title></title>
<script type=
"text/javascript"
src=
"http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"
></script>
<script src=
"http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js"
type=
"text/javascript"
></script>
<link href=
"http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/start/jquery-ui.css"
rel=
"stylesheet"
type=
"text/css"
/>
<script type=
"text/javascript"
>
$(
function
() {
$(
"[id*=ShowPopup1]"
).click(
function
() {
Name();
return
false
;
});
});
function
Name() {
$(
"#dialog"
).dialog({
width: 400,
modal:
true
});
}
</script>
<style>
#GridView2 {
font-family: Segoe UI;
font-size: 10px;
}
#GridView2 {
font-family:
'Segoe UI'
;
border-collapse: collapse;
width: 80%;
font-size: 10px;
}
#GridView2 td, #GridView2 th {
border: 1px solid #ddd;
padding: 8px;
}
GridView2 tr:nth-child(even) {
background-color: #f2f2f2;
}
#GridView2 th {
padding-top: 4px;
padding-bottom: 4px;
text-align: center;
background-color: cornflowerblue;
color: white;
}
</style>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<asp:HyperLink ID=
"ShowPopup1"
runat=
"server"
Text=
"Name"
></asp:HyperLink>
<div id=
"dialog"
style=
"display: none"
>
<asp:GridView ID=
"GridView2"
runat=
"server"
AutoGenerateColumns=
"false"
OnPageIndexChanging=
"OnPageIndexChanging"
PageSize=
"1"
AllowPaging=
"true"
>
<Columns>
<asp:BoundField DataField=
"CustomerId"
HeaderText=
"Word resume (download)"
ItemStyle-Width=
"80"
/>
<asp:BoundField DataField=
"Name"
HeaderText=
"LinkedIn"
ItemStyle-Width=
"150"
/>
<asp:BoundField DataField=
"Country"
HeaderText=
"Digital resume"
ItemStyle-Width=
"150"
/>
<asp:BoundField DataField=
"SourceId"
HeaderText=
"Source"
ItemStyle-Width=
"80"
/>
<asp:BoundField DataField=
"Workauthorization"
HeaderText=
"Work authorization"
ItemStyle-Width=
"150"
/>
<asp:BoundField DataField=
"HRworked"
HeaderText=
"HR worked"
ItemStyle-Width=
"150"
/>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</html>
Webform1.cs
using
MySql.Data.MySqlClient;
using
System;
using
System.Configuration;
using
System.Data;
using
System.Web.UI.WebControls;
namespace
Findcandidates
{
public
partial
class
WebForm1 : System.Web.UI.Page
{
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!
this
.IsPostBack)
{
this
.BindGrid();
}
}
private
void
BindGrid()
{
string
constr = ConfigurationManager.ConnectionStrings[
"constr"
].ConnectionString;
using
(MySqlConnection con =
new
MySqlConnection(constr))
{
using
(MySqlCommand cmd =
new
MySqlCommand(
"SELECT CustomerId, Name, Country,SourceId,Workauthorization,HRworked FROM Customers"
))
{
using
(MySqlDataAdapter sda =
new
MySqlDataAdapter())
{
cmd.Connection = con;
sda.SelectCommand = cmd;
using
(DataTable dt =
new
DataTable())
{
sda.Fill(dt);
GridView2.DataSource = dt;
GridView2.DataBind();
}
}
}
}
}
protected
void
OnPageIndexChanging(
object
sender, GridViewPageEventArgs e)
{
GridView2.PageIndex = e.NewPageIndex;
this
.BindGrid();
ClientScript.RegisterStartupScript(
this
.GetType(),
"Popup"
,
"ShowPopup();"
,
true
);
}
}
}
Reply
Answers (
1
)
in my sql 2019 ssms not active debug option plz solve this
Where can I refer to develop a chatbot for Whatsapp?