Log in

View Full Version : Sending (Page.IsPostBack) as email result



jianxin9
03-27-2008, 09:26 PM
Hi everyone,
I have a quiz and when you click submit, the user receives quiz results via a results page as well as an email of their quiz results to the address they supply. The quiz results on the results page is really what I want to the user to get in the email. Any idea on how to do this?

Currently, it sending this type of result to the user:
Julie has scored: 7 out of 7.. Julie`s options were: 1. Option 3 2. Option 5 3. Option 3 4. Option 1 5. Option 6 6. Option 2 7. Option 3

The results on the results page are a lot more detailed and this is what I want the user to get in their email.

This is the code in place for the email results:

// Create the email body text
String bodyInfo = fname.Text+" "+lname.Text+" has taken the exam.\n"+fname.Text +" has scored: "+score+" out of 7..\n"+fname.Text +"`s options were: \n 1. Option "+(q1.SelectedIndex+1)+"\n 2. Option "+(q2.SelectedIndex+1)+"\n 3. Option "+(q3.SelectedIndex+1)+"\n 4. Option "+(q4.SelectedIndex+1)+"\n 5. Option "+(q5.SelectedIndex+1)+"\n 6. Option "+(q6.SelectedIndex+1)+"\n 7. Option "+(q7.SelectedIndex+1);

and in the code in place for the post back (results page)

// Send the user to the Results page
Response.Redirect("results.aspx?fname="+fname.Text+"&lname="+lname.Text+"&score="+percent+"&q1="+(q1.SelectedIndex)+"&q2="+(q2.SelectedIndex)+"&q3="+(q3.SelectedIndex)+"&q4="+(q4.SelectedIndex)+"&q5="+(q5.SelectedIndex)+"&q6="+(q6.SelectedIndex)+"&q7="+(q7.SelectedIndex));

jianxin9
03-28-2008, 09:17 PM
problem has been resolved