Hello,
I have the following user control called encabezado (I cut some parts
of the code to make it shorter):
public partial class Encabezado : System.Web.UI.UserControl {
private String n;
public Encabezado()
{
//
// TODO: Add constructor logic here
//
}
public String estado
{
get
{
return lbl_estado.Text.ToString();
}
set
{
lbl_estado.Text = value;
}
}
public String numero
{
get
{
return n;
}
set
{
n = value;
}
}
private void page_load()
{
mostrar_encabezado(n);
}
private void mostrar_encabezado(String numero)
{
//Here I have a SQL Query and then:
lbl_nro.Text = Request.QueryString["reclamo"].ToString();
lbl_sucu.Text = dt.Rows[0]["nombre_sucu"].ToString();
lbl_titulo.Text = dt.Rows[0]["titulo_rec"].ToString();
lbl_usuario.Text = dt.Rows[0]["usuario_rec"].ToString();
lbl_asignado.Text = dt.Rows[0]["asignado_a_rec"].ToString();
lbl_estado.Text = dt.Rows[0]["estado_rec"].ToString();
lbl_icono_asig.Text = "";
// later use these to make a table, but it's not usefull for this
context.
}
}
To use the control I do:
<hparis:encabezado ID="encabezado1" runat="server" />
On the code:
encabezado1.numero = Request.QueryString["reclamo"];
And it works. Even the labels (lbl_estado.Text) are printed correctly
according to the specified number.
But when I try to use encabezado1.estado (i.e.:
Response.Write(encabezado1.estado)) I receive an empty String.
I only can access to encabezado1.numero, but no the others. Why is that
?
What am I doing wrong ?
greetings,
hans