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

    RichTextBox

    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)
    {
    InsertComments(clientVO);
    }

    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.

    Regards
    Srividhya
  • #594697
    try this code



    If(txtRichText.Text != "")
    {
    InsertComments(clientVO);
    }



    hope this will help you

  • #594726
    Please find the code

    if(txtRichText.Text.Trim() != " ")
    {
    InsertComments(clientVO);
    }

    All is well.
    Thanks,
    Dharma
    Editor,Mentor,MVM
    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.