Foros del Web » Programación para mayores de 30 ;) » .NET »

Ayuda con ActiveX hecho en .NET

Estas en el tema de Ayuda con ActiveX hecho en .NET en el foro de .NET en Foros del Web. Buenas tardes amigos !!! Vereis, tengo un ActiveX, el cual tiene programada una propiedad publica. Ok, sin embargo, cuando intento acceder a ella desde javascript, ...
  #1 (permalink)  
Antiguo 27/03/2008, 04:53
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 20 años, 10 meses
Puntos: 7
Ayuda con ActiveX hecho en .NET

Buenas tardes amigos !!!

Vereis, tengo un ActiveX, el cual tiene programada una propiedad publica. Ok, sin embargo, cuando intento acceder a ella desde javascript, me da como que no existe. Esa propiedad, como todas las demas <Param Name='' /> estan en miControl.innerHTML.... ¿Alguien sabe por que es esto?, ¿Como puedo hacer para que me salga correctamente?

Codigo de mi pagina html
Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Untitled Page</title>
</head>
<script language="javascript" type="text/javascript">
    function DameDocumentoFirmado()
    {
        alert(axFirma.XmlFirmado);
        txtFirmado.value = axFirma.innerHTML;
    }
</script>
<body>
    <table>
        <tr>
            <td>
                <object id="axFirma" classid="clsid:84E0F340-E943-4E50-BDE9-AC76D7736004"></object>
            </td>
        </tr>
        <tr>
            <td>
                <input type="button" onclick="javascript:DameDocumentoFirmado();" value="Leer dato firmado" id="btnBoton" />
            </td>
        </tr>
        <tr>
            <td>
                <br />
                <textarea id="txtFirmado" rows="15" cols="54"></textarea>
            </td>
        </tr>
    </table>
</body>
</html>
El Alert sale undefined. En el TextArea me salen todos los parametros:
Código:
<PARAM NAME="XmlFirmado" VALUE='<SignedInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI="#Documento"><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>vakR+8Z/wHgPwpS/XeztSJBDBDo=</DigestValue></Reference></SignedInfo><SignatureValue xmlns="http://www.w3.org/2000/09/xmldsig#">5OSQfPguaK761+2UP7UJ7dDVKIwnTJC0eCU9KY/nzJVZ87NeOF/Z1gObBATTSlrlEaN+85OxS02TZSX9YS8ADVyr5s3KzM7ZC+aoxE4jSq34irwkunK8/faAPRVGZTJjszUr/gk480bipsNQfrb+c6xqnKhFnWYCCeJwP5ODsZM=</SignatureValue><KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"><KeyValue><RSAKeyValue><Modulus>7T84wVxJgzVPBllgCNndCUjxSUVk9GfvoshfuY7+NdUbm5FgUjo/5VHVJhoFr2uMMtzDMyoWjcMNSKhGjzrNoFLbUk+AU4MKX6rqS+3E+amaUBUSwb4TSI5v3xBtJv9asN2QuWYk2HkDcYbI9XtPSz4/pSTBcRajVoWmQEeikZ0=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue></KeyValue></KeyInfo><Object Id="Documento" xmlns="http://www.w3.org/2000/09/xmldsig#"><InformacionDocumento xmlns=""><nombre>crearCertificado.txt</nombre><contenido>bWFrZWNlcnQgLXIgLXBlIC1uICJDTj1DYXJsaXRvIEhldmlhIiAtYiAwMS8wMS8yMDAwIC1lIDAxLzAxLzIwOTkgLWVrdSAxLjMuNi4xLjUuNS43LjMuMyAtc3MgTXkNCg0KTk9UQTogTHVlZ28gaGF5IHF1ZSBpciBhbCBjb250ZW5lZG9yIGRlIGNlcnRpZmljYWRvcyB5IGV4cG9ydGFybG8u</contenido></InformacionDocumento></Object>'><PARAM NAME="AutoSize" VALUE="False"><PARAM NAME="AutoSizeMode" VALUE="GrowOnly"><PARAM NAME="AutoValidate" VALUE="EnablePreventFocusChange"><PARAM NAME="BorderStyle" VALUE="None"><PARAM NAME="CurrentAutoScaleDimensions" VALUE="6, 13"><PARAM NAME="AutoScroll" VALUE="False"><PARAM NAME="AutoScrollMargin" VALUE="0, 0"><PARAM NAME="AutoScrollMinSize" VALUE="0, 0"><PARAM NAME="AccessibleDescription" VALUE=""><PARAM NAME="AccessibleName" VALUE=""><PARAM NAME="AccessibleRole" VALUE="Default"><PARAM NAME="AllowDrop" VALUE="False"><PARAM NAME="Anchor" VALUE="Top, Left"><PARAM NAME="AutoScrollOffset" VALUE="0, 0"><PARAM NAME="BackColor" VALUE="Gainsboro"><PARAM NAME="BackgroundImage" VALUE=""><PARAM NAME="BackgroundImageLayout" VALUE="Tile"><PARAM NAME="CausesValidation" VALUE="True"><PARAM NAME="Cursor" VALUE="Default"><PARAM NAME="Dock" VALUE="None"><PARAM NAME="Enabled" VALUE="True"><PARAM NAME="Font" VALUE="Times New Roman, 16world"><PARAM NAME="ForeColor" VALUE="Black"><PARAM NAME="Location" VALUE="15, 20"><PARAM NAME="Margin" VALUE="3, 3, 3, 3"><PARAM NAME="MaximumSize" VALUE="0, 0"><PARAM NAME="MinimumSize" VALUE="0, 0"><PARAM NAME="Name" VALUE="CtrlFirmaDigital"><PARAM NAME="RightToLeft" VALUE="No"><PARAM NAME="Size" VALUE="456, 192"><PARAM NAME="TabIndex" VALUE="0"><PARAM NAME="TabStop" VALUE="True"><PARAM NAME="Tag" VALUE=""><PARAM NAME="UseWaitCursor" VALUE="False"><PARAM NAME="Visible" VALUE="True"><PARAM NAME="PreferredSize" VALUE="444, 170"><PARAM NAME="Padding" VALUE="0, 0, 0, 0"><PARAM NAME="ImeMode" VALUE="NoControl">

