locked
Disable (Enable=false) didn't work RRS feed

  • Question

  • User-218479044 posted

    Hi,

    I create a webform with a FormView and 1 ItemTemplate (that will function also as EditItemTemplate and InsertItemTemplate), and i change LabelBoundField to TextBoxBoundField (so user can enter the information). also I add some button like Insert, Edit, Save, Cancel.

    First Time running (Page Load), i call function to make all TextBoxes to disable, and it works.

    On Insert Button, i call ChangeMode to Insert then i call function to make all TextBoxes to enable, and it works.

    On Edit Button, i call ChangeMode to Edit then i call function to make all TextBoxes to enable, and it works.

    On Save button, i haven't written the code.

    On Cancel button, i call ChangeMode to ReadOnly then i call function to make all TextBoxes to disable, however it didn't works, all Textboxes are still Enable. and will disable if i press cancel button one more time.

    How to overcome this ?

    Thanks.


    Thursday, January 27, 2011 5:55 AM

Answers

  • User-218479044 posted

    Hi Nizam,


    Thanks for your reply. i have got the answer. Just need to issue DataBind command after ChangeMode to ReadOnly. then it worked as expected.


    Regards,

    Andy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 28, 2011 3:52 AM

All replies

  • User-1465674731 posted

    first of check what code u have in ur aspx file for formview,  have you configure cancle event from designer? that will reflect on you aspx page you might want to review it. It seems for the first time event goes empty and then in second call it executes the code which you have written to disable the text boxes.


    In the Form View the way you have Insert, Edit mode , you can also have Read-Only, so try to set FormView in read only mode

    if that doesnt solve the problem can you post your code here so that we can take a look in detail

    Thursday, January 27, 2011 7:10 AM
  • User-218479044 posted

    Hi Nizam,


    Thanks for your reply. i have got the answer. Just need to issue DataBind command after ChangeMode to ReadOnly. then it worked as expected.


    Regards,

    Andy

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 28, 2011 3:52 AM