G
Guest
hi guys
following on from my previous post. ive got this strange error now. my user
control has the following property defined...
private string theSQL;
public string contactSQL
{
get { return theSQL != null ? theSQL : "na"; }#
set { theSQL = value; }
}
then in my ascx.cs page_load (for the control), ive got
contactSQL = "test";
now then, ive got in my aspx page..
protected dartsUC_contactsearch dartsUC_contactsearch1;
if i try
response.write(dartsUC_contactsearch1.contactSQL); from my aspx.cs
page_load, i get "na" on screen.
however, if i try <%= dartsUC_contactsearch1.contactSQL %>, i get "test" on
screen.
It's like the aspx page_load is happening before the ascx page_load,
therefore theres nothing in contactSQL, but when it runs the html inline,
page_loads have finished and all's well. however, I need access to the
contactSQL variable in my codebehind to execute the sql statement.
How can I fix this? any help aprpeciated!
cheers
Dan
following on from my previous post. ive got this strange error now. my user
control has the following property defined...
private string theSQL;
public string contactSQL
{
get { return theSQL != null ? theSQL : "na"; }#
set { theSQL = value; }
}
then in my ascx.cs page_load (for the control), ive got
contactSQL = "test";
now then, ive got in my aspx page..
protected dartsUC_contactsearch dartsUC_contactsearch1;
if i try
response.write(dartsUC_contactsearch1.contactSQL); from my aspx.cs
page_load, i get "na" on screen.
however, if i try <%= dartsUC_contactsearch1.contactSQL %>, i get "test" on
screen.
It's like the aspx page_load is happening before the ascx page_load,
therefore theres nothing in contactSQL, but when it runs the html inline,
page_loads have finished and all's well. however, I need access to the
contactSQL variable in my codebehind to execute the sql statement.
How can I fix this? any help aprpeciated!
cheers
Dan