Si me pudiera alguien ayudar, se lo agradeceria.

Saludos.
__________________
Charlie.
  #2 (permalink)  
Antiguo 27/03/2008, 07:24
Avatar de xknown  
Fecha de Ingreso: diciembre-2004
Ubicación: Cusco - Perú
Mensajes: 2.248
Antigüedad: 19 años, 3 meses
Puntos: 7
Re: Ayuda con ActiveX hecho en .NET

Hmm, me parece que cada elemento PARAM agregado al elemento OBJECT no se convierte en propiedad de una instancia de este último.

¿Por qué no le pones un identificador al parámetro al que quieres acceder?

<PARAM id="x" .... />

Y desde javascript usas document.getElementById('x').value

Saludos
__________________
Alex Concha
Buayacorp - Programación y Diseño
  #3 (permalink)  
Antiguo 28/03/2008, 02:43
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 20 años, 10 meses
Puntos: 7
Re: Ayuda con ActiveX hecho en .NET

Buenas xknown,

En primer lugar, agradezco tu ayuda.

Mira, he hecho lo que me has comentado (Aun que ya habia intentado esto mismo, pero sin poner el atributo ID al <param. Sin embargo, el resultado ha sido el mismo, me sale el siguiente mensaje amarillo en la parte de arriba del Explorer:

" Internet Explorer bloqueó el uso de manera no segura de un control ActiveX en este sitio. Es posible que esta página no se muestre correctamente. "

Ese mensaje aparece siempre que dentro del Object, meto la referencia al parametro, es decir:

Asi no sale ningún error y puedo usar el ActiveX, sin ningún problema ni restricción:
Código:
<object id="axFirma" classid="clsid:84E0F340-E943-4E50-BDE9-AC76D7736004">
</object>

Y asi me sale el mensaje que te he comentado arriba:
Código:
<object id="axFirma" classid="clsid:84E0F340-E943-4E50-BDE9-AC76D7736004">
     <param id="valorParametro" name="XmlFirmado" />
</object>
Si se te ocurre algo, te lo agradecería amigo, ya que soy incapaz de conseguir la maldita propiedad.

Un saludo y nuevamente, gracias por la colaboración.


Por si sirve de algo, muestro como tengo declarada la propiedad en el .cs, quizás deba meterle algún atributo para que se accesible desde HTML:

Código:
        private string _XmlFirmado = string.Empty;
        public string XmlFirmado
        {
            get { return _XmlFirmado; }
        }
__________________
Charlie.

Última edición por chcma; 28/03/2008 a las 02:47 Razón: Dar mas informacion al post
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 03:40.