3

I am exporting an asp.net gridview to an excel sheet by Response.Write(*stringBuilder*), but when the button is clicked TextBoxesare losing TextBoxWatermarkExtender Text. Any idea? Thanks.

Prateek Singh
  • 863
  • 1
  • 8
  • 28
B10
  • 173
  • 1
  • 11
  • I think that after the export button is clicked and processed, the ajax watermarkextender should be recalled by javascript in code behind. Can anybody help please? – B10 Jul 07 '12 at 09:22
  • Depending on how your page is laid out, the response.write may be placing code above the doctype definition. When that happens it can cause issues with javascript execution. Just a thought. – CoderMarkus Aug 11 '12 at 01:31
  • are you using an update panel ? – Syed Umar Ahmed Aug 23 '12 at 10:12
  • Yes I am using 2 update panels. One outer one for the whole page and an inner one for the export button which has a trigger: The TextBox and its TextBoxWatermarkExtender are in the outer updatepanel. – B10 Aug 24 '12 at 12:48
  • Hi... I still need to solve this issue. Anyone? – B10 Sep 20 '12 at 14:51

1 Answers1

1

There is a problem in your CSS... Work Like This..

.yourWatermarkedClass

{

color: Black;
font-family: Arial;

font-size: 11px;
border: solid 1px #a9a9a9;

text-indent:2px;
vertical-align:middle;

text-align:right;
background-image:url(../images/yourfileName.png);

background-repeat:no-repeat;
}
j0k
  • 22,600
  • 28
  • 79
  • 90
Muhammad Azeem
  • 479
  • 1
  • 5
  • 20
  • Thanks but I don't see how your answer is related. The TextBoxWatermarkExtender does work. It stops displaying its text after the print button is clicked. – B10 Aug 29 '12 at 09:23