This topic is locked

Stop E-mail display details on Add page

5/18/2009 2:22:42 AM
ASPRunnerPro General questions
Stu author

On my Add Record Page, after the record is added I send two e-mail's for different puposes. The e-mail text displays itself on my Edit Page. How do I stop it happening?
I guess I could simply do a redirect to the previous page, a list page, and display a pop-up "Record Added". I wonder how I might do that. I guess I can set a Session Variable after the record is added like Session("Added")=-1 and then pick it up on the List page. On what event in the list page would I pick it up and output "Record Added".
I'd still like to know how I prevent the e-mail text from appearing on the Add Record page though.
Regards,
Stu

Stu author 5/18/2009

I solved this myself and include some code ideas for anyone who wants an idea.
I went around the problem of e-mail being displayed and went for the setting of a Session flag and a Redirect.
"After Record Added" I included this code
[codebox]Session("ADDED")=-1
Response.Redirect SESSION("CWEB") & "WebChat_list.asp?a=return"[/codebox]
(Note "CWEB" is the url address of my web server root in case I move the project to another web server)
On the List Page "Before Record Procesed" I checked for the "ADDED" flag
[codebox]if Session("ADDED")=-1 then
Response.Write "<script>alert('New Discussion Item Added')</script>"

Session("ADDED")=0

end if[/codebox]
Although the event runs for each record in the list the code only fires for the first time if set.
Works very nicely.
Regards,
Stu

R
RASM 6/23/2009

Response.Write "<script>alert('New Discussion Item Added')</script>"
This doesn´t work......

J
Jane 6/25/2009

Hi,
where do you add this code?

jtksmith 6/26/2009

Stu,
I know its been a while since you posted this topic an information but I just got it to work and think it is GREAT!
Thank you for your helpful contribution.