473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Doubt / converting asp to asp.net

Hi everybody, how are you? I hope fine...

I am developing asp pages over 5 years, and resuming I have a project that
the teacher inputs the studants notes, so the code below paints the user
screen with vertical/horizontal input texts based on calculating the total
students on the classroom through nested loops, so I am moving slowly to
asp.net...

and to finalize the user clicks "next" to post to another asp page wich do
the SAME but using INSERT INTO instruction to adding each record on mdb
access file...

Just copying and pasting this code on .vb/VS 2005 solution wouldnt be the
best solution... What is the best method/performance doing that on asp .net
?

Thanks

<form name="notas" action="index3.asp" method="post">
<input name="materia" type="hidden" value="<%= request("materia") %>" />
<input name="trimestre" type="hidden" value="<%= request("trimestre") %>" />
<%
aluno = 31
serie = 11 ' 1 série até 3 ano colegial
notas = 3 ' PM1, PM2 e PO
Response.Write("Trimestre: " & request("trimestre") & "<br>")
Set rsNomeMateria = conn.Execute("Select * from materias where id = " &
request("materia"))
if not rsNomeMateria.Eof Then Response.Write("Matéria: " &
rsNomeMateria("Materia") & "<br><br>")
rsNomeMateria.Close
response.Write("<table border='0' cellpadding='2' cellspacing='2'>")
response.Write "<tr>"
response.Write "<td></td>"
response.Write "<td colspan='3' align='center'>1ª série</td>"
response.Write "<td colspan='3' align='center'>2ª série</td>"
response.Write "<td colspan='3' align='center'>3ª série</td>"
response.Write "<td colspan='3' align='center'>4ª série</td>"
response.Write "<td colspan='3' align='center'>5ª série</td>"
response.Write "<td colspan='3' align='center'>6ª série</td>"
response.Write "<td colspan='3' align='center'>7ª série</td>"
response.Write "<td colspan='3' align='center'>8ª série</td>"
response.Write "<td colspan='3' align='center'>1º Médio</td>"
response.Write "<td colspan='3' align='center'>2º Médio</td>"
response.Write "<td colspan='3' align='center'>3º Médio</td>"
response.Write "</tr>"

response.Write "<tr>"
response.Write "<td align='center'></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "</tr>"

For ForAlunos = 1 to aluno
response.Write("<tr>")
response.Write("<td>" & ForAlunos & "</td>")

for forserie = 1 to serie
if forserie = 1 then strSerie = "_1S"
if forserie = 2 then strSerie = "_2S"
if forserie = 3 then strSerie = "_3S"
if forserie = 4 then strSerie = "_4S"
if forserie = 5 then strSerie = "_5S"
if forserie = 6 then strSerie = "_6S"
if forserie = 7 then strSerie = "_7S"
if forserie = 8 then strSerie = "_8S"
if forserie = 9 then strSerie = "_1C"
if forserie = 10 then strSerie = "_2C"
if forserie = 11 then strSerie = "_3C"
select case (forserie mod 2)
case 0:
classenotas = "notas2"
case else
classenotas = "notas1"
end select

strSql = "Select PM1,PM2,PO From NOTAS Where Trimestre = " &
Request("trimestre") & " And Materia = " & _
Request("materia") & " And Numero = " & forAlunos & " And Serie
= " & forSerie
Set rsConsulta = conn.Execute(strSQL)
Valor(1) = ""
Valor(2) = ""
Valor(3) = ""
If Not rsConsulta.Eof Then
Valor(1) = rsConsulta("PM1")
Valor(2) = rsConsulta("PM2")
Valor(3) = rsConsulta("PO")
End If
If rsConsulta.State = 1 then rsConsulta.Close
for fornotas = 1 to notas

if fornotas = 1 then strNota = "_PM1"
if fornotas = 2 then strNota = "_PM2"
if fornotas = 3 then strNota = "_PO"%>
<td class="<%= classenotas %>"><input name="nota<%= ForAlunos & strSerie &
strNota %>" type="text" size="1" class="textbox" value="<%= Valor(fornotas)
%>"></td>
<%next 'fornotas

next 'fornotasserie

response.Write("</tr>")

next 'ForAlunos

response.Write("</table>")

%>
<br />
<input name="envia" type="submit" id="envia" value="Gravar" />
</form>
Sep 25 '06 #1
1 1167
http://msconline.maconstate.edu/tuto...pnet03-05.aspx
"Paulo Roberto" <pa***********@edt.com.brwrote in message news:O%******************@TK2MSFTNGP06.phx.gbl...
Hi everybody, how are you? I hope fine...

I am developing asp pages over 5 years, and resuming I have a project that
the teacher inputs the studants notes, so the code below paints the user
screen with vertical/horizontal input texts based on calculating the total
students on the classroom through nested loops, so I am moving slowly to
asp.net...

and to finalize the user clicks "next" to post to another asp page wich do
the SAME but using INSERT INTO instruction to adding each record on mdb
access file...

Just copying and pasting this code on .vb/VS 2005 solution wouldnt be the
best solution... What is the best method/performance doing that on asp .net
?

Thanks

