ASP Code Migration to ASP.net
-
I have been facing an issue for past week. Kindly look at the code if some one can sort it out. Issue is with the code. I have this ASP code. it connects to a server where java is running. It send us a response from there. and we need to run that plain html. As long as the code is in ASP running perfectly fine. But as i converted it to ASP.net it does not show any error. It load the data from the javaserver first time only. But next time if i click on any link (note these links are coming from java server). it does not refresh the contents. For examply if i click on the login link. It suppose to bring login form from server. but it does not only refreshes the page. Here is the ASP CODE <% Dim lynxUrl, queryString, lynxRequest, lynxServer, binaryData lynxUrl = "http://193.128.166.121:8080/uia/director?form\_action\_url=default.asp&UiaClient=2" queryString = Request.ServerVariables("QUERY_STRING") lynxRequest = lynxUrl & queryString response.Write lynxRequest response.Write "
Sab eik saath ehin
" 'sendLynxRequest lynxServer, lynxRequest response.Write "called SednlYnx request method
" Response.buffer=true Set lynxServer = Server.CreateObject("WinHttp.WinHttpRequest.5.1") lynxServer.Option(WinHttpRequestOption_EnableRedirects) = False response.Write "reqyest mesthogd: " & Request.ServerVariables("REQUEST_METHOD") &"
" lynxServer.Open Request.ServerVariables("REQUEST_METHOD"), lynxRequest, False 'copyHeadersFromBrowser lynxServer dim header, splitHeader, headerName, headerValue response.Write "copyHeadersFromBrowser
" response.Write "raw type :
" & Request.ServerVariables("ALL_RAW") for each header in split(Request.ServerVariables("ALL_RAW"), vbnewline) if trim(header) <> "" then splitHeader=split(header, ": ", 2) headerName=splitHeader(0) headerValue=splitHeader(1) lynxServer.setRequestHeader headerName, headerValue response.Write "h1" & headername &"=" & headerValue & "
" end if next binaryData = Request.binaryRead(Request.totalBytes) lynxServer.send(binaryData) 'receiveLynxResponse lynxServer Response.Status = lynxServer.status & " " & lynxServer.statusText Response.BinaryWrite(lynxServer.responseBody) Response.flush Response.end Response = nothing --------------------------------------------- Here is the ASP.net Code <% Dim queryString, lynxRequest, binaryData As System.Object Dim lynxServer As System.Object Dim a Dim lynxUrl As Str -
I have been facing an issue for past week. Kindly look at the code if some one can sort it out. Issue is with the code. I have this ASP code. it connects to a server where java is running. It send us a response from there. and we need to run that plain html. As long as the code is in ASP running perfectly fine. But as i converted it to ASP.net it does not show any error. It load the data from the javaserver first time only. But next time if i click on any link (note these links are coming from java server). it does not refresh the contents. For examply if i click on the login link. It suppose to bring login form from server. but it does not only refreshes the page. Here is the ASP CODE <% Dim lynxUrl, queryString, lynxRequest, lynxServer, binaryData lynxUrl = "http://193.128.166.121:8080/uia/director?form\_action\_url=default.asp&UiaClient=2" queryString = Request.ServerVariables("QUERY_STRING") lynxRequest = lynxUrl & queryString response.Write lynxRequest response.Write "
Sab eik saath ehin
" 'sendLynxRequest lynxServer, lynxRequest response.Write "called SednlYnx request method
" Response.buffer=true Set lynxServer = Server.CreateObject("WinHttp.WinHttpRequest.5.1") lynxServer.Option(WinHttpRequestOption_EnableRedirects) = False response.Write "reqyest mesthogd: " & Request.ServerVariables("REQUEST_METHOD") &"
" lynxServer.Open Request.ServerVariables("REQUEST_METHOD"), lynxRequest, False 'copyHeadersFromBrowser lynxServer dim header, splitHeader, headerName, headerValue response.Write "copyHeadersFromBrowser
" response.Write "raw type :
" & Request.ServerVariables("ALL_RAW") for each header in split(Request.ServerVariables("ALL_RAW"), vbnewline) if trim(header) <> "" then splitHeader=split(header, ": ", 2) headerName=splitHeader(0) headerValue=splitHeader(1) lynxServer.setRequestHeader headerName, headerValue response.Write "h1" & headername &"=" & headerValue & "
" end if next binaryData = Request.binaryRead(Request.totalBytes) lynxServer.send(binaryData) 'receiveLynxResponse lynxServer Response.Status = lynxServer.status & " " & lynxServer.statusText Response.BinaryWrite(lynxServer.responseBody) Response.flush Response.end Response = nothing --------------------------------------------- Here is the ASP.net Code <% Dim queryString, lynxRequest, binaryData As System.Object Dim lynxServer As System.Object Dim a Dim lynxUrl As StrI don't know if this might sound too simple, but a number of lines are commented out and therefore won't execute, I don't know if it's just the transcription you copied here or your code is like this. 'Response.BinaryWrite(lynxServer.responseBody) 'Response.Flush() 'Response.End() for example, I am more a C# programmer and not too familiar with VB.net but this lines of code would not be compiled in C#, they would simply be considered comments.