I'm trying to pass the variable <asp:Image ID="imgEstadoRegistro" runat="server">
to the method CheckUserExists(EstadoImagen As Image, EstadoRegistro As String)
that is in another class and I miss this error.
The method image CheckUserExists(EstadoImagen As Image, EstadoRegistro As String)
comes from Imports System.Drawing
Asp class Login
<asp:TextBox ID="tbUsuarioRegistro" runat="server" CssClass="textoLogin" Height="25px" placeholder="Usuario..." Width="150px" AutoPostBack="true" OnTextChanged="checkUserExists"></asp:TextBox>
<asp:Image ID="imgEstadoRegistro" runat="server" Height="25px" ImageAlign="AbsMiddle" Width="25px" />
Click handle UserHelper (problem in the variable "imgRegistrationState")
Protected Sub checkUserExists(sender As Object, e As EventArgs) Handles tbUsuarioRegistro.TextChanged
Dim cadenaConexion As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("DSN").ConnectionString)
UsuarioHelper.CheckUserExists(ConfigurationManager.ConnectionStrings("DSN").ConnectionString, tbUsuarioRegistro.Text().Trim(), imgEstadoRegistro, lbEstadoRegistro.Text)
End Sub
Method to check if the user exists
Public Shared Function CheckUserExists(CadenaConexion As String, Usuario As String, Imagen As Image, LabelEstado As String)
If (Usuario.Length >= 8) Then
Dim parUsuario As New SqlParameter("@usuario", Usuario)
Dim consulta As String = "select usuario from Usuarios where usuario = @usuario"
Dim objDS As DataSet = SqlHelper.ExecuteDataset(CadenaConexion, CommandType.Text, consulta, parUsuario)
If (objDS.Tables(0).Rows(0).Item(0)) Then
Imagen = Image.FromFile("\css\images_css\ic_cancel_black_24dp_1x.png")
Else
Imagen = Image.FromFile("\css\images_css\ic_check_black_24dp_1x.png")
LabelEstado = ""
End If
Else
LabelEstado = "El usuario tiene que tener 8 caracteres minimo"
Imagen = Image.FromFile("\css\images_css\ic_cancel_black_24dp_1x.png")
End If
End Function
Thanks for everything, greetings.