reading a label from an user control

  • Thread starter Thread starter Hans
  • Start date Start date
H

Hans

Hello,

It looks like my previous post was deleted. So here is again:

I have this user control called "encabezado" (I cut the code to make it
shorter):

public partial class Encabezado : System.Web.UI.UserControl {
private String n;
private String esta;

public Encabezado()
{
//
// TODO: Add constructor logic here
//
}
public String estado
{
get { return esta; }
set { esta = 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 later:

lbl_nro.Text = Request.QueryString["reclamo"].ToString();
lbl_estado.Text = dt.Rows[0]["estado_rec"].ToString();
lbl_icono_asig.Text = "";

esta = lbl_estado.Text;

// and these labels I use to display a table.

}
}

I use my user control on a file called "mostrar.aspx" as folows:

<hparis:encabezado ID="encabezado1" runat="server" />

On the codefile:
encabezado1.numero = Request.QueryString["reclamo"];


An it works. All the labels are printed correctly according to the
number on the QueryString["reclamo"].

When I try to use Response.Write(encabezado1.estado) in the file
"mostrar.aspx", it returns an empty String; but when I use

Response.Write(encabezado1.numero) it returns the correct number.

Why can't I use encabezado1.estado ? What I'm doing wrong ?

greetings,

hans
 
Back
Top