Forum Moderators: open

Message Too Old, No Replies

upgrading from Asp to Asp .NET problems

         

jss_eng

1:24 am on Apr 18, 2004 (gmt 0)

10+ Year Member



hi
my knowledge about Asp .NET is not much
but i just need to make an Asp code to work on Asp .NET

i spent much time modifying my code removing "set" and defining all variables etc..
finally i faced a problem i couldn,t solve
there is a function in Asp code like that
<% function something
...some code
%>
some html tags
<%
...some code
etc..
end function
%>
this code doesn,t work on Asp .NET
because Asp .NET doesn,t support functions in <% %>
and after i searched for a solution i found that to make this code work i have to remove <% ... %> and convert it to <script runat="server" ...>...</script>
and remove all inline <% ... %> and print all html tags using Response.write("...")
this is the only solution i found
but this is a horrible solution for me because i have huge inline <% ... %> in the function and to write it in response.write("...") form i need to write response.write("...") handreds of time

if any one know a better way than this please help

duckhunter

3:03 am on Apr 18, 2004 (gmt 0)

10+ Year Member



You are trying to do classic ASP coding styles in .NET. Your existing ASP page should run as-is on the new platform. Why do you "have" to convert it? Any page switching over to .NET is pretty much a complete rewrite if you are using an aspx webform.

If you want to run .NET, use .NET's functionality, not ASP's.

TheNige

7:52 pm on Apr 19, 2004 (gmt 0)

10+ Year Member



I agree, do not try to code the same way with ASP.Net as you did in ASP. Conver the whole page and start from the ground up the ASP.Net way. Pick up a good book.