0

I have a button in my page, which when clicked makes visible (using back-end code) a Login Control. However, it doesn't just appear as I would wish, it actually flickers onto the page which is quite annoying.

Is there any way to prevent this?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Andre C
  • 457
  • 1
  • 9
  • 26

1 Answers1

2

Have you considered using JavaScript instead???

Example:

<script type="text/javascript" src="Scripts/jquery-1.7.2.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#myb").click(function () {
            $("#login").toggle();
        });
    });
</script>

<input type="button" id="myb" value="show/hide" />
<asp:Login runat="server" ID="login" DestinationPageUrl="~/Default.aspx" 
     .....
Jupaol
  • 21,107
  • 8
  • 68
  • 100
  • @Andre: the reason you got "flicker" is that you got a postback. Your browser had to redisplay the page entirely. This answer shows how to do it entirely on the client side, so, no postback and no "flicker". – John Saunders Aug 11 '12 at 03:53