Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 12th, 2003, 02:20 PM
Registered User
 
Join Date: Aug 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default lose values upon submit

I am developing a web page that I can receive resume through.
when a user is done with inputting the value, the preview page reads value from the database, and upon the submit, it should email me all the values.
However, when I get it, all I see is blank values.
If I insert a text box at the end, and type a value to it, I receive the value on my email.
it seems the page is not sending me the values that are stored on the server side. It onlu sends me the values on my browser side.
please help.
because of this problem, I could not update the user information either. because user could read the information from the database, but when update, it was saving the old value back.
thank you


<code>
public void Page_Load(object sender, System.EventArgs e)
            {

 if (IsLoggedIn())
                {
   // string email=Request.Cookies["email"].Value;
    lblEmail.Text=Request.Cookies["email"].Value;

                    NurseDetails myNurseDetails = new NurseDetails();
                    Nurse obj = new Nurse();

                    myNurseDetails = obj.GetNurseDetails(Request.Cookies["email"].Value);


lblGivenName.Text = myNurseDetails.givenname;

lblFamilyName.Text =myNurseDetails.familyname;
                obj = null;


           }


 else
 {

 Response.Redirect("login.Aspx");

 }


           }




 public static bool IsLoggedIn()
     {
         HttpContext ctx = HttpContext.Current;

         if (ctx.Request.Cookies["email"] == null ||
             ctx.Request.Cookies["email"].Value == "")
             return false;
         else
             return true;
     }


        public class NurseDetails
        {

    public string emailAddress;
       public string givenname;
           public string familyname;

    }


     public class Nurse
        {
            public Nurse()
            {
            }

          public NurseDetails GetNurseDetails(string strEmail)
        {
            // Create Instance of Connection and Command Object
            SqlConnection myConnection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
            SqlCommand myCommand = new SqlCommand("sp_resume_preview", myConnection);


             myCommand.CommandType = CommandType.StoredProcedure;

            // Add Parameters to SPROC
            SqlParameter prmemail = new SqlParameter("@emailAddress", SqlDbType.VarChar, 255);
            prmemail.Value = strEmail;
            myCommand.Parameters.Add(prmemail);

            SqlParameter prmgivenname = new SqlParameter("@givenname", SqlDbType.VarChar, 255);
            prmgivenname.Direction = ParameterDirection.Output;
            myCommand.Parameters.Add(prmgivenname);

            SqlParameter prmfamilyname = new SqlParameter("@familyname", SqlDbType.VarChar, 255);
            prmfamilyname.Direction = ParameterDirection.Output;
            myCommand.Parameters.Add(prmfamilyname);


 myConnection.Open();
            myCommand.ExecuteNonQuery();
            myConnection.Close();

 NurseDetails myNurseDetails = new NurseDetails();
 myNurseDetails.emailAddress =prmemail.Value.ToString();
 myNurseDetails.givenname =prmgivenname.Value.ToString();
 myNurseDetails.familyname =prmfamilyname.Value.ToString();

     return myNurseDetails;



    }




 }


void Button1_Click(object sender, EventArgs e) {




// Build a MailMessage
System.Web.Mail.MailMessage mailMessage = new System.Web.Mail.MailMessage();
mailMessage.From =lblEmail.Text;
mailMessage.To = "";
//mailMessage.Cc = "";
mailMessage.Subject = "Online Job Application";
mailMessage.BodyFormat = System.Web.Mail.MailFormat.Text;

// TODO: Set the mailMessage.Body property
mailMessage.BodyFormat = MailFormat.Html;



string test="<p>First Name: "+ Request.Form["lblGivenName"]+"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Last Name : "+Request.Form["lblFamilyName"];







//////////////////////////

//////////////////////////
mailMessage.Body =test;

//////////////////////////
//mailMessage.Body =txtMessage;
//Response.Write("aftertext");

System.Web.Mail.SmtpMail.SmtpServer = "";
//Response.Write("aftersmtp");

System.Web.Mail.SmtpMail.Send(mailMessage);
 //Response.Write("aftersend");

 Response.Redirect("resume_confirm.aspx");

}

</code>






Similar Threads
Thread Thread Starter Forum Replies Last Post
SOS: Retain values on Submit in Textfield,Dropdown rabbit124 Classic ASP Professional 1 March 7th, 2006 07:12 PM
Listbox Selected values to be displayed on Submit dom1975 C# 0 September 17th, 2005 04:29 AM
DTSGlobalVar lose its value in VBScript willi SQL Server DTS 2 August 29th, 2005 03:26 PM
Help! At a lose: SQL and VB xgbnow Pro VB Databases 2 June 9th, 2004 10:12 PM
Why do I lose 0 Zero's when calculating? easybee Classic ASP Databases 1 December 18th, 2003 12:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.