Getting RadMaskedTextBox Client Object on other Page.

4 posts, 0 answers
  1. Shahid
    Shahid avatar
    12 posts
    Member since:
    May 2009

    Posted 17 May 2009 Link to this post

    Hi,

    I have a RadMaskedTextBox on Page A.aspx, I navigated to some other Page B.aspx with the Id of RadMaskedTextBox of Page A.aspx.
    Now I need to get the client side object of RadMaskedTextBox on page B.aspx to manipulate its value.

    I can not use
    var maskedTextBox = $find("
    <%= RadMaskedTestBox1.ClientID %>");
    because, the control is not on page B.aspx.
    Is there a way to achieve, what I am trying to do..?
  2. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 20 May 2009 Link to this post

    Hello Shahid,

    You should pass the value of textbox control to next page(in query string for example) before navigating from one page to another. When you navigate away from one page it is destroyed and you cannot manipulate any control on the previous one.

    You will have same experience with regular asp TextBox server control or any other control.

    Kind regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Shahid
    Shahid avatar
    12 posts
    Member since:
    May 2009

    Posted 20 May 2009 Link to this post

    Hi Nikolay,

    Let me explain you the problem once again. I have a RadMaskedTextBox, and a normal asp textbox on an aspx page. These controls should be filled by the data from PopUp window  and not manually.Now for populating the normal asp textbox I have used this
    in the popup window

    var openerPage = contentWindow.document; 
    var textBox = openerPage.getElementById(textBoxID);//textBoxID is the ID of normal asp textbox send to PopUp window through query string

    after getting the object of normal asp textbox I am able to assign the data from popup window to the textbox on aspx page.
    I have tried this for the RadMaskedTextBox also, I am able to get its object, although it do not have all the methods/Properties so that I could set its value from PopUp window.

     

     

     

      
    in the PopUp window I can not use 
    var maskedTextBox = $find("<%= RadMaskedTextBox1.ClientID %>");
    because the control is not on Popup Window page.

    Is there any way to get the object of RadmaskedTextBox1 on PopUp window and populate its value from there..?

  4. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2289 posts

    Posted 25 May 2009 Link to this post

    Hello Shahid,

    What do you mean by saying that you cannot use $find to get client object reference?
    RadMaskedTextBox as IScriptControl has client object and as such to get reference to that client object you should use $find.

    Kind regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top