views:

72

answers:

1

Hi,

I have a page with some disabled controls, it looks like this

<form id="form1" runat="server" submitdisabledcontrols="true">
    <asp:UpdatePanel ID="upp" runat="server">
        <ContentTemplate>
            <asp:TextBox ID="textbox1" runat="server"  AutoPostBack="True" ontextchanged="textchaged_handler" />        
            <asp:TextBox ID="textbox2" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ImageButton ID="ibVerify" runat="server" OnClick="btnVerify_Click" ImageUrl="~/img/imagebutton.png" AlternateText="Verify" />
</form>

Programatically, the second textbox is disabled with some server side code, during initialization.

The problem is that, even setting submitdisabledcontrols="true" in the form tag, the disabled textbox value isn't submited to the server when I click the ImageButton. I checked this with firebug, and also in VS, where the old value is retrieved.

When I press TAB in the first textbox, however, the second textbox value gets posted, no matter submitdisabledcontrols is set or not...

Any ideas?

A: 

Hey,

That form attribute states that "Gets or sets a Boolean value indicating whether to force controls disabled on the client to submit their values.", so I think you need to use the client-side disabled property, not the server-side ENabled property, as in:

<asp:TextBox .. disabled="disabled" />
Brian
Both server-side Enabled=false and your code render to disabled="disabled" in HTML... and neither works
lgomide
Enabled should be true; it cannot be false.
Brian