Ver Mensaje Individual
  #1 (permalink)  
Antiguo 06/06/2009, 03:32
Buceador23
 
Fecha de Ingreso: junio-2009
Mensajes: 19
Antigüedad: 14 años, 11 meses
Puntos: 0
Problemas con Sub Render

Buenos dias, la verdad que leyendo un porco por diferentes paginas web, he visto que se puede utilizar desde una clase Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter), para escribir en HTML, me he creado esta clase:

Imports Microsoft.VisualBasic
Imports MySql.Data.MySqlClient

Namespace Tom.Libros
Public Class Normas
Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)

Dim Cadena As String = ""
Dim Conexion As MySql.Data.MySqlClient.MySqlConnection = New MySql.Data.MySqlClient.MySqlConnection
Conexion.ConnectionString = System.Configuration.ConfigurationManager.Connecti onStrings("BBDD2").ConnectionString
Conexion.Open()
Dim Comando As MySqlCommand = New MySqlCommand("SELECT IdNorma, Descripcion, Titulo, Norma, Fotos, PaginaIndep, Fecha, Piepagina, Emitido FROM Normas", Conexion)
Dim Reader As MySqlDataReader = Comando.ExecuteReader

Output.WriteLine("<table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""100%"">")
If Reader.Read() Then
Output.WriteLine("<table cellpadding=""0"" cellspacing=""0"" border=""0"" width=""100%"">")
Output.WriteLine("<tr>")
Output.WriteLine("<td width=""5%""><img src=""e/i/Flecha.gif"" width=""10"" height=""10"" alt=""""/></td>
Output.WriteLine("<td width=""75%"" style=""padding-left:5px"" NOWRAP><a href=""""X.aspx?IdNorma=" & reader.GetInt32(0) & """ target=""ventanita"" onclick=""window.open('', 'ventanita', 'width=900,height=860')"" class=""CajaAzulSinBorde"">" & Reader.GetString(1) & "</a></td>

If Reader.GetInt32(4) = 0 Then
Output.WriteLine("<td width=""10%"" NOWRAP><a href=""""X.aspx?IdNorma=" & reader.GetInt32(4) & """ class=""CajaVerdeSinBorde"">Ver&nbsp;Fotos</a></td>
End If
Output.WriteLine("</tr>")
End If
Reader.Close()
Conexion.Close()
Output.WriteLine("</table>")
End Sub
End Class
End Namespace



Y el Error que me da es el siguiente:

sub 'Render' cannot be declared 'Overrides' because it does not override a sub in a base class.

Source Error:

Line 8:
Line 9:
Line 10: Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)


A ver si me podeis hechar una manita. Un saliudo