T
TCB
Hi,
There are a couple of things that are bothering me, any help on these is
greatly appreciated. This is using ASP.NET 2.0
1. I am sending email in my web app, using a simple form here is the code:
Dim MyMailFrom As New Net.Mail.MailAddress("(e-mail address removed)",
"Portal XX.com")
Dim MyMailTo As New Net.Mail.MailAddress("(e-mail address removed)")
Dim MyMail As New Net.Mail.MailMessage(MyMailFrom, MyMailTo)
Dim MySMTP As New Net.Mail.SmtpClient("mail.xxx.com")
MyMail.Subject = "Web Contact"
MyMail.IsBodyHtml = True
MyMail.Priority = Net.Mail.MailPriority.High
MyMail.Body = "All the fields entered in the form"
MySMTP.Credentials = New Net.NetworkCredential("(e-mail address removed)",
"myacctpwd")
Try
MySMTP.Send(MyMail)
Catch ex As Exception
End Try
This work well in my development computer but when I publish the site to a
remote server (that has .NET 2.0 and IIS) it gives me this error:
Method not found: 'Void
System.Net.Mail.MailMessage.set_Priority(System.Net.Mail.MailPriority)'
2. When a user returns to my site, I tried to read a cookie, this code
worked OK in .NET 1.1, basically it is the same, but then again, it only
works in my development machine, not in the web server the site gets
published to, here is the code (this code exists in Global.asax SessionStart
Event)
If Not Request.Cookies("SCCountry") Is Nothing Then
Session.Add("IdPais",
CType(Server.HtmlEncode(Request.Cookies("SCCountry")("Pais")), Integer))
Else
If Session("IdPais") <> 1 And Session("IdPais") <> 2 Then
Response.Redirect("SelCountry.aspx?RedirPage=" &
Request.Url.AbsoluteUri)
End If
End If
Dim SUserLogin As SC.Objects.Usuario.s_SessionUser
If Not Request.Cookies("SCUser") Is Nothing Then
SUserLogin =
SC.Objects.Usuario.LoginFromCookie(Server.HtmlEncode(Request.Cookies("SCUser")("Email")),
Server.HtmlEncode(Request.Cookies("SCUser")("Code")))
If SUserLogin.ID > 0 Then
Session("LoggedIn") = True
Session("User") = SUserLogin
Session("UserName") = SUserLogin.NombreCompleto
End If
SUserLogin = Nothing
End If
I appears that in the web server this cookie is not being read at all, i can
see the cookie stores in the client computer by manually going to where
cookies are stored but nothing happens when i visit the page.
TIA!!!
There are a couple of things that are bothering me, any help on these is
greatly appreciated. This is using ASP.NET 2.0
1. I am sending email in my web app, using a simple form here is the code:
Dim MyMailFrom As New Net.Mail.MailAddress("(e-mail address removed)",
"Portal XX.com")
Dim MyMailTo As New Net.Mail.MailAddress("(e-mail address removed)")
Dim MyMail As New Net.Mail.MailMessage(MyMailFrom, MyMailTo)
Dim MySMTP As New Net.Mail.SmtpClient("mail.xxx.com")
MyMail.Subject = "Web Contact"
MyMail.IsBodyHtml = True
MyMail.Priority = Net.Mail.MailPriority.High
MyMail.Body = "All the fields entered in the form"
MySMTP.Credentials = New Net.NetworkCredential("(e-mail address removed)",
"myacctpwd")
Try
MySMTP.Send(MyMail)
Catch ex As Exception
End Try
This work well in my development computer but when I publish the site to a
remote server (that has .NET 2.0 and IIS) it gives me this error:
Method not found: 'Void
System.Net.Mail.MailMessage.set_Priority(System.Net.Mail.MailPriority)'
2. When a user returns to my site, I tried to read a cookie, this code
worked OK in .NET 1.1, basically it is the same, but then again, it only
works in my development machine, not in the web server the site gets
published to, here is the code (this code exists in Global.asax SessionStart
Event)
If Not Request.Cookies("SCCountry") Is Nothing Then
Session.Add("IdPais",
CType(Server.HtmlEncode(Request.Cookies("SCCountry")("Pais")), Integer))
Else
If Session("IdPais") <> 1 And Session("IdPais") <> 2 Then
Response.Redirect("SelCountry.aspx?RedirPage=" &
Request.Url.AbsoluteUri)
End If
End If
Dim SUserLogin As SC.Objects.Usuario.s_SessionUser
If Not Request.Cookies("SCUser") Is Nothing Then
SUserLogin =
SC.Objects.Usuario.LoginFromCookie(Server.HtmlEncode(Request.Cookies("SCUser")("Email")),
Server.HtmlEncode(Request.Cookies("SCUser")("Code")))
If SUserLogin.ID > 0 Then
Session("LoggedIn") = True
Session("User") = SUserLogin
Session("UserName") = SUserLogin.NombreCompleto
End If
SUserLogin = Nothing
End If
I appears that in the web server this cookie is not being read at all, i can
see the cookie stores in the client computer by manually going to where
cookies are stored but nothing happens when i visit the page.
TIA!!!