No Response Redirect but something like Response Forward?

  • Thread starter Thread starter marcwentink
  • Start date Start date
M

marcwentink

This is probably a very simple issue but I cannot find the answer
googling at the moment.

I got this function in a ASP-page VB code


Private Sub GoToTheOtherWebSite()
Dim InternetAdresPR As String
InternetAdresPR = AppSettings.TheOtherWebSite
Response.Redirect(InternetAdresPR)
End Sub

Now instead of redirecting to the other website, I want to open a new
browser window with the other website. In HTML I know what to do, but
is there some ASP-VB function to do it from the code, since in HTML I
cannot ask the AppSettings value I think.
 
Server side you have no concept of a "new window". You could read this
settings server side and create the "client code" that will do that (could
be as simple as an hyperlink whose href attribute is initialized from a
server side value).
 
This works for popups, watcth the word wrap on the code.

Private Sub popUp(ByVal strURL As String)
Dim strScript As String = "<Script Language='javascript'>"
& _
"window.open('" & strURL & "', 'popup', 'toolbar=no,
scrollbars=no, titlebar=no, width=425, height=225');" & _
"</scr" & "ipt>"
RegisterClientScriptBlock("Script", strScript)
End Sub
 
Charlie Brown schreef:
This works for popups, watcth the word wrap on the code.

Private Sub popUp(ByVal strURL As String)
Dim strScript As String = "<Script Language='javascript'>"
& _
"window.open('" & strURL & "', 'popup', 'toolbar=no,
scrollbars=no, titlebar=no, width=425, height=225');" & _
"</scr" & "ipt>"
RegisterClientScriptBlock("Script", strScript)
End Sub

Hey, this works. Can I set a login information cookie like this also,
or do I then have to go as far down as window socket programming? And
if so, is there something like a win socket lib for Visual Basic? For
the best the other website should use the same login information as the
website jumping from.
 
Charlie Brown schreef:
You can do anything standard javascript code can do, including cookies.

Thanks! I once had a project were I used a C win socket library to
include a scanned picture into a html message. In that case there
probably were some options we had to set which were low level. But if a
few cookies can be done with standard javascript then that's a
reassurance. Although that win socket project learned me a lot about
how HTTP works, and was fun in the end when it finallly worked,
constructing a HTTP message from scratch is real error prone, one space
too many at the wrong place and .... failure.

Thanks again for all suggestions, Marc Wentink
 
Back
Top