C# ASP.NET Clear TextBox on UserControl

Posted on 2009-12-27
Last Modified: 2012-05-08
I have a UserControl (rcRushReason) that I have placed in my default.aspx page for my website.  The UserControl (rcRushReason) has a textbox (txtReasonRush) in it that sometimes maintains text that I need to clear.  Is there a way I can click a button on default.aspx to clear the text in rcRushReason.txtReasonRush ?   I will be loading the user control (rcRushReason) with the same button click.
Question by:jamesdean666
    LVL 51

    Expert Comment

    maybe you can use findcontrol

    dim txt as TextBox = rcRushReason.FindControl("txtReasonRush")
    txt.Text = ""

    Author Comment

    Do you know what this would be in C#?
    LVL 51

    Accepted Solution

    should be

    TextBox txt = rcRushReason.FindControl("txtReasonRush");
    txt.Text = "";

    Author Closing Comment

    Yahtzee.... thanks.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Suggested Solutions

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now