Hi all,
I have a UserControl called 'Inspirations' with the following public property
private int pagenumber;
public int PageNumber
{
get { return pagenumber; }
set { pagenumber = value; }
}
On my aspx page I set the value of the property like so:
Inspirations.PageNumber = (int)Convert.ToInt32(this.txtNum.Text);
On my aspx page I write back the value to check its been set:
Response.Write(Inspirations.PageNumber.ToString());
...and it has on my aspx page.
However, I have a button on my UserControl to test the value of PageNumber and when I click that it always comes back as zero.
protected void btnAddCompany_Click(object sender, EventArgs e)
{
Response.Write(PageNumber.ToString());
}
...the property value doesn't seem to have been passed back to my control.
Can anyone tell me what I'm doing wrong, please.
Regards Melt