You must Sign In to post a response.
  • Category: ASP.NET


    I have a rich text box which is modified into a rich text editor using a free editor...

    I have to insert the details which is keyed in the Textbox with multiline mode by the user and it has to be stored in the database. The inserting details to the database is working fine... My problem is I have to check the Textbox for null .. that means if the user is not entering anything in the Textbox and pressing enter... a null value is getting inserted in the table column.

    I am calling the method which inserts the details into the DB in the button click event of the submit button.I tried checking the Textbox against the null value like below

    if(txtRichText.Text != null)

    but it is not working fine ...

    I want the InsertComments method to be called only when the user has entered some text in the multiline textbox.

    Please help me with ideas.

  • #594697
    try this code

    If(txtRichText.Text != "")

    hope this will help you

  • #594726
    Please find the code

    if(txtRichText.Text.Trim() != " ")

    All is well.
    Try and fail but don't fail and try

  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.