Error: A connection attempt failed

hi

i have a button and on its click i have written one line which is
response.redirect("home.aspx")

Now on local everything works fine but when i upload it on server then it shows error. The page is not even transferred to "home.aspx"
the error is :

 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 75.125.56.238:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Please help me..
LVL 6
badalpatelAsked:
Who is Participating?
 
GiftsonDJohnConnect With a Mentor Commented:
Why the page is being attempting connection to the port 25. (75.125.56.238:25 )

It is commonly used for SMTP services. Are you using any SMTP services in your application. If so then check whether your sever has access to the server. A firewall settings can block the network.
0
 
VikramMullickCommented:
try
response.redirect("home.aspx",false)
0
 
badalpatelAuthor Commented:
not worked.
the above code works in local environment. and it shows error on online server where  i deployed the application
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
VikramMullickCommented:
ping the webserver , check , whether you are getting any response.
Are you using any log file , check the file.
0
 
vs1784Connect With a Mentor Commented:
You must be sending email from the button click or any oterh event.

Comment it and try.
0
 
Anurag ThakurConnect With a Mentor Technical ManagerCommented:
can you share the stack trace
it might be useful to see which line is the culprit line
0
 
badalpatelAuthor Commented:
Thanks for your comments

Actully previously i was sending an email on button click. But once this error comes i have comment out my whole code which was written on button click..But somehow i am still getting this error.
I have mailed to hosting server to check this out.
Do you guys think this is hosting server problem rather then code problem??

i have copy the stack trace below but i think it doesnt help much here
 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 75.125.56.238:25
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 75.125.56.238:25
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
[SocketException (0x274c): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 75.125.56.238:25]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +239
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +35
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +224
 
[WebException: Unable to connect to the remote server]
   System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +5421675
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +202
   System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +332
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +160
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +159
   System.Net.Mail.SmtpClient.GetConnection() +35
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1213
 
[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1531
   CommonMethods.sendMail(MailMessage mail) +246
   solutionRoom.sendMail(String ProjectID) +610
   solutionRoom.btnSubmitSolution_Click(Object sender, ImageClickEventArgs e) +97
   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +108
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +118
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Open in new window

0
 
GiftsonDJohnCommented:
Still the function CommonMethods.sendMail is called from the event btnSubmitSolution_Click. Please compile the code again.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.