473,385 Members | 1,622 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,385 software developers and data experts.

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 i
convert it to ASP.net it does not show any error. It successfully connects
to server first time, fetch and load the data from the
javaserver. But next time if i click on any link (note these
links are coming from java server). it does not refresh the contents. For
example if i click on the login link. It suppose to bring login form from
server. but it does not, It 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 "<br>Sab eik saath ehin <br>"

'sendLynxRequest lynxServer, lynxRequest
response.Write "called SednlYnx request method <br>"
Response.buffer=true
Set lynxServer = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
lynxServer.Option(WinHttpRequestOption_EnableRedir ects) = False
response.Write "reqyest mesthogd: " &
Request.ServerVariables("REQUEST_METHOD") &"<br>"
lynxServer.Open Request.ServerVariables("REQUEST_METHOD"), lynxRequest, False

'copyHeadersFromBrowser lynxServer
dim header, splitHeader, headerName, headerValue
response.Write "copyHeadersFromBrowser<br>"
response.Write "raw type : <br> " & 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 & "<br>"
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 that i converted
<%
Dim queryString, lynxRequest, binaryData As System.Object
Dim lynxServer As System.Object
Dim a
Dim lynxUrl As String
Dim header, doProxy, splitHeader, headerName, lHeaderName,
headerValue As Object
lynxUrl =
"http://193.128.166.121:8080/uia/director?form_action_url=default.aspx&UiaClient=2"
queryString = Request.ServerVariables("QUERY_STRING")

lynxRequest = lynxUrl & queryString
'Response.Buffer = True

lynxServer = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
dim WinHttpRequestOption_EnableRedirects
lynxServer.Option(WinHttpRequestOption_EnableRedir ects) = False
a = Request.ServerVariables("REQUEST_METHOD")
lynxServer.Open(a, lynxRequest,false)

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 & "<br>")
End If
Next
binaryData = Request.BinaryRead(Request.TotalBytes)
lynxServer.send(binaryData)
Response.Status = lynxServer.status & " " & lynxServer.statusText
session("res") = lynxServer.ResponseText

response.write (session("res"))
'Response.BinaryWrite(lynxServer.responseBody)
'Response.Flush()
'Response.End()
%>
Kindly if any of you guys can get back to me with a solution. Much
appreciated. Thanks in advance.

Apr 3 '06 #1
1 3745
I think first of all, you should go and read this post
http://groups.google.com/group/micro...aebf1c39b33b34

You've taken a chunk of procedural vbscript and written the same code
with an object oriented, event driven framework.

Have a look at these links which might get you started:
http://aspnet.4guysfromrolla.com/articles/122204-1.aspx
http://authors.aspalliance.com/steve...netscrape2.asp
http://msdn.microsoft.com/library/de...ClassTopic.asp

Any specific questions you have, people will be glad to help answer,
but you really can't just write ASP code in VB.Net - it's pointless and
you'll struggle to make or tail of this foolish new-fangled .Net thing.

Nazim wrote:
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 i
convert it to ASP.net it does not show any error. It successfully connects
to server first time, fetch and load the data from the
javaserver. But next time if i click on any link (note these
links are coming from java server). it does not refresh the contents. For
example if i click on the login link. It suppose to bring login form from
server. but it does not, It 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 "<br>Sab eik saath ehin <br>"

'sendLynxRequest lynxServer, lynxRequest
response.Write "called SednlYnx request method <br>"
Response.buffer=true
Set lynxServer = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
lynxServer.Option(WinHttpRequestOption_EnableRedir ects) = False
response.Write "reqyest mesthogd: " &
Request.ServerVariables("REQUEST_METHOD") &"<br>"
lynxServer.Open Request.ServerVariables("REQUEST_METHOD"), lynxRequest, False

'copyHeadersFromBrowser lynxServer
dim header, splitHeader, headerName, headerValue
response.Write "copyHeadersFromBrowser<br>"
response.Write "raw type : <br> " & 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 & "<br>"
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 that i converted
<%
Dim queryString, lynxRequest, binaryData As System.Object
Dim lynxServer As System.Object
Dim a
Dim lynxUrl As String
Dim header, doProxy, splitHeader, headerName, lHeaderName,
headerValue As Object
lynxUrl =
"http://193.128.166.121:8080/uia/director?form_action_url=default.aspx&UiaClient=2"
queryString = Request.ServerVariables("QUERY_STRING")

lynxRequest = lynxUrl & queryString
'Response.Buffer = True

lynxServer = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
dim WinHttpRequestOption_EnableRedirects
lynxServer.Option(WinHttpRequestOption_EnableRedir ects) = False
a = Request.ServerVariables("REQUEST_METHOD")
lynxServer.Open(a, lynxRequest,false)

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 & "<br>")
End If
Next
binaryData = Request.BinaryRead(Request.TotalBytes)
lynxServer.send(binaryData)
Response.Status = lynxServer.status & " " & lynxServer.statusText
session("res") = lynxServer.ResponseText

response.write (session("res"))
'Response.BinaryWrite(lynxServer.responseBody)
'Response.Flush()
'Response.End()
%>
Kindly if any of you guys can get back to me with a solution. Much
appreciated. Thanks in advance.


Apr 3 '06 #2

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

Similar topics

9
by: Paddy McCarthy | last post by:
Frustrated at being prevented from using Python at work I went gunning for Perl. Time to roll out some useless Google statistics to make me feel better Google Phrase count...
1
by: Keith R | last post by:
I have VB6, and eventually plan to upgrade to dotnet. I will soon start writing an application that will be mostly local (client?) but will interface with a server a few times, to authenticate...
4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
11
by: Jep | last post by:
Any help or advice appreciated. We have just installed and configured a new DB2 v.8.1 with latest FixPack. Just a few days later it dies and now we have a DB that is totally unusable. - - - -...
4
by: Abram Friesen | last post by:
Hi, I'm a developer for a software application vendor, and our application makes use of a customer-maintained Oracle 8i/9i database. We've had a customer request to support DB2 database, and I'm...
1
by: sac | last post by:
I am using DB2 v8.1 on UNIX. A few weeks ago the DBAs carried out node migration activity on the database. After the node migration I observed that the queries that execute on temporary tables...
2
by: aww91 | last post by:
Company is planning a Sybase to UDB migration that is projected to take 1 year. During that long period of time any Code Freeze put into place would impact our users (we normally release code...
1
by: rob | last post by:
Dear All, I have a very small test project to convert asp to asp.net using the Microsoft/Artisan ASP to ASP.NET Migration Assistant...
1
by: Bonggoy Cruz | last post by:
We have a fairly big size ASP.NET web application that was written VB.NET. We are in the process converting the web project. We used the migration wizard included in VS 2005. I followed step by...
7
by: R.A.M. | last post by:
Hello I have a question to .NET programmers about code conversion from VB6 to C#.NET: is it possible? how much work must be performed manually? Thank you very much for your answers. /RAM/ PS. By...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.