473,419 Members | 4,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

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

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("po****@xxx.com",
"Portal XX.com")
Dim MyMailTo As New Net.Mail.MailAddress("in**@xxx.com")
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("po****@xxx.com",
"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.Ne t.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.HtmlEnco de(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!!!
Dec 12 '05 #1
3 1730
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.

"TCB" <tc******@hotmail.com> wrote in message
news:O0**************@TK2MSFTNGP10.phx.gbl...
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("po****@xxx.com",
"Portal XX.com")
Dim MyMailTo As New Net.Mail.MailAddress("in**@xxx.com")
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("po****@xxx.com", "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.Ne t.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.HtmlEnco de(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!!!

Dec 12 '05 #2
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
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
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.

"TCB" <tc******@hotmail.com> wrote in message
news:O0**************@TK2MSFTNGP10.phx.gbl...
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("po****@xxx.com",
"Portal XX.com")
Dim MyMailTo As New Net.Mail.MailAddress("in**@xxx.com")
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("po****@xxx.com", "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.Ne t.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.HtmlEnco de(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!!!


Dec 12 '05 #3
You'll have to be more specific about the cookie problem. In our original
post you said:
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.

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.

"TCB" <tc******@hotmail.com> wrote in message
news:O7**************@tk2msftngp13.phx.gbl... 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
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
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.

Dec 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Aryeh M. Friedman | last post by:
If have something like the following declartion: enum foo {One,Two,....,Ten}; How do I determine how many elements (enumerations)... in this case it is obviously 10 but I don't want to hard...
4
by: Silas | last post by:
Hi, I use view to join difference table together for some function. However, when the "real" table fields changed (e.g. add/delete/change field). The view table still use the "old fields". ...
30
by: bblais | last post by:
Hello, Let me start by saying that I am coming from a background using Matlab (or Octave), and C++. I am going to outline the basic nuts-and-bolts of how I work in these languages, and ask for...
5
by: engsolnorm | last post by:
I'm playing with a sudoku GUI...just to learn more about python. I've made 81 'cells'...actually small canvases Part of my scheme to write the cells (all 81 of them in the gui) to a file (using...
71
by: Jack | last post by:
I understand that the standard Python distribution is considered the C-Python. Howerver, the current C-Python is really a combination of C and Python implementation. There are about 2000 Python...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.