2013-04-02 72 views
0

我正在使用名爲Pretty Photo的jquery lightbox解決方案。我在燈箱中打開一個表單,並讓用戶單擊發送電子郵件的提交按鈕。點擊按鈕後,我收到的電子郵件沒有問題,但沒有任何信息。是否有人可以幫助?我的代碼是下面的ASPX和ASPX.CSJquery PrettyPhoto提交按鈕

LandingPage.ASPX.CS

 public partial class LandingPage : WebBasePage 
{ 


     protected void btnSubmit_Click(object sender, EventArgs e) 
{ 
    try 
    { 
     //Create the msg object to be sent 
     MailMessage msg = new MailMessage(); 
     //Add your email address to the recipients 
     msg.To.Add("[email protected]"); 
     //Configure the address we are sending the mail from 
     MailAddress address = new MailAddress("[email protected]"); 
     msg.From = address; 
     //Append their name in the beginning of the subject 
     msg.Subject = txtName.Text + " : " + ddlSubject.Text; 
     msg.Body = txtMessage.Text + " : " + txtName.Text; 

     //Configure an SmtpClient to send the mail. 
     SmtpClient client = new SmtpClient("smtp.aecrealty.com"); 
     client.EnableSsl = false; //only enable this if your provider requires it 
     //Setup credentials to login to our sender email address ("UserName", "Password") 
     NetworkCredential credentials = new NetworkCredential("[email protected]", "Vpdc05141989"); 
     client.Credentials = credentials; 

     //Send the msg 
     client.Send(msg); 

     //Display some feedback to the user to let them know it was sent 
     lblResult.Text = "Your message was sent!"; 

     //Clear the form 
     txtName.Text = ""; 
     txtMessage.Text = ""; 
    } 
    catch 
    { 
     //If the message failed at some point, let the user know 
     lblResult.Text = "Your message failed to send, please try again."; 
    } 
} 
    } 

      } 

LandingPage.ASPX

<a href="#inline-1" rel="prettyPhoto" >TEST</a> 
<div id="inline-1" class="hide"> 
     <table> 
     <!-- Name --> 
     <tr> 
      <td align="center"> 
       Name:</td> 
      <td> 
       <asp:TextBox ID="txtName" 
           runat="server" 
           Columns="50"></asp:TextBox> 
      </td> 
     </tr> 

     <!-- Subject --> 
     <tr> 
      <td align="center"> 
       Subject: 
      </td> 
      <td> 
       <asp:DropDownList ID="ddlSubject" runat="server"> 
        <asp:ListItem>Ask a question</asp:ListItem> 
        <asp:ListItem>Report a bug</asp:ListItem> 
        <asp:ListItem>Customer support ticket</asp:ListItem> 
        <asp:ListItem>Other</asp:ListItem> 
       </asp:DropDownList> 
      </td> 
     </tr> 

     <!-- Message --> 
     <tr> 
      <td align="center"> 
       Message: 
      </td> 
      <td> 
       <asp:TextBox ID="txtMessage" 
           runat="server" 
           Columns="40" 
           Rows="6" 
           TextMode="MultiLine"></asp:TextBox> 
      </td> 
     </tr> 

     <!-- Submit --> 
     <tr align="center"> 
      <td colspan="2"> 
       <asp:Button ID="btnSubmit" runat="server" Text="Submit" 
        onclick="btnSubmit_Click" UseSubmitBehavior="false"/> 
      </td> 
     </tr> 

     <!-- Results --> 
     <tr align="center"> 
      <td colspan="2"> 
       <asp:Label ID="lblResult" runat="server"></asp:Label> 
      </td> 
     </tr> 
    </table> 
</div> 
+0

任何人都可以提供任何指導? – vpd05141989

回答

0

是否jQuery的燈箱周圍添加一個表單標籤內容?如果是這樣,你將有嵌套形式,即形式在表單內。嵌套表單不是html投訴,會表現得很有趣。所以確保你沒有嵌套的表單標籤。

希望這有助於