Foros

 
ForumForumForos DNNForos DNNDesarrolloDesarrollohabilitar controles para usuarios no autenticadoshabilitar controles para usuarios no autenticados
Anterior Anterior
 
Siguiente Siguiente
Nuevo Mensaje
 09/04/2011 19:00
 

Hola, mira con Firefox si se produce algun error cuando le das al boton, es decir, ve a herramientas->consola de herrores cuando pulses el boton, y mira si esta devolviendo algun error de javascript.

con lo que sea me dices, porque si el archivo es accesible por http, no devuleve errores al hacer debug, yo me decantaria por un error javascript.

miralo y me dices, si no es asi, pienso otra cosa.

Un saludo.


www.lgisoluciones.com
Nuevo Mensaje
 09/04/2011 19:08
 

no ya lo abri y estuve pendiente y no bota o arroja ningun error en javascript entonc no creoq ue sea por hay porque es que por os otros ususarios si funciona correctamente lo unico es cuando se accesa a los controles por usuario no autenticado, inclusive en contadas ocaciones el usuario no autenticado si baja pero son demasiado pocas, es como si se le olvidara la restriccion que debe tener y la pasara, pero al momento de bajarlo de vuelve a bloquear no dejando descargar mas

Nuevo Mensaje
 09/04/2011 23:12
 

añadiste el "response.end" al final del todo?

Porqué no adjuntas tu módulo y lo pruebo en mi equipo...

Nuevo Mensaje
 11/04/2011 15:31
 

Aca te adjunto mi codigo a ver si me puedes ayudar primero este es el ascx

<p><h3><i>

Documentos Asociados</i></h3></p>

<table style="width:100%;" border="2">

<tr>

<td>

Resoluci&oacute;n 610 de 2010 (24 de Marzo de 2010)</td>

<%If (PortalSecurity.IsInRole("Administrators Users")) Or (PortalSecurity.IsInRole("Registered Users")) Then%>

<td class="style1">

<asp:Button ID="btnDesc610" runat="server" ForeColor="Blue" Text="Descargar" />

</td><%End If%>

</tr>

<tr>

<td>

Resoluci&oacute;n 651 de 2010 (29 de Marzo de 2010)</td>

<%If (PortalSecurity.IsInRole("Administrators Users")) Or (PortalSecurity.IsInRole("Registered Users")) Then%>

<td class="style1">

<asp:Button ID="btnDesc651" runat="server" ForeColor="Blue" Text="Descargar" />

</td><%End If%>

</tr>

<tr>

<td>

Manual de Operaci&oacute;n de Sisitemas de Vigilancia de la Calidad del Aire</td>

<%If (PortalSecurity.IsInRole("Administrators Users")) Or (PortalSecurity.IsInRole("Registered Users")) Then%>

<td class="style1">

<asp:Button ID="btnDescManOp" runat="server" ForeColor="Blue"

Text="Descargar" />

</td><%End If%>

</tr>

<tr>

<td>

Manual de Dise&ntilde;o de Sistemas de Vigilancia de la Calidad del Aire</td>

<%If (PortalSecurity.IsInRole("Administrators Users")) Or (PortalSecurity.IsInRole("Registered Users")) Then%>

<td class="style1">

<asp:Button ID="btnDescManDis" runat="server" ForeColor="Blue"

Text="Descargar" />

</td><%End If%>

</tr>

<tr>

<td>

Resoluci&oacute;n 2154 de 2010 (2 de Noviembre de 2010)</td>

<%If (PortalSecurity.IsInRole("Administrators Users")) Or (PortalSecurity.IsInRole("Registered Users")) Then%>

<td class="style1">

<asp:Button ID="btnDesc2154" runat="server" ForeColor="Blue" Text="Descargar" />

</td><%End If%>

</tr>

<tr>

<td>

Resoluci&oacute;n 1732 de 2010 (8 de Septiembre de 2010)</td>

<%If (PortalSecurity.IsInRole("Administrators Users")) Or (PortalSecurity.IsInRole("Registered Users")) Then%>

<td class="style1">

