Entradas

Eventos no se disparan en un WebUserControl en Visual Studio 2005

Cuando se crea un WebUserControl en Visual Studio 2005, y deseamos que ese control dispare eventos, se puede dar la siguiente situación: la primera vez que se ejecuta el aplicación se dispara el evento, sin embargo la siguientes ocasiones el evento no es disparado. Esto se debe al comportamiento que tiene Visual Studio 2005 con la propiedad autoeventwireup, en VB el default es False en C# el defautl es true. Cuando AutoEventWireUp está en true, el framework creará las event handler de los controles y de las páginas automáticamente, sino buscará las definiciones en nuestro código. Para solucionar el problema mencionado anteriormente será necesario poner AutoEventWireUp en False y hacer la asignación de los event handlers del WebUserControl por medio del código. bool ignoreCase = true; bool throwOnFailure = false; Delegate d = null; d = Delegate.CreateDelegate( typeof(EventHandler), this, "Page_Load", ignoreCase, ...

Problemas con certificados de KDC

Algunas veces se recibe este error en el Domain Controllers Event Type: Warning Event Source: KDC Event Category: None Event ID: 20 Date: 9/1/2004 Time: 3:27:54 AM User: N/A Computer: MyServer Description: The currently selected KDC certificate was once valid, but now is invalid and no suitable replacement was found. Smartcard logon may not function correctly if this problem is not remedied. Have the system administrator check on the state of the domain's public key infrastructure. The chain status is in the error data. Esto se debe a que el DC contiene una referencia a un certicado invalido, para arreglar esto ejecute el siguiente comando. certutil -dcinfo deleteBad

Mostrar PopUp Window en ASP.NET

Si desea hacer un PopupWindow in ASP.NET tiene que agregar el codigo siguiente en la pantalla principal. RegisterStartupScript("POP", " var rc = new Array(0,0); " & _ " rc = window.showModaldialog('popup.aspx','name','height=450,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes'); " & _ " if (rc != null) { if(rc[0]!=null) {document.getElementById('txt_id').innerText=rc[0]; document.getElementById('txtName').innerText=rc[1];}}" & _ " ") En la pagina PopUp en el evento para regresar los datos debes agregar: Response.Write(" " & _ " var uid= '" + id + "'; " & _ " var lay= '" + name + "'; " & _ ...

El evento Page Load y ShowModalDialog

Cuando se despliega una pagina utilizando la instruccion ShowModalDialog de JavaScipt el evento PageLoad solo se ejecuta la primera vez, para solucionarlo agregar este codigo en el PageLoad Response.Expires = 0 Response.Cache.SetNoStore() Response.AppendHeader("Pragma", "no-cache")

SharePoint y .NET Framework 2.0

Cuando se instala el .NET Framework 2.0 en una maquina que tenga WSS o SharePoint Portal Server instalado, los sitios de SharePoint dejan de funcionar, esto es debido que el upgrade a Framework 2.0 cambia los sitios de IIS para que sean ejecutados con el Framework 2.0 lo cual es incorrecto, para solucionarlo hay que hacer los siguientes pasos: - Entrar en el IIS y en propiedades->Asp.net cambiar para que utilice el Framework 1.1 - En la carpeta C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files darle derechos de escritura y lectura a la cuenta Network Service y ASPNET - Editar el Web.Config del default website, el sitio extendido de SharePoint para quitar atributos que fueron agregados por el NET Framework 2.0 Remover el atributo processRequestInApplicationTrust="false" Remover la entrada hija de pages enableSessionState="false" enableViewState="true" enableViewStateMac="true" validateRequest="false" enableEventVal...

Problemas al instalar .Net Framework 2.0

Cuando se instala el .NET Framework 2.0 en una computadora que tiene VS 2003 isntalado se presentan los siguientes problemas: - La aplicacion es borrada del IIS, para solucionarlo hay que entrar a IIS y volver a crear la aplicacion - Se despliega el mensaje Service Unavailable para aplicaciones que se ejecutan con .NET Framework 1.1. Para solucionar este problema reinstala el .NET Framework Redistributable y despues aplica el SP1 del Framework.

Resolviendo "The underlying connection was closed: An unexpected error occurred on a send." (Webservices)

Tomado de http://weblogs.asp.net/jan/archive/2004/01/28/63771.aspx Algunas veces cuando se invoca un webservice la llamada falla con el siguiente error: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at ... In some cases the first call to the webservice works just fine, but if in the following few minutes no new call to the webservice is made, the next call would throw the exception shown above. This problem could be solved by altering the generated proxy class; in the GetWebRequest function the KeepAlive property must be set to false. This can be accomplished by following these steps: Add a Web Reference using the normal way (if you haven't already add...