Ver Mensaje Individual
  #4 (permalink)  
Antiguo 12/05/2009, 01:08
nessy00
 
Fecha de Ingreso: febrero-2008
Ubicación: EH
Mensajes: 117
Antigüedad: 16 años, 2 meses
Puntos: 0
Exclamación Respuesta: Permite clicar dos veces en Guardar!!

Ya lo he resuelto, he escrito la siguiente función que hace un postback:

Código:
    Protected Sub RegistrarUsePostback_OnGuardar()
        Dim boton As Button
        boton = CType(Me.formvw.FindControl("butGuardar"), Button)

        Dim cbReference As String = Me.Page.ClientScript.GetPostBackEventReference(boton, "arg") & ";"
        Dim cbScript As String = " function UsePostback_OnGuardar(arg)" & _
        "{" & cbReference & ";" & "}"

        Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), "UsePostback_OnGuardar", cbScript, True)
    End Sub

Llamo a esta función para que cree el script en ejecución:
Código:
boton.Attributes.Add("onclick", "return ValidarCampos();")
RegistrarUsePostback_OnGuardar();

y en Js:

Código:
function ValidarCampos()
{
  ...
  if (ok)
  {
    document.getElementById(buttonId).disabled = true;
    UsePostback_OnGuardar(''); 
  }   
  return false; 
}
Y ya esta, problema resuelto,
gracias ltzcoatl!