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
Vignesh Kumar
NA
1k
418.1k
Close current window in asp.net without any confirmation
Dec 21 2018 3:42 AM
Hi,
I'm new to asp.net and trying to close current tab after button click without asking for any confirmation.
Can anyone pls help me out and below is the code I'm using.
protected
void
btn_Click(
object
sender, ImageClickEventArgs e)
{
string
strURL =
string
.Empty;
strURL =
"Nav.aspx?ID="
+ strID;
strURL =
"window.open('"
+ strURL +
"');"
;
ScriptManager.RegisterStartupScript(
this
,
this
.GetType(),
"pop"
, strURL,
true
);
ScriptManager.RegisterStartupScript(
this
.Page,
this
.GetType(),
"text"
,
"Close()"
,
true
);
}
I tried below piece of code and it asks for confirmation. How can I close the window without confirmation prompt message?
<script type=
"text/JavaScript"
lang=
"JavaScript"
>
function
Close()
{
window.close();
}
</script>
A confirmation box shows up and it shouldn't come and the current window should be closed automatically upon button click.
Reply
Answers (
1
)
Web cam dll for windows 10 Home edition
Not able to perform sikuli.Click() using sikuli4net in C#