RadTextBox Text Property

4 posts, 0 answers
  1. Richard
    Richard avatar
    14 posts
    Member since:
    Apr 2011

    Posted 10 Nov 2011 Link to this post

    I'm trying to use a RadTextBox.

    I've got code like this in the Page_Load event handler:

     

     

    if (!IsPostBack)

     

    {

        RadTextBox1.Text = "1";
    }


    This correctly sets the value of the text box control.  However, if I type something else into it on my web page, when I read the value of the text box by looking at the Text property in an event handler from an OnClick event on an ImageButton I get the original value that was set, not the value I have typed into the text box.

    If I replace it with a standard ASP.NET text box, it works as expected, and I can read the value I have typed. This also only seems to happen on one of my pages.  I've got another similar page that uses a RadTextBox and works. 

    Is there anything that might cause this issue?

    Kind Regards, Richard
  2. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 10 Nov 2011 Link to this post

    Hi Richard,

    Can you show us an example of your code in full context?

    You can also try the client object get_value.
    http://www.telerik.com/help/aspnet-ajax/input-client-side-radtextbox.html

    Thanks,
    JIm
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Richard
    Richard avatar
    14 posts
    Member since:
    Apr 2011

    Posted 10 Nov 2011 Link to this post

    Thanks Jim

    I have actually just managed to solve this literally 1 minute ago.  It was nothing to do with the control or the page - I'd noticed the page_load event was being fired twice and tracked this down to a bug in some URL rewriting logic which was causing the axd file that is posted back to to be rewritten with the URL of the page which confused everything.

    Kind Regards, Richard
  5. James Campbell
    James Campbell avatar
    90 posts
    Member since:
    Jul 2012

    Posted 14 Nov 2011 Link to this post

    Richard,

    Exactly what I was thinking but without your code hard to assume, glad you solved your issue.

    Thanks,
    Jim
Back to Top