Click here to Skip to main content
16,019,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All.

I am trying to do something like this:
<asp:TextBox ID="txtTest" runat="server" Text='<%=strText%>' ToolTip='<%=strToolTip%>'>

Where the variables strText and strToolTip are as follows:
public partial class _default : System.Web.UI.Page
{
  public string strToolTip = "Test ToolTip";
  public string strText = "Aniruddha";

  protected void Page_Load(object sender, EventArgs e)
  {
  }
}

Is this possible?

I don't want to Assign these properties from the .cs/code behind page. I want to assign them from the .aspx page.

Please advise.

Thanks in Advance,
Aniruddha
Posted
Updated 4-Jul-11 6:09am
v4

1 solution

Why not do it like this?

C#
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);

    txtTest.Text = strText;
    txttest.ToolTip = strToolTip;
}


or am I missing something?
 
Share this answer
 
Comments
aniruddhaghoshal 4-Jul-11 11:36am    
Hi digital man.

Thanks for the prompt reply.

I don't want to assign the property through the .cs file. I want to assign it from the .aspx page. I have re-phrased my question.

thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900