Click here to Skip to main content
15,916,379 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
I am trying to empty a textbox..when i compile my code..it give an error say Can not implicitly convert string to System.web.UI.Webcontrols.Textbox.
LatestUpdate.ascx code
<panel runat="server" id="pnlStatur">
<asp:TextBox ID="txtWhatsOnYourHeart" runat="server">

Code Behind
LatestUpdates.ascx.cs
protected void btnPost_Click(Object sender, EventArgs e)
{LatestUpdate();
txtWhatOnYourHeart=Empty.string; }
Posted

1 solution

Probably you mean that txtWhatOnYourHeart is the text box you want to clean. But then this is not string, this is a text box, a type unrelated to string; txtWhatOnYourHeart.Text is string.

—SA
 
Share this answer
 

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