如何将以前ASP的项目转化成asp.net项目,急!
关于以前ASP项目转化成asp.net(C#)项目,请教高手几个问题:
1,如何防SQL注入;
2,怎么处理以前在同一asp页面中的两个搜索表单;
3,以前在asp页面的代码如下,现在如何转化成asp.net(C#)代码,利用简单的三层架构,请高手赐教!
<%n=request("Cid")
If n="" Or Not IsNumeric(n) Then n=0
n=CLng(n)
Url=request.ServerVariables("SCRIPT_NAME")%>
<table width="204" border="0" cellspacing="0" cellpadding="0">
<%sql="select Cid,[Name],[Intro] from [class] where ParentId=0 order by SortId"
Set rs=conn.execute(sql)
Do While Not rs.eof
Select Case rs(0)
Case 1
b="images/about_051.gif"
Case 2
b="images/about_052.gif"
Case 3
b="images/about_053.gif"
Case else
b="images/about_05.jpg"
End select%>
<tr>
<td height="31" background="<%=b%>"><div align="center">
<%If rs(2)="1" then%>
<%If rs(0)=3 Then%>
<a href="product_01.asp" class="pro"><%If n=rs(0) Or InStr(Url,"product_01.asp")>0 then%><font color="#FF0000"><%=rs(1)%></font><%else%><%=rs(1)%><%End if%></a>
<%End if%>
<%If rs(0)=4 Then%>
<a href="Product_02.asp" class="pro"><%If n=rs(0) then%><font color="#FF0000"><%=rs(1)%></font><%else%><%=rs(1)%><%End if%></a>
<%End if%>
<%If rs(0)=1 Or rs(0)=2 then%>
<a href="product.asp?CId=<%=rs(0)%>" class="pro"><%If n=rs(0) then%><font color="#FF0000"><%=rs(1)%></font><%else%><%=rs(1)%><%End if%></a>
<%End if%>
<%else%>
<a href="product_2.asp?Cid=<%=rs(0)%>" class="pro"><%If n=rs(0) then%><font color="#FF0000"><%=rs(1)%></font><%else%><%=rs(1)%><%End if%></a>
<%End if%>
</div></td>
</tr>
<%rs.movenext
Loop
rs.close%>
</table>