Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: system mailing dropdown
i received this error when populating the dropdownlist. any suggestion pls?
 
System.Web.UI.WebControls.DropDownList
 
the scenario is, a user is sending information from a c# page and will send it to the email provided.
 
heres the code:
 
protected void btnSubmit_Click(object sender, EventArgs e)
{
    try
    {
        MailMessage Msg = new MailMessage();
        Msg.From = txtEmail.Text;
        Msg.To = txtTo.Text;
        Msg.Subject = txtSubject.Text;
        Msg.Body = "Name:" + txtFrom.Text + "Department:" + drpDep.Text;
 
        SmtpMail.SmtpServer = "mail.domain.com";
        SmtpMail.Send(Msg);
        Msg = null;
        //Page.RegisterStartupScript("UserMsg", "<script>alert('Mail sent thank you...');if(alert){ window.location='/ETC/';}</script>");
        Response.Redirect("../Confirmation.aspx");
    }
    catch (Exception ex)
    {
        Console.WriteLine("{0} Exception caught.", ex);
    }
}
Posted 13-Nov-12 21:19pm
Comments
E.F. Nijboer at 14-Nov-12 5:44am
   
System.Web.UI.WebControls.DropDownList is not a exception message. The given code also looks completely unrelated. It would make sense populating the DropDownList goes wrong in the coce actually populating it, this code seems completely unrelated.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Thanks for your reply. I got the solution for this, i missed to include .text with the other controls. cheers!
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 518
1 OriginalGriff 459
2 ChintanShukla 305
3 Richard Deeming 250
4 RyanDev 210
0 Sergey Alexandrovich Kryukov 8,901
1 OriginalGriff 7,571
2 CPallini 2,603
3 Richard MacCutchan 2,095
4 Abhinav S 1,893


Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100