<asp:Button ID="btnDesc1732" runat="server" ForeColor="Blue" Text="Descargar" />

</td><%End If%>

</tr>

</table>

<% If Not (PortalSecurity.IsInRole("Administrators Users")) And Not (PortalSecurity.IsInRole("Registered Users")) And PortalSecurity.IsInRole("Unauthenticated Users") Then%>

<p style="text-align: center; font-family: Technic; font-size: large; color: #FF0000">

<br />

<strong style="text-align: center">Para Acceder a la descarga del informe debera registrarse</strong></p>

<%End If%>

como puedes ver los if para mostrar los botones los tengo ya que el problema persiste y pues tenia que dar solución, con esto logro que se registren y pues hay si sirven los botones. En el siguiente te adjunto el code behind de cada uno de los botones.

Nuevo Mensaje
 11/04/2011 15:33
 

Aca te adjunto el code behind.

Protected Sub btnDesc6101_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDesc610.Click

Try

'If (PortalSecurity.IsInRole("Unauthenticated Users")) Or (PortalSecurity.IsInRole("Administrators")) Or (PortalSecurity.IsInRole("Registered Users")) Then

'MsgBox("ENTRO")

Response.Clear()

Response.ClearHeaders()

Dim fs As IO.FileStream = Nothing

Dim path As String = "C:\inetpub\wwwroot\corpocesar\documentos\NormatividadReal\res_0610_240310.pdf"

'obtenemos el archivo del servidor

fs = IO.File.Open(path, IO.FileMode.Open, IO.FileAccess.Read)

Dim byteBuffer(CInt(fs.Length - 1)) As Byte

fs.Read(byteBuffer, 0, CInt(fs.Length))

fs.Close()

Using ms As New IO.MemoryStream(byteBuffer)

'descargar con su nombre original

Response.AddHeader("Content-Disposition", "attachment; filename=resolucion_610_2010.pdf")

ms.WriteTo(Response.OutputStream)

End Using

Response.End()

'End If

Catch ex As Exception

ProcessModuleLoadException(Me, ex)

End Try

End Sub

Protected Sub btnDesc651_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDesc651.Click

If PortalSecurity.IsInRole("Unauthenticated Users") Or (PortalSecurity.IsInRole("Administrators")) Or (PortalSecurity.IsInRole("Registered Users")) Then

Dim fs As IO.FileStream = Nothing

Dim path As String = "C:\inetpub\wwwroot\corpocesar\documentos\NormatividadReal\res_0651_290310_SISAIRE.PDF"

'obtenemos el archivo del servidor

fs = IO.File.Open(path, IO.FileMode.Open, IO.FileAccess.Read)

Dim byteBuffer(CInt(fs.Length - 1)) As Byte

fs.Read(byteBuffer, 0, CInt(fs.Length))

fs.Close()

Using ms As New IO.MemoryStream(byteBuffer)

'descargar con su nombre original

Response.AddHeader("Content-Disposition", "attachment; filename=resolucion_651_2010.pdf")

ms.WriteTo(Response.OutputStream)

End Using

End If

End Sub

Protected Sub btnDescManOp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDescManOp.Click

If PortalSecurity.IsInRole("Unauthenticated Users") Or (PortalSecurity.IsInRole("Administrators")) Or (PortalSecurity.IsInRole("Registered Users")) Then

Dim fs As IO.FileStream = Nothing

Dim path As String = "C:\inetpub\wwwroot\corpocesar\documentos\NormatividadReal\res_2154_021110_manual_operacio.pdf"

'obtenemos el archivo del servidor

fs = IO.File.Open(path, IO.FileMode.Open, IO.FileAccess.Read)

Dim byteBuffer(CInt(fs.Length - 1)) As Byte

fs.Read(byteBuffer, 0, CInt(fs.Length))

fs.Close()

Using ms As New IO.MemoryStream(byteBuffer)

'descargar con su nombre original

Response.AddHeader("Content-Disposition", "attachment; filename=resolucion_2154_ManOpe_2010.pdf")

ms.WriteTo(Response.OutputStream)

End Using

End If

