Things only work in development machine not in "REAL" web server

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!!!
 
K

Kevin Spencer

Check the version number of the .Net Framework 2.0 on your local machine and
on the server. It sounds like they are not exactly the same.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
T

TCB

Thank you, that seems to fix the Email sending problem, but the cookie
problem still persists, do i have to do something in particular so that
cookies work with my web app?

Thanks
 
K

Kevin Spencer

You'll have to be more specific about the cookie problem. In our original
post you said:

What exactly do you mean by "nothing happens?" Obviously, something happens.
So, can you describe what does happen, what should happen, and what the
problem is? A URL would help also.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top