Unable to Get "Text" Value from Disable Textbox

Discussion in 'ASP .Net Web Controls' started by John Walker, Oct 13, 2005.

  1. John Walker

    John Walker Guest

    Hi,
    On the postback I am trying to get data from a TextBox control in a
    Datagrid. This works fine except when the textbox has been disabled using
    JavaScript. Here's the code to reference the control and get the text:

    Dim txt As TextBox = CType(dg.Items(iMisc).FindControl("txtCustomer"),
    TextBox)
    Dim sCustomer As String = txt.Text

    txt.Text will be blank if the textbox was disabled. Here's the javascript:

    dml[sPrevboxid].disabled=true;

    Are we not allowed to use JavaScript to disable datagrid textbox controls if
    we want to reference the text on a postback?

    Thanks, John
     
    John Walker, Oct 13, 2005
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. moid
    Replies:
    1
    Views:
    461
    nfedin
    Jan 27, 2004
  2. John Dalberg
    Replies:
    1
    Views:
    3,223
  3. VB Programmer

    Wierd: Can't get .text value of textbox

    VB Programmer, Aug 31, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,274
    VB Programmer
    Aug 31, 2004
  4. ErwinP
    Replies:
    1
    Views:
    817
    ErwinP
    Aug 19, 2005
  5. John Walker

    Unable to Get Text from Textbox Control

    John Walker, Oct 20, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    263
    John Walker
    Oct 21, 2005
Loading...

Share This Page