Click here to Skip to main content
15,942,710 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an application where pop up should open after sendMail() get executed. I am new to asp.net so forgive me for asking this, but I really need help. It would be better if code is written code-behind file.
Thank you
Posted

It's so easy to popup successful message after sending email.

Response.Write("<script>alert('Email sent Successfully')</script>");

Thanx.......:-)
 
Share this answer
 
v2
Comments
[no name] 9-Oct-13 5:00am    
But background become invisible as long as pop up is shown plus it gives warning symbols instead of info....
Thanks
Chintan Desai1988 9-Oct-13 5:02am    
so what you actual want tell me then wll send you proper code again if you dnt mind
[no name] 9-Oct-13 5:11am    
Sorry to trouble you sir, I have a gridview on asp.net page and I have placed a button there to send email, for this I implemented sendEmail() method, its workinf fine, but I want to show confirmation to user that his/her mail is sent successfully. I need to show it using pop-up, its symbol should be info(i) and background page should be visible while pop-up is on screen.
Thanks
Chintan Desai1988 9-Oct-13 5:14am    
so can you send me ur code plz if u dnt mind them will do correction as per ur requirement
[no name] 9-Oct-13 5:23am    
if (e.CommandName == "SendMail") { long pId = Convert.ToInt64(e.CommandArgument); SendMail(pId); Response.Write("<script type='text/javascript'>"); Response.Write("alert('Email sent successfully.');"); Response.Write("</script>"); }
C#
Response.Write("<script type='text/javascript'>");
Response.Write("alert('Email sent successfully.');");            
Response.Write("</script>");

Write this just after sending mail completes. This will go inside your code behind.

Regards..
 
Share this answer
 
Comments
[no name] 9-Oct-13 4:50am    
Thank you very much, This worked !!! :) but as long as pop up remains on screen, background page becomes invisible, any trick for that
Thanks7872 9-Oct-13 4:53am    
In that case you have many options with JQuery,AJAX etc. In your case,it will be more appropriate to call it alert than popup. This is just to inform user about something.
[no name] 9-Oct-13 4:55am    
its also giving warning symbol instead information, please mention any ajax option. Thanks
Thanks7872 9-Oct-13 5:10am    
http://jqueryui.com/dialog/

http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx
[no name] 9-Oct-13 5:23am    
Ajax control will open as button is clicked, but even if button is clicked and email sending is failed because of any reason, then still pop-up will display.. which will be a wrong implementation... and for jquery, it looks nice, but can you please tell me how to execute its code next to sendMail(), as you did with javascript in your answer, Thanks

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