Adnan Ali

Adnan Ali

  • NA
  • 2
  • 1.3k

my Booking Form This Show Server Error in Application.

Sep 16 2015 10:13 AM
Plz Help Urgent
 
 

web site link http://www.dehraduntaxihire.com/

It is showing me following error on the page

 

C# Page Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Data.SqlClient;
using System.Text;
using System.IO;
public partial class inquiry : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void sbt_Click(object sender, EventArgs e)
{
StringBuilder mailcontent2 = new StringBuilder("<div style='width: 600px; background-color :#ffffff;font-family :Arial;'><center><h3>Query | Dehradun Taxi Hire</h3></center>");
mailcontent2.Append("<table width='800' align='center' style='background-color:#ffffff; color:#000000;' border='1px'>");
mailcontent2.Append("<tr><td><font size='2'>Name </td> <td><font size='2'> " + txt1.Text + " </font></td> </tr>");
mailcontent2.Append("<tr><td><font size='2'>Period </td> <td><font size='2'>From " + TextBox1.Text + " </font></td> </tr>");
mailcontent2.Append("<tr><td><font size='2'>Phone </td> <td><font size='2'> " + TextBox2.Text + " </font></td> </tr>");
mailcontent2.Append("<tr><td><font size='2'>Message</font></td> <td><font size='2'> " + TextBox3.Text + " </font></td> </tr> </table> ");
System.Net.Mail.MailMessage mailMessage2 = new System.Net.Mail.MailMessage(TextBox1.Text, "[email protected]");
mailMessage2.Body = Convert.ToString(mailcontent2);
mailMessage2.Subject = "Dehradun Taxi Hire - Inquiry";
mailMessage2.IsBodyHtml = true;
System.Net.Mail.SmtpClient mailClient3 = new System.Net.Mail.SmtpClient();
System.Net.NetworkCredential basicAuthenticationInfo2 = new System.Net.NetworkCredential("[email protected]", "i(Zzx%IdK{5");
mailClient3.Host = "216.224.185.13";
mailClient3.UseDefaultCredentials = false;
mailClient3.Credentials = basicAuthenticationInfo2;
mailClient3.Send(mailMessage2);
string strScript = "alert('Thank you for your inquiry; we will get back to you within 12 hours.');";
Page.ClientScript.RegisterStartupScript(this.GetType(), "alertBox", strScript, true);
}
}

Aspx Page Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="inquiry.aspx.cs" Inherits="inquiry" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:TextBox ID="txt1" runat="server" CssClass="form-control" placeholder="Name"></asp:TextBox><br/>
<asp:TextBox ID="TextBox1" runat="server" CssClass="form-control" placeholder="E-mail"></asp:TextBox><br/>
<asp:TextBox ID="TextBox2" runat="server" CssClass="form-control" placeholder="Phone"></asp:TextBox><br/>
<asp:TextBox ID="TextBox3" runat="server" CssClass="form-control" placeholder="Your Message" TextMode="MultiLine"></asp:TextBox><br/>
<asp:Button ID="sbt" runat="server" Text="SUBMIT" OnClick="sbt_Click" />
</form>
</body>
</html>
1
2
3
4
5
6
7
Html Page
<span style=""background-color:" #ff0000;"=""><strong><script type="text/javascript">
var iframesrc1="inquiry.aspx"
document.write('<iframe id="test" src="'+iframesrc1+'" width="280px" height="150px" border="0px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')
</script>
 

Answers (1)