I have created a custom property ListName in a Visual web part that takes string as input.

I am using a check condition in page load and if that check fails, I want to clear the text box (custom property) values.

I tried using the below code but didn't work.

ListName="" ;

Is is possible to clear the property value on server side?

  • 1
    It should work with that code, can you please try putting it in CreateChildControls instead? – Robert Lindgren Oct 24 '14 at 9:16
  • @RobertLindgren This is odd. I had written a custom error using "WebPartPageUserException". I removed it and now the property is getting cleared on page load too. But thanks for the suggestion. – Thomas Mathew Oct 24 '14 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.