Question

My code is to insert the text from textbox, I did my code well but I want to empty the textbox before ModalPopupExtender show. I did my code but It didn't work.

 protected void Btn_monthlyemployee_Click(object sender, ImageClickEventArgs e)
{
    var Comment = (TextBox)((ImageButton)sender).Parent.FindControl("txt_monthlyemployee");

    ftier.Addcomment(LblMonthlyPID.Text, LoggedUserID, txt_monthlyemployee.Text, DateTime.Now, DateTime.Now, false);

    Comment.Text = string.Empty;
    ModelExtenderPost.Show();


}
Was it helpful?

Solution

You don't have provided enough information although i am giving you some good techniques to resolve this

Your code should be work i don't know why its not working

You can have a jquery method

when your button clicked

$('#idofmonthlyeployeed').click(function()
{
      $('#commentboxid').val('');
      return false;   
});

You can see working example here Fiddle

Or you can have a update panel issue if you don't have triggered button of your idofmonthlyeployeed

So please add trigger of idofmonthlyeployeed

I hope this will help you regards.....:)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top