Article View: chile.comp.programacion
Article #233problema de textbox asp
From: goldberd
Date: Mon, 27 Feb 2012 19:03
Date: Mon, 27 Feb 2012 19:03
91 lines
4179 bytes
4179 bytes
Buenas tardes:
Tengo un problema que me ha dado vueltas y no he podido resoverlo, tengo
un formulario web ascx en c#, el cual me permite ingresar en un textbox
asp, un numero de serie, al presionar enter, debe grabarse en la tabla y
refrescar la grila con el valor ingresado, y esperar ya que se puede
ingresar otro serie. ademas tengo 2 botones asp, un Confirmar, y un
eliminar, el confirmar , en realidad me cambia el estado desde digitado a
cerrado,
les cuento que al ingresar el valor, presionar enter me agregar
correctamente el valor a la tabla, pero, el problem as presenta
inmediatamente despues de ingresar el valor, me manda en forma automatica
al evento del primer boton asp que encuentra, esto posiblemente sea por el
post, como puedo controlar que no me haga el post al presionar el enter, y
que el botton se ejecute solo cuando yo lo presiono..
adjunto el script de java que me ejecuta cuando persiono el enter, ademas
de los atributos que le agrego a los botones asp. alguien me ayuda por
favor..
El codigo que esta en el html---
//----------------------------------
var nav5 = window.Event ? true : false;
function acceptNum2(evt)
{
// NOTA: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
var key2 = nav5 ? evt.which : evt.keyCode;
if (key2 == 13)
{
registraserie();
}
//return (key2==13) // return (key <= 13 || (key >= 48 && key <= 57));
}
function registraserie ()
{
var estado = RegistroSeriesE.getEstado().value
if (estado!="0")
{
return;
}
var serie=document.getElementById('<%=txtSeries.ClientID%>').value ;
//alert (serie);
var mensaje= RegistroSeriesE.RegistroProd(serie).value;
if (mensaje=="")
{
var CantSeries = RegistroSeriesE.getCantidadSeries().value;
document.getElementById('<%=txtCantidadSeries.ClientID%>').innerText =
CantSeries;
document.getElementById('<%=txtUltimoOK.ClientID%>').innerText =
serie;
document.getElementById('<%=txtSeries.ClientID%>').innerText = "";
}
else
{
document.getElementById('<%=txtSeries.ClientID%>').innerText = "";
document.getElementById('<%=txtCantidadSeries.ClientID%>').innerText =
RegistroSeriesE.getCantidadSeries().value;
var CantSeries = RegistroSeriesE.getCantidadSeries().value;
document.getElementById('<%=txtCantidadSeries.ClientID%>').innerText =
CantSeries;
}
}
el codebehin de la pagina
private void Page_Load(object sender, System.EventArgs e)
{
Ajax.Utility.RegisterTypeForAjax(typeof(RegistroSeriesE));
this.txtSeries.Attributes.Add("onBlur","RegistroSeriesE.RegistroProd(this.value);");
this.txtCodigoArticulo.Attributes.Add("onBlur","javascript:CodArt(this.value);");
this.btnAprobar.Attributes.Add("onClick", "if(!confirm('๏ฟฝEsta Seguro de
Aprobar?')){return false;};");
this.btnBorrar.Attributes.Add("onClick", "if(!confirm('๏ฟฝ Esta seguro de
Eliminar Este Documento ?')){return false;};");
this.btnImprimir.Attributes.Add("onClick", "ImprimirRegistroSeries();");
Technical Details
Message-ID:
<a436bb19341d8d2aafbe582cd16f5329$1@usenet.no-ip.com>Path:
arc1-ca.pugleaf.net!t13ni76751bkb.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!news.nivel5.cl!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 1593cb,71e9d12864892add,start
X-Google-NewGroupId: yes
X-Google-Attributes: gide499fe1f24,domainid0,public,usenet
X-Google-Language: SPANISH,ASCII
Received: by 10.204.150.90 with SMTP id x26mr1130546bkv.6.1330365853057;
Mon, 27 Feb 2012 10:04:13 -0800 (PST)
Path: arc1-ca.pugleaf.net!t13ni76751bkb.0!nntp.google.com!news1.google.com!goblin2!goblin.stu.neva.ru!news.nivel5.cl!not-for-mail
From: goldberd@vtr.net (goldberd)
Newsgroups: chile.comp.programacion
Subject: problema de textbox asp
Date: Mon, 27 Feb 2012 15:03:27 -0400
Organization: Usenet Chile.* http://usenet.no-ip.com
Lines: 93
Message-ID: <a436bb19341d8d2aafbe582cd16f5329$1@usenet.no-ip.com>
NNTP-Posting-Host: 190.163.71.147
Mime-Version: 1.0
X-Trace: news.nivel5.cl 1330365851 2722 190.163.71.147 (27 Feb 2012 18:04:11 GMT)
X-Complaints-To: news@news.nivel5.cl
NNTP-Posting-Date: Mon, 27 Feb 2012 18:04:11 +0000 (UTC)
User-Agent: NewsPortal/0.3X RCL MOD
X-Abuse: robertocl@gmail.com
X-HTTP-Posting-Host: 200.27.148.114