locked
display an asp button from master page when jquery is executed? RRS feed

  • Question

  • I am new bee to jquery and asp .net field.

    I was given a task of displaying the login button when a jquery is executed .The button is already present on the master page.

    Can any one explain how to do this task?That will be of great help if any one helps me how to do this?

    Responsible replys are greatly appreciated.

    • Moved by Jason Dot Wang Wednesday, November 28, 2012 2:46 AM This thread is about ASP.NET (From:Visual C# General)
    Tuesday, November 27, 2012 12:44 PM

All replies

  • You probably should ask it on ASP.Net forums, will get a better support. http://forums.asp.net/

    But i think, you can do something like this

            $(document).ready(function () {
                $('#yourButtonID').hide(); // or show() if you want it appear.
    
            });



    If you get your question answered, please come back and Alternate TextMark As Answer.
    Web Developer

    Tuesday, November 27, 2012 1:44 PM
  • Hi, Could you tell me you're using Asp.net web form or Asp.net mvc ?

    If Asp.net webform, you could write like this:

    $(document).ready(function(){
    $("#<%=loginButton.ClientID%>").show();
    });

    <loginButton> is server control's name.

    If Asp.net mvc, you could write like this

    $(document).ready(function(){
    $("#loginButton").show();
    })

    <loginButton> is client button's id.


    Tuesday, November 27, 2012 3:43 PM
  • Hi, Could you tell me you're using Asp.net web form or Asp.net mvc ?

    If Asp.net webform, you could write like this:

    $(document).ready(function(){
    $("#<%=loginButton.ClientID%>").show();
    });

    <loginButton> is server control's name.

    If Asp.net mvc, you could write like this

    $(document).ready(function(){
    $("#loginButton").show();
    })

    <loginButton> is client button's id.



    Even if it is asp web form, he could do as i show.

    If you get your question answered, please come back and Alternate TextMark As Answer.
    Web Developer

    Tuesday, November 27, 2012 3:48 PM
  • If the button already exists on the page, what do you need to do?

    Is it hidden? If yes, use it's ID to show it with jquery.

     

    Noam B.



    Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...

    • Proposed as answer by Noam B Tuesday, December 18, 2012 10:34 PM
    Tuesday, November 27, 2012 5:55 PM
  • Hi HERO1234567,

      Welcome to MSDN Forum Support.

      You are more likely to get more efficient responses to ASP.NET issues at http://forums.asp.net where you can contact ASP.NET experts.

      Sincerely,

      Jason Wang


    Jason Wang [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, November 28, 2012 2:46 AM