Check for ASP textbox form null value?

Hey guys.
I’m making a survey form with ASP .NET and I am trying to use an if / else statement to write out “None” if the visitor leaves the feedback textbox null or empty.

My question is…
How do I go about writing this if statement? I tried doing

if (feedback.Text = "") {
   **action here**

but that didn’t work. the error message said it couldn’t implicitly convert string to bool.

more info is that I am using an asp label to write out “none” at the bottom of the page when the textbox is empty
the textbox is an asp textbox with an id called “feedback”

Thanks in advanced

Use == instead of = in your if statement.

ahh. A noob’s mistake. Thank you!

I knew what to look for because I’ve done it about half a million times.

I prefer doing it like this:

if (String.IsNullOrEmpty(feedback.Text))

I do as well. I should have mentioned it. :slight_smile: