Bazı eski kodları temizlemeye çalışıyorum. Bu kodu nasıl daha özlü yapabilirim? Ya da bunu yapmanın daha iyi bir yolu var. Dosyalardan 2 alan adında eski bir klasik .asp sitesi.Muhtasar kod.
<% If (GetDomainType() = "CTH") Then
<meta HTTP-EQUIV="REFRESH" content="7; url=http://www.w.com">
ElseIf (GetDomainType() = "CA") Then
<meta HTTP-EQUIV="REFRESH" content="7; url=http://www.e.com">
End If %>
<!-- #INCLUDE file="mobile_sitefiles.asp"-->
<% If (GetDomainType() = "WRT") Then
<title>WRT</title>
ElseIf (GetDomainType() = "EL") Then
<title>EL</title>
ElseIf (GetDomainType() = "CA") Then
<title>Curb APeel</title>
Else
<title>Call</title>
End If %>
Ama sonra sadece sayfayı keser:
<% If (GetDomainType() = "CTH") Then %>
<meta HTTP-EQUIV="REFRESH" content="7; url=http://www.w.com">
<% ElseIf (GetDomainType() = "CA") Then %>
<meta HTTP-EQUIV="REFRESH" content="7; url=http://www.e.com">
<% End If %>
<!-- #INCLUDE file="mobile_sitefiles.asp"-->
<% If (GetDomainType() = "WRT") Then %>
<title>WRT</title>
<% ElseIf (GetDomainType() = "EL") Then %>
<title>EL</title>
<% ElseIf (GetDomainType() = "CA") Then %>
<title>Curb APeel</title>
<% Else %>
<title>Call</title>
<% End If %>
denedim.
Klasik ASP kodu gibi bir şey olacaktı. ASP kodları ile gerçek HTML'yi karıştırdığınızda ASP, bunları nasıl işleyeceğini bilmiyor ve çeşitli hatalar üretecek. GetDomainType() 'ın ne yaptığını gösterirseniz muhtemelen bu kodu temizleyebilirsiniz. – Lankymart
http://codereview.stackexchange.com/ için daha uygun olabilir – nha