Change VBScript to Vb.net and convert asp page to aspx page

Hi

I want to convet an asp page to aspx page using vb.net.
The below is the code for the whole page. The main part is to convert the vbscript part hightlighted in the code

The page also send email and I can use existing mail sending classes to do that part.
**************************this part of the code needs changing********************
<%@ Language=VBScript %>
<%
strID = CDbl(Request("strID"))
strLastname = Replace(Request.Form("strLastname"),"'","''")
strDocumentation = Replace(Request.Form("strDocumentation"),"'","''")
 
Set conn = Server.CreateObject("ADODB.Connection")
conn.open Application("app1")
 
'copy old record to history table and add documentation
conn.execute("INSERT INTO accounts_history (accountid,firstname,lastname,address,city,zip,state,country,email,password,created,consent1,consent2,access, documentation) SELECT accountid,firstname,lastname,address,city,zip,state,country,email,password,created,consent1,consent2,access,'" & strDocumentation & "' as documentation FROM accounts where accountid = " & strID)
		
Set ds = Server.CreateObject("ADODB.Recordset")
ds.Open "SELECT * FROM accounts WHERE accountid = " & strID & "", conn, 1, 2
		
ds("lastname") = strLastname
 
 
intAccountID = ds("accountid")
strEmail = ds("email")
strPassword = ds("password")
	
ds.Update
ds.Close
Set ds = Nothing
 
conn.Close
Set conn = Nothing
 
'Response.Redirect("http://www.mypage.com/usst/")
%>
 
************************************************************************************
 
 
<html>
<head>
<title>Mypage Inc. - Sareholder Register</title>
</head>
<body>
<h1>My page Register</h1>
<a HREF="Index.asp">Main Menu</a> &gt; Search Results &gt; Update Last Name
<p>
 
 
<font color="red">Account information has been updated. (<em><%= Now()%></em>)</font>
<p>
<form action="http://www.mypage.com/usst/SearchResults.asp" method="GET" id="form1" name="form1">
Search by <strong>last name:</strong>&nbsp;<input type="text" id="text1" name="text1"><input type="submit" value="Search" id="submit1" name="submit1"><br>
Search by <strong>account number</strong>&nbsp;<input type="text" id="text2" name="text2"><input type="submit" value="Search" id="submit2" name="submit2">
</form>	
<hr>
 
<%
 
strBody = "Dear Stockholder:" & vbCrLf & vbCrLf & "This is to confirm that we completed the update of your account information per your request." & vbCrLf & vbCrLf
strBody = strBody & "This is an automatically generated post only e-mail. Please do not reply." & vbcrlf & vbcrlf
strBody = strBody & "To view your account statement online, please visit the following URL:" & vbcrlf & "http://www.mypage.com/ir/?id=" & intAccountID & "&pw=" & strPassword & vbcrlf & vbcrlf & vbcrlf
strBody = strBody & "For all other shareholder services, please visit our investor relations Web site at:" & vbcrlf & "http://www.mypage.com/ir/" & vbcrlf & vbcrlf
strBody = strBody & "Account Number:     " & intAccountID & vbcrlf & vbcrlf & "Password:           " & strPassword & vbcrlf & vbcrlf & vbcrlf 
strBody = strBody & "Best regards," & vbcrlf & vbcrlf & "Mypage" & vbcrlf & vbcrlf
strBody = strBody & "---" & vbCrLf & "THE INFORMATION CONTAINED IN THIS E-MAIL IS PROVIDED 'AS IS'"
 
Set Mailer = CreateObject("CDONTS.NewMail")
Mailer.From = """Mypage Inc.""<mail@mypage.com>"
Mailer.To = strEmail
Mailer.Subject = "Confirmation"
Mailer.Body = strBody
Mailer.Send
Set Mailer = Nothing
		
%>
The following email has been sent to <b><code><%=strEmail%></code></b><p>
	
<code>
<%=replace(strBody,vbCrLf,"<br>")%>
</code>
 
</body>
</html>

Open in new window

nirisanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David H.H.LeeCommented:
Hi nirisan,
There are a vast topic to aspx conversion. This asp.net official site can guide you the important steps regarding the necessary changes should be take for asp convert to aspx.
http://msdn.microsoft.com/en-us/library/ms973813.aspx

If you tend to use existing asp code under asp.net environment, the easiest solution is add aspcompat mode and remain the existing vbscript that running behind.
eg:
<%@ Page AspCompat="true" Language="VB" %>

Check this MSDN descriptions:
http://msdn.microsoft.com/en-us/library/zwk9h2kb.aspx



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.