C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

How to clear an label message on button click in javscript


Posted Date: 07 Nov 2009      Posted By: kumar      Member Level: Gold     Points: 1   Responses: 4



hi,
i have an form with controls once i click my save button data is getting inserted to DB. and i am showing an messahe telling data saved successfully. and i am in the save page. now again user clciks the save button .

i getting required field valdation message telling required. but still my success message data inserted successfully is shown.
how can i avoid this problem once i click the save button i should clear the label message in javascript. how can i achive this functionality

thank you





Responses

Author: Satinder Kumar    07 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

write the code to clear the label on the page load out side the not ispostback condition

label1.text=""
if not ispostback then
'other code goes here
end if



Author: SuganyaCMR    07 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

hi,

you are given the label text field as "inserted suc..." like this. first empty the message in the property window.
and in the save button click event type a message as
label.text="......";
so you can solve the above problem

Regards,
Suganya

In order to succeed, you must first be willing to fail!
Rate my post!.If u found useful



Author: kumar    07 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

hi thanks for the replay right now i am doing like that only.
but still i am not able to clear the success message when Required field valdations fails



Author: Arun K    09 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

you can write js for clear that label

function ClearLabel()
{

document.getElementById("<%=labelName.ClientID %>").InnerHtml=""

}

Regards:
Arun K
.NET Developer
http://aruninnice.blogspot.com/
Bangalore
Do not forget to Rate the post...



Post Reply
You must Sign In to post a response.
Next : ASPxGridView Popup Edit Form for Spin Edit column
Previous : Error in uploading images in folder at server
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use