<%
Dim RsTexasAlert
Dim RsTexasAlert_cmd
Dim RsTexasAlert_numRows
Set RsTexasAlert_cmd = Server.CreateObject ("ADODB.Command")
RsTexasAlert_cmd.ActiveConnection = MM_EmployeeSite_STRING
RsTexasAlert_cmd.CommandText = "SELECT * FROM dbo.sqryEEICAdminView WHERE EEICLocationID = 4 ORDER BY SortDate asc"
RsTexasAlert_cmd.Prepared = true
Set RsTexasAlert = RsTexasAlert_cmd.Execute
RsTexasAlert_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
RsTexasAlert_numRows = RsTexasAlert_numRows + Repeat1__numRows
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If
' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<body>
<% If Not RsTexasAlert.EOF Or Not RsTexasAlert.BOF Then %>
<table width="750" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td bgcolor="#184CB1"><div align="center"><span class="style2">Alerts for Freeport Texas</span></div></td>
</tr>
</table>
<% End If ' end Not RsTexasAlert.EOF Or NOT RsTexasAlert.BOF %>
<%
While ((Repeat1__numRows <> 0) AND (NOT RsTexasAlert.EOF))
%>
<% If Not RsTexasAlert.EOF Or Not RsTexasAlert.BOF Then %>
<table width="750" border="0" align="center" cellpadding="2" cellspacing="2">
<tr bgcolor="<%
If (Repeat1__numRows Mod 2) Then
Response.Write("#E7E9E4")
Else
Response.Write("")
End IF
%>">
<td><img src="<%=(RsTexasAlert.Fields.Item("EventTypeImage").Value)%>" align="absmiddle" /> <span class="style4">** <%=(RsTexasAlert.Fields.Item("EventTypeTxt").Value)%> **</span> <span class="style3"> <a href="articledetails.asp?<%= Server.HTMLEncode(MM_keepForm) & MM_joinChar(MM_keepForm) & "ArticleID=" & RsTexasAlert.Fields.Item("ArticleID").Value %>"><%=(RsTexasAlert.Fields.Item("ArticleTitle").Value)%></a> <strong>posted</strong> <%=(RsTexasAlert.Fields.Item("DatePosted").Value)%></span></td>
</tr>
</table>
<% End If ' end Not RsTexasAlert.EOF Or NOT RsTexasAlert.BOF %>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
RsTexasAlert.MoveNext()
Wend
%>
<% If RsTexasAlert.EOF And RsTexasAlert.BOF Then %>
<table width="750" border="0" align="center" cellpadding="2" cellspacing="2">
<tr>
<td><div align="center">** Currently there are no Alerts for Freeport Texas **</div></td>
</tr>
</table>
<% End If ' end RsTexasAlert.EOF And RsTexasAlert.BOF %>
<BR /><BR />
</body>
ASKER
The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications
TRUSTED BY
First thing
ASP and ASP.Net - Sould is the same, but Body changed.
You have to Use DataTable instead of Recordset using SQLCommand instead of ADODB.Command
in short Change ADO to ADO.Net
this all goes to the Code-behind Page (.cs)
Here is the Link
http://msdn.microsoft.com/en-us/library/dw70f090(v=vs.71).aspx
For the Aspx Page changes, though things can be attained in better way using server control.
But you can however have same approach as in Classic ASP
This is how you can do
Open in new window
You should do a basic learning of .Net though.
Thanks!