.NET Framework - onTextChanged no funciona

Asked By juancho
17-Nov-09 11:58 PM
Hola, estoy con el siguiente problema y no he podido solucionarlo.
Tengo el formulario de registro e intento chequear el nombre usuario a
medida que se ingresa generando un onTextChanged=3D"Username_Changed" si
existe o no en la base de datos. Todo esto funcionaba perfecto, hasta
que pase a usar un MasterPage. Ahora solo realiza el chequeo en la
base de datos cuando salgo del textbox o cliqueo fuera de este. Lo
mismo pasa con un script el cual dej=F3 de funcionar. Paso la parte del
codigo que puede ayudarlos:

En master page no hay codigo.
Inherits=3D"Principal" %>
....



-----------------
Aqu=ED hay un codigo javascript para avisar al usuario que se esta
chequeando si existe el usuario, el cual tampoco funciona.

AutoEventWireup=3D"false" CodeFile=3D"RegistroUsuario.aspx.vb"
Inherits=3D"RegistroUsuario" %>

Runat=3D"Server">
// Hook the InitializeRequest event.
// Sys.WebForms.PageRequestManager.getInstance
().add_initializeRequest(InitializeRequest);

function InitializeRequest(sender, args) {
// Change div's CSS class and text content.
$get('UserAvailability').className =3D 'progress';
$get('UserAvailability').innerHTML =3D 'Checking
availability...';

}

id=3D"UsernameTxt" AutoPostBack=3D"true" OnTextChanged=3D"Username_Changed"=
/

runat=3D"server" id=3D"UserAvailability"></div>

--------------------------------

RegistroUsuario.aspx.vb


Public Sub Username_Changed(ByVal sender As Object, ByVal e As
System.EventArgs)
'UserAvailability.InnerHtml() =3D ""
If UsernameTxt.Text.Length <=3D "7" Or UsernameTxt.Text.Length
UserAvailability.InnerHtml() =3D "El nombre de usuario debe
tener entre 8 y 12 letras o n=FAmeros"
Else
Dim conn As SqlConnection
Dim comm As SqlCommand
Dim Reader As SqlDataReader
..... y el resto del codigo. el cual funciona

---------------------


Espero haber sido claro, muchas gracias!
SqlDataReader
(1)
SqlConnection
(1)
SqlCommand
(1)
EventArgs
(1)
InitializeRequest
(1)
InnerHTML
(1)
Reader
(1)
Load
(1)
  Jaime Andres replied to juancho
19-Nov-09 01:31 PM
Hola,
has probado colocar la parte de c??digo del script en el masterpage

saludos
  juancho replied to Jaime Andres
20-Nov-09 04:19 AM
i
ain" runat=3D"server">
r"
s';
g
xes"
ged"/
.Length
usuario debe

Acabo de solucionarlo, costo bastante.. dejo el resultado por si
alguien le sirve.
Primero se crea el atributo al textbox para que lo reconozca el script
en el Page_Load.
Agrego un update panel donde hay un div donde voy a mostrar que se
esta buscando el nombre y el resultado de la busqueda, y un boton para
Create New Account
help
SqlConnection vs IDbConnection .NET Framework I normally use SqlConnection, SqlDataReader, SqlCommand for most of my queries but recently a friend of mine who is a long IDbCommand interfaces because the queries where compiled instead of just executed like on the open SqlConnection. Is he correct and if so does it really make a difference as far as performance / security, etc? Thanks for any suggestions C# Discussions IDbConnection (1) SqlConnection (1) IDbCommand (1) InvalidOperationException (1) DbProviderFactories (1 SqlDataReader (1) DbProviderFactory (1) SqlCommand (1) JoeW, No, he isn't correct. IDbConnection, IDbCommand, and the like are just interfaces
sqlcommand timeout in field .NET Framework Ok, got a SQL timeout occuring in the field that run time for this query is sub-second. App is .NET 2, C#, using the SqlConnection / SqlCommand / SqlDataReader classes. As stated below, the query runs fine inside Query Analyzer at the client site count(*) = 1)" - runs in less than a second in the same Windows app C# Discussions SqlDataReader (1) SqlConnection (1) SqlCommand (1) Site (1) Report (1) Pickingdetail (1) Pickingorder (1) Windows (1) Are you sure that and not in the connection.Open() that (presumably) you are doing right before executing your SqlCommand? If this were the development environment you could find out with the debugger, but if
Can I retrieve a SqlDataReader from a SqlConnection object? .NET Framework Is it possible to retrieve an SqlDataReader object (if one exists) from the SqlConnection object or the SqlCommand object with which it is associated? Thanks in advance ADO.NET Discussions SQL Server (1) SqlDataReader (1 SqlConnection (1) SqlCommand (1) DataTable (1) Visual (1) Ah, sure. But it's not really an "object" like
2005 database which I use from ASP.NET 2.0. I invoke stored procedures using SqlConnection, SqlCommand and SqlDataReader from System.Data.SqlClient. When I invoke a SP from SQL ServerManagement Studio it executes in 3 seconds and returns 4000 rows. When the same procedure is invoked from SqlCommand.ExecuteReader it takes more than 30 seconds an sometimes renders a timeout in .NET. In ADO.NET Discussions SQL Server 2005 (1) GetRRSelOrgShowKonto (1) Visual Studio (1) CommandType.StoredProcedure (1) SqlCommand.ExecuteReader (1) DataTableReader (1) SqlDataAdapter (1) SqlDataReader (1) Let's see the code you're using to execute the query via SqlClient ekdb1.int.lio.se;database = dlpe;uid = d_dlekonomi_u1;pwd = yyy;" / - -> (I have used the approach SqlDataReader = SqlCommand. . ExecuteReader(); with the same result too) The time is spent in adapter.Fill(). A) I
disposing SqlCommand and SqlConnection .NET Framework I'd love to get some definitive advice about calling Dispose() on SqlCommand and SqlConnection in .NET 2.0. There's a lot of confusing advice out there in the net. From what I read and see in Reflector, SQLCommand doesn't do anything special with Dispose. Calling Dispose() on it doesn't do much be good discipline since in some future version it might be important. With respect to SqlConnection, it gets more complicated. Two issues: 1. I often use the pattern for ExecuteReader with closes the reader, thus closing the connection. There's no good opportunity to Dispose the SqlConnection. If Disposing is important, then I don't see how to use this pattern. 2. There are several posts that say that if a SqlConnection is Disposed, then it won't be released to the ConnectionPool. If you want the