Click here to Skip to main content
15,897,090 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when i call the

txtFName.clear();

it give an error due to clear() tell me which library are used for clear()
Posted
Comments
sasanka sekhar panda 31-Jul-15 0:55am    
Its a windows or web app
Altaful Haq 31-Jul-15 0:56am    
web asp.net

From the name, txtFName seems to be a Textbox. If it is so then to clear it you can use-
C#
txtFName.Text=string.Empty; //or just "" 


If txtFName is a List or Array or Dictionary then it is perfectly fine as Clear() is available for them.

Hope, it helps :)
 
Share this answer
 
v3
txtFName.clear() is ok for windows application.

For web application you have to use
txtFName.Text="";
 
Share this answer
 
public void clear()
{
>txtFName.Text="";
}


atwhich place u need to clear just call

clear();


I think it may help you

or

you may gowith
txtFName.Text=string.Empty;
 
Share this answer
 
v3

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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