classic asp to asp.net/c#

Row=Request.Form("TxtPkg")
 If Row <> "" Then
    Row = cint(Row)
    Column = Cint(17)
    ReDim Tatty(Column,Row) 
 Else
    ReDim Tatty(17,1) '=18 columns, 3 rows 
 End If
response.Wrnite "<form action=""TattyWizard.asp"" method=""post"" name=""frmPostData"">"
response.Write "<input type=""hidden"" name=""TotalRow"" value=" & Row & ">"
response.Write "<table>"
Response.Write "<tr><td>Column:</td><td>" & UBound(Tatty,1)+1 & "</td></tr>"
Response.Write "<tr><td>Row:</td><td>" & UBound(Tatty,2) & "</td></tr>"
response.Write "</table>"
response.Write "<table border=""0"">"
response.Write "<tr valign=""bottom""><td colspan=""19"">QuoteId: 1000</td><td><b>TTL PCS</b></td><td><b>TTL FT</b></td><td><b>TTL LM</b></td><td><b>MFBM<br>MFSM</b></td><td><b>CBM</b></td></tr>"
response.Write "<tr align=""right""><td><br></td><td>995</td><td>1220</td><td>1530</td><td>1830</td>"
response.Write "<td>2130</td><td>2440</td><td>2740</td><td>3050</td>"
response.Write "<td>3350</td><td>3660</td><td>3960</td><td>4270</td><td>4570</td>"
response.Write "<td>4880</td><td>5180</td><td>5490</td><td>5790</td><td>6100</td>"
response.Write "</tr>"
response.Write "<tr align=""right"">"
Response.Write "<td align=""left""><b>Product</b>&nbsp;&nbsp;<b>ttl ft/mfbm</b>&nbsp;<b>m3/mfbm</b></td>"
For i = 3 to 20
Response.Write "<td>" & i & "</td>"
Next
response.Write "</tr>"
For I=0 to UBound(Tatty,2) - 1'read the rows
        response.Write "<tr>"
        response.Write "<td>"
        response.Write "<input size=2  name=ProductName" & I & " id=ProductName" & I & ">&nbsp;"
        response.Write "<input size=3  onblur =""UpdateRow(" & I & ")"" name=Ddl" & I & " id=Ddl" & I & ">&nbsp;"
        response.Write "<input size=3  onblur =""UpdateRow(" & I & ")"" name=CbmHidden" & I & " id=CbmHidden" & I & ">"
        response.Write "</td>"
        For X = 0 To UBound(Tatty,1) 'read the columns
        TmpUse = I & X
        Response.Write "<td>"
        Response.Write "<input onkeyup=""this.value=this.value.replace(/\D/gi,'');"" maxlength=""4"" onblur =""UpdateRow(" & I & ")"" name=Txt" & I & "_" & X & " id=" & I & "_" & X & " size=1>"
        Response.Write "</td>" 
        Next
        If Right(TmpUse,2) = 17 Then
                Response.Write "<td><input readonly  size=4 id=Total_" & Left(TmpUse,1) & " name=Total_"   & Left(TmpUse,1) & "></td>"
                Response.Write "<td><input readonly  size=4 id=TotalFt_" & Left(TmpUse,1) & " name=TotalFt_" & Left(TmpUse,1) & "></td>"
                Response.Write "<td><input readonly  size=4 id=TotalLm_" & Left(TmpUse,1) & " name=TotalLm_" & Left(TmpUse,1) & "></td>"
                '======================================================
                'last two begin
                Response.Write "<td><input readonly  size=4 id=TotalMfbm_" & Left(TmpUse,1) & " name=TotalMfbm_" & Left(TmpUse,1) & "></td>"
                Response.Write "<td><input readonly  size=4 id=TotalCbm_" & Left(TmpUse,1) & " name=TotalCbm_" & Left(TmpUse,1) & "></td>"
                'last two end
                '======================================================
        End If
        response.Write "</tr>"
Next
Response.Write "</table>"
Response.Write "<table>"
response.Write "<td><input type=""Submit"" name=""Btn_Save"" Value=""Save All""></td></tr>"
response.Write "</table>"

Open in new window


I just try to convert from classic asp to asp.net/c#. any one know how to do it?
Webboy2008Asked:
Who is Participating?
 
Marcin_ZawadzkiCommented:
First - Create ASPX page, and get rid of all "response.write" - just literally write HTML.
Each time you want code, surround it with <% %> tags

Example it should be like

<% If Right(TmpUse,2) = 17 Then %>
<td><input readonly  size=4 id="<% Total_" & Left(TmpUse,1) & " name=Total_"%>"   & Left(TmpUse,1) & "></td>


0
 
SriVaddadiCommented:
wat are you trying to do? Could you give more info?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.