C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




5


Posted Date: 06 Sep 2008      Total Responses: 2

Posted By: Barani       Member Level: Silver     Points: 1



5




Responses

Author: Kumar R    06 Sep 2008Member Level: GoldRating:     Points: 2


after submitting the button clear the textbox

textbox1.text=""




Author: varun    06 Sep 2008Member Level: GoldRating:     Points: 6

There are two approach for this:

1. Client Side:
If you want to clear the textbox as soon as user click the button without going to server side then use javascript:

add one attribute to button like this:


<asp:Button id="btn" runat="Server" OnClientClick="return refresh(<%=txtbox.ClientId%>);" />



Add a javascript function refresh like this:



function refresh(opt)
{

document.getElementById(opt).value="";

//if you just want to clear the text and no postback then write this
return false;
//if you requre post back write return true;
}


2. Second wayout is at server side.
When page is posted back, on button_Click event write

txtbox.Text="";



Post Reply
You must Sign In to post a response.
Next : 5
Previous : 4
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use