Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have custom control which is button and is configured to enable or disable for certain user groups with key value, i have over ridden the render event of custom control and checking weather user has access to this button and den render it.

i have grid and this custom control button which are placed inside the update panel and click event of this is not firing at all

but if i attach a JavaScript function to on-click attribute of that button, it does full post back, but i want partial post back, how to achieve it? below is my custom control button

C#
<pre>public class RBACButton : System.Web.UI.WebControls.Button
{

    private string _rbacKey;

    public string RbacKey
    {
        get { return _rbacKey; }
        set { _rbacKey = value; }
    }

    /// <summary> 
    /// Render this control to the output parameter specified.
    /// </summary>
    /// <param name="output"> The HTML writer to write out to </param>
    protected override void Render(HtmlTextWriter output)
    {
        //TODO the commented block below has to be uncommented
        bool hasAccess = RBACManager.Instance.HasAccess(_rbacKey);
        if(hasAccess)
            base.Render(output);
    }

}

}


What I have tried:

i've tried using async postback trigger, set update mode conditional, set viewstate enabeled=true, etc but couldnt achieve it
Posted
Comments
F-ES Sitecore 24-May-17 8:59am    
I'd start by removing your Render override to see if that fixes it. If it doesn't then the problem is elsewhere.
Member 12677894 25-May-17 2:41am    
i even tested by placing normal button but even that is not firing click event
there is required field validators in the page but i have set validation group for button, still doesn't post back, if i remove validation group, required field validators prevents post back and shows required field validator's error message
F-ES Sitecore 25-May-17 4:09am    
Updatepanels do work so if yours isn't working then it's something to do with code\markup that you haven't posted. All you've done is post a method but that's not the cause of your issue, it's either the markup or something else you haven't told us about.
Member 12677894 24-May-17 9:14am    
i even tested by placing normal button but even that is not firing click event
there is required field validators in the page but i have set validation group for button, still doesn't post back, if i remove validation group, required field validators prevents post back and shows required field validator's error message

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900