0

我正在使用一个名为 Pretty Photo 的 Jquery 灯箱解决方案。我在灯箱中打开一个表单,让用户单击发送电子邮件的提交按钮。单击该按钮时,我可以正常收到电子邮件,但其中没有任何信息。有人可以帮忙吗?我的代码在下面,用于 ASPX 和 ASPX.CS

登陆页面.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("vdecapite@associatedestates.com");
        //Configure the address we are sending the mail from
        MailAddress address = new MailAddress("vdecapite@associatedestates.com");
        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("vdecapite@associatedestates.com", "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.";
    }
}
    }

            }

登陆页面.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>
4

1 回答 1

0

jquery lightbox 是否在内容周围添加表单标签?如果是这样,您将拥有嵌套表单,即表单内的表单。嵌套表单不是 html 投诉,并且会表现得很有趣。因此,请确保您没有嵌套的表单标签。

希望这可以帮助

于 2013-05-09T20:42:02.027 回答