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
Yasin Kızıltaş
NA
57
4.7k
How to alert message before Response.redirect? or other way
Oct 15 2018 4:41 AM
I have a button on my update page. This button redirects and refreshes the page after sending sms
I want that;
If the user pushes the button and sends sms 1 time, do not press the same button 2 times unless the page is closed.
In fact, I installed the structure, but because the button response is redirect, my page refreshes every time and never falls into the following else. How can I solve this?
Response redirect(in controller)
public
void
SMSGonder(
int
flowId)
{
flow flow = db.flow.Find(flowId);
string meetingDate =
""
;
foreach (
var
item
in
db.sp_get_meeting(flowId))
{
meetingDate = item.meetingDate.ToString(
"dd.MM.yyyy HH:mm"
);
}
DakikSMSMesajGonder2(flow.flowPhone.ToString(), flow.flowName, meetingDate,
null
);
Response.Redirect(
"~/flows/Edit?id="
+ flowId);
}
href button;
<
div
class
=
"col-md-4"
>
<
a
class
=
"btn btn-default"
id
=
"sms"
href
=
"/flows/
[email protected]
"
>
Sent SMS
</
a
>
</
div
>
and JQuery;
$(
"#sms"
).click(
function
() {
var
$foo = $(
this
);
if
(!$foo.data(
'clicked'
))
{
alert(
"SMS sent successfully!"
);
}
else
{
alert(
"You've already sent this sms."
);
}
$foo.data(
'clicked'
,
true
);
});
Reply
Answers (
7
)
Image Animations
BootStrap treeview using Json sharepoint custom webpart