0

This is a weird one...

On my webform I have a linkbutton. Depending on a value pulled from the database, this button is either enabled or disabled. The linkbutton launches a modal dialog.

The problem is when the linkbutton is set to enabled=false, the modal popup still fires if the text is clicked on my production server. On my development server (locally using VS2010), the button behaves properly.

The code:

if status = "closed" then
lnkButton.enabled = true
else
lnkbutton.enabled = false
end if

This is admittedly a weird one and I'm tearing my hair out on it...

EDIT

Code in the ASPX page:

        <div style="text-align:right;margin-top:-20px;">
        <asp:LinkButton ID="lnkPopup" Enabled="false" Text="Change End Date" runat="server" />
    </div>

    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>

    <asp:ModalPopupExtender ID="mpe1" PopupControlID="pop1" BackgroundCssClass="Overlay"
     TargetControlID="lnkPopup" runat="server" CancelControlID="btnCancel" />

{actual popup excluded for brevity}

Tim
  • 4,051
  • 10
  • 36
  • 60
  • The disabled of the linkbutton is disable the post back, not the javascript call that you may do and open the pop up. – Aristos Mar 08 '13 at 21:08
  • 1
    Try to make also `mpe1.visible = false` when you make `lnkbutton.enabled = false` – Aristos Mar 08 '13 at 21:14

1 Answers1

0

Add this on your else statement:

mpe1.Enabled = false
Praveen Nambiar
  • 4,852
  • 1
  • 22
  • 31