Question

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}

Was it helpful?

Solution

Add this on your else statement:

mpe1.Enabled = false
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top