Go back to previous page
-
Hello everyone, I have webpage1 that sends email when button1 is click. I want to go back to previous page once button1 is click so I use history.back code. Below is my sample code for your reference. If Page.IsValid And SaveIssue() Then Dim msg As New MailMessage msg.To = Test@dc.com msg.From = "ACSC@noreply.com" msg.Subject = "Reply- " & txtTitle.Text msg.Body = "Hello" msg.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "abc.com" SmtpMail.Send(msg) msg = Nothing btnDone.Attributes.Add("onClick", "history.back(); return false;" End If My problem is, it will only work on the second time you will click button1. Kindly advise for the right code. Thanks in advance.
-
Hello everyone, I have webpage1 that sends email when button1 is click. I want to go back to previous page once button1 is click so I use history.back code. Below is my sample code for your reference. If Page.IsValid And SaveIssue() Then Dim msg As New MailMessage msg.To = Test@dc.com msg.From = "ACSC@noreply.com" msg.Subject = "Reply- " & txtTitle.Text msg.Body = "Hello" msg.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "abc.com" SmtpMail.Send(msg) msg = Nothing btnDone.Attributes.Add("onClick", "history.back(); return false;" End If My problem is, it will only work on the second time you will click button1. Kindly advise for the right code. Thanks in advance.
History.back to me, is not the right way as I found it useless in firefox. So Simply navigate to your WebForm1.aspx like
btnDone.Attributes.Add("onClick", "window.location = 'WebForm1.aspx'; return false;"
Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.
-
History.back to me, is not the right way as I found it useless in firefox. So Simply navigate to your WebForm1.aspx like
btnDone.Attributes.Add("onClick", "window.location = 'WebForm1.aspx'; return false;"
Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.
-
Hello everyone, I have webpage1 that sends email when button1 is click. I want to go back to previous page once button1 is click so I use history.back code. Below is my sample code for your reference. If Page.IsValid And SaveIssue() Then Dim msg As New MailMessage msg.To = Test@dc.com msg.From = "ACSC@noreply.com" msg.Subject = "Reply- " & txtTitle.Text msg.Body = "Hello" msg.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = "abc.com" SmtpMail.Send(msg) msg = Nothing btnDone.Attributes.Add("onClick", "history.back(); return false;" End If My problem is, it will only work on the second time you will click button1. Kindly advise for the right code. Thanks in advance.
Add it in the aspx, not the code behind. I'd say it's only working the second time because the first time your if statement fails.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Hello, Its because I have some control in my previous page that I want to retain the value, thats why I just simply use history.back. Do you have any suggestion?
Then it depends on if you care about FireFox. If you do, find out how to do it in FF and write script that calls the right thing.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Add it in the aspx, not the code behind. I'd say it's only working the second time because the first time your if statement fails.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Yes, if you add properties to a server control and the server does not recognise them, they get passed through to the client verbatim.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
Yes, if you add properties to a server control and the server does not recognise them, they get passed through to the client verbatim.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )