O.o The answer to your question is yes, but I do not agree with this approach.
You must declare your string variable outside of all your methods and place it in the body of your class.
public partial class foo
{
public string lname;
}
You should then be able to access the value from your ui.
Personally i would just rewrite the form:
Last Name: <asp:TextBox id="lname" CssClass="inputStyleA" runat="server" />
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
{
lname.Text = "foo";
lname.Attributes.Add("onChange", "this.value = initialCap(this.value);");
}
}
Course that is just me.
hth.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========