End Sub

Protected Sub btnDescManDis_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDescManDis.Click

If PortalSecurity.IsInRole("Unauthenticated Users") Or (PortalSecurity.IsInRole("Administrators")) Or (PortalSecurity.IsInRole("Registered Users")) Then

Dim fs As IO.FileStream = Nothing

Dim path As String = "C:\inetpub\wwwroot\corpocesar\documentos\NormatividadReal\res_2154_021110_manual_diseno.pdf"

'obtenemos el archivo del servidor

fs = IO.File.Open(path, IO.FileMode.Open, IO.FileAccess.Read)

Dim byteBuffer(CInt(fs.Length - 1)) As Byte

fs.Read(byteBuffer, 0, CInt(fs.Length))

fs.Close()

Using ms As New IO.MemoryStream(byteBuffer)

'descargar con su nombre original

Response.AddHeader("Content-Disposition", "attachment; filename=resolucion_2154_ManDis_2010.pdf")

ms.WriteTo(Response.OutputStream)

End Using

End If

End Sub

Protected Sub btnDesc2154_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDesc2154.Click

If PortalSecurity.IsInRole("Unauthenticated Users") Or (PortalSecurity.IsInRole("Administrators")) Or (PortalSecurity.IsInRole("Registered Users")) Then

Dim fs As IO.FileStream = Nothing

Dim path As String = "C:\inetpub\wwwroot\corpocesar\documentos\NormatividadReal\res_2154_de_2010_ajuste del protocolo.PDF"

'obtenemos el archivo del servidor

fs = IO.File.Open(path, IO.FileMode.Open, IO.FileAccess.Read)

Dim byteBuffer(CInt(fs.Length - 1)) As Byte

fs.Read(byteBuffer, 0, CInt(fs.Length))

fs.Close()

Using ms As New IO.MemoryStream(byteBuffer)

'descargar con su nombre original

Response.AddHeader("Content-Disposition", "attachment; filename=resolucion_2154_2010.pdf")

ms.WriteTo(Response.OutputStream)

End Using

End If

End Sub

Protected Sub btnDesc1732_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnDesc1732.Click

If PortalSecurity.IsInRole("Unauthenticated Users") Or (PortalSecurity.IsInRole("Administrators")) Or (PortalSecurity.IsInRole("Registered Users")) Then

Dim fs As IO.FileStream = Nothing

Dim path As String = "C:\inetpub\wwwroot\corpocesar\documentos\NormatividadReal\Res1732de2010_Area_Fuente.pdf"

'obtenemos el archivo del servidor

fs = IO.File.Open(path, IO.FileMode.Open, IO.FileAccess.Read)

Dim byteBuffer(CInt(fs.Length - 1)) As Byte

fs.Read(byteBuffer, 0, CInt(fs.Length))

fs.Close()

Using ms As New IO.MemoryStream(byteBuffer)

'descargar con su nombre original

Response.AddHeader("Content-Disposition", "attachment; filename=resolucion_1732_2010.pdf")

ms.WriteTo(Response.OutputStream)

End Using

End If

End Sub

En este logro la descarga de cada uno d elos botones el el page load no puse nada, por esta razon no subo nada de eso.

Espero que me puedas ayudar pruebalo y me dices si te corre a ti.

Gracias por tu colaboracion

Anterior Anterior
 
Siguiente Siguiente
ForumForumForos DNNForos DNNDesarrolloDesarrollohabilitar controles para usuarios no autenticadoshabilitar controles para usuarios no autenticados

En total, tenemos 1098 nuevo(s) hilo(s) y 5265 nuevo(s) mensaje(s)
Los hilos más populares han estado en ¿por que?
Los hilos más activos han estado en no veo el portal desde los pc's de la red

Más activos


UserTotalPosts
jmaldonadom 1101
anonymous 798
javier 488
Faco 395
hiunkeru 184
vitolo 182
Guillaume 168
ccolonia 159
dormio 157
elijo_otroo 138
sonsai 84
Dreamvk 67
tirillos 48
vte_torres 47
oskr226 46

Últimos Mensajes...