<form name="notas" action="index3.asp" method="post">
<input name="materia" type="hidden" value="<%= request("materia") %>" />
<input name="trimestre" type="hidden" value="<%= request("trimestre") %>" />
<%
aluno = 31
serie = 11 ' 1 série até 3 ano colegial
notas = 3 ' PM1, PM2 e PO
Response.Write("Trimestre: " & request("trimestre") & "<br>")
Set rsNomeMateria = conn.Execute("Select * from materias where id = " &
request("materia"))
if not rsNomeMateria.Eof Then Response.Write("Matéria: " &
rsNomeMateria("Materia") & "<br><br>")
rsNomeMateria.Close
response.Write("<table border='0' cellpadding='2' cellspacing='2'>")
response.Write "<tr>"
response.Write "<td></td>"
response.Write "<td colspan='3' align='center'>1ª série</td>"
response.Write "<td colspan='3' align='center'>2ª série</td>"
response.Write "<td colspan='3' align='center'>3ª série</td>"
response.Write "<td colspan='3' align='center'>4ª série</td>"
response.Write "<td colspan='3' align='center'>5ª série</td>"
response.Write "<td colspan='3' align='center'>6ª série</td>"
response.Write "<td colspan='3' align='center'>7ª série</td>"
response.Write "<td colspan='3' align='center'>8ª série</td>"
response.Write "<td colspan='3' align='center'>1º Médio</td>"
response.Write "<td colspan='3' align='center'>2º Médio</td>"
response.Write "<td colspan='3' align='center'>3º Médio</td>"
response.Write "</tr>"

response.Write "<tr>"
response.Write "<td align='center'></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PM</td>"
response.Write "<td align='center'>PO</td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PM</strong></td>"
response.Write "<td align='center'><strong>PO</strong></td>"
response.Write "</tr>"

For ForAlunos = 1 to aluno
response.Write("<tr>")
response.Write("<td>" & ForAlunos & "</td>")

for forserie = 1 to serie
if forserie = 1 then strSerie = "_1S"
if forserie = 2 then strSerie = "_2S"
if forserie = 3 then strSerie = "_3S"
if forserie = 4 then strSerie = "_4S"
if forserie = 5 then strSerie = "_5S"
if forserie = 6 then strSerie = "_6S"
if forserie = 7 then strSerie = "_7S"
if forserie = 8 then strSerie = "_8S"
if forserie = 9 then strSerie = "_1C"
if forserie = 10 then strSerie = "_2C"
if forserie = 11 then strSerie = "_3C"
select case (forserie mod 2)
case 0:
classenotas = "notas2"
case else
classenotas = "notas1"
end select

strSql = "Select PM1,PM2,PO From NOTAS Where Trimestre = " &
Request("trimestre") & " And Materia = " & _
Request("materia") & " And Numero = " & forAlunos & " And Serie
= " & forSerie
Set rsConsulta = conn.Execute(strSQL)
Valor(1) = ""
Valor(2) = ""
Valor(3) = ""
If Not rsConsulta.Eof Then
Valor(1) = rsConsulta("PM1")
Valor(2) = rsConsulta("PM2")
Valor(3) = rsConsulta("PO")
End If
If rsConsulta.State = 1 then rsConsulta.Close
for fornotas = 1 to notas

if fornotas = 1 then strNota = "_PM1"
if fornotas = 2 then strNota = "_PM2"
if fornotas = 3 then strNota = "_PO"%>
<td class="<%= classenotas %>"><input name="nota<%= ForAlunos & strSerie &
strNota %>" type="text" size="1" class="textbox" value="<%= Valor(fornotas)
%>"></td>
<%next 'fornotas

next 'fornotasserie

response.Write("</tr>")

next 'ForAlunos

response.Write("</table>")

%>
<br />
<input name="envia" type="submit" id="envia" value="Gravar" />
</form>


Sep 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Baskar RajaSekharan | last post by:
Hi, I am having one Tool, which will convert components from vc6 to Vc7 through programaticllay. (ie converting from .dsw to .sln.) While converting, the following MessageBox is comming ," The...
138
by: ambika | last post by:
Hello, Am not very good with pointers in C,but I have a small doubt about the way these pointers work.. We all know that in an array say x,x is gonna point to the first element in that...
1
by: Baskar RajaSekharan | last post by:
Hi, I am having one Tool, which will convert components from vc6 to Vc7 through programaticllay. (ie converting from .dsw to .sln.) While converting, the following MessageBox is comming ," The...
5
by: Robert | last post by:
I have a series of web applications (configured as separate applications) on a server. There is a main application at the root and then several virtual directories that are independant...
77
by: muttaa | last post by:
Hello all, My doubt is going to be so primitive that i ask you all to forgive me beforehand.... Here's the code snippet: int main() { int x=5;
122
by: ivan | last post by:
hi all, if I have: if(A && B || C) which operation gets executed first? If I remeber well should be &&, am I correct? thanks
4
by: Paulo | last post by:
Hi... I have tryed my best to understand the asp.net, but the visual of asp.net pages are the most complicated, because on asp we have total control over the layout the page, on the asp.net for...
26
by: Vashna | last post by:
Hi Group, I have a doubt about register variables. I know that if we have a variable used very frequently in a function, then provided we never apply the & function to it, we can define it as...
15
by: somenath | last post by:
Hi All, I am not able to understand the behavior of the bellow mentioned program. #include<stdio.h> int main(void) { printf("\n Size = %d \n",sizeof 1<0); return 0;
6
by: pavanponnapalli | last post by:
hi, i am using Date::Time and using localtime function to convert a given timestamp to epoch seconds. Everything is fine. The problem comes when we give date someting like 2008-11-31 04:45:45...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.