You must Sign In to post a response.
  • Category: ASP.NET

    How to use javascript button in asp.net

    i have one login page with in JavaScript button .. how to use login page with connection sql server
    there are no coding show if i double click
    my page there.. how to use login and sign button ??

    <header class="codrops-header">
    <h1>YOGESH WEBSITE LOGIN</h1>
    <p>for example</p>
    <nav class="codrops-demos">
    <a class="current-demo" href="index.html">Login/Signup</a>

    </nav>
    </header>
    <section>
    <p>Click one of the buttons below to see a <strong>modal dialog</strong>:</p>
    <div class="mockup-content">
    <p>Pea horseradish azuki bean lettuce avocado asparagus okra.</p>
    <div class="morph-button morph-button-modal morph-button-modal-2 morph-button-fixed">
    <button type="button">Login</button>
    <div class="morph-content">
    <div>
    <div class="content-style-form content-style-form-1">
    <span class="icon icon-close">Close the dialog</span>
    <h2>Login</h2>
    <form id = "Login">
    <p><label>Email</label><input type="text" id ="Email" /></p>
    <p><label>Password</label><input type="password" id ="Password" /></p>
    <p><button value ="submit" onclick= "clicked()">Login</button></p>
    </form>
    </div>
    </div>
    </div>
    </div><!-- morph-button -->
    <strong class="joiner">or</strong>
    <div class="morph-button morph-button-modal morph-button-modal-3 morph-button-fixed">
    <button type="button">Signup</button>
    <div class="morph-content">
    <div>
    <div class="content-style-form content-style-form-2">
    <span class="icon icon-close">Close the dialog</span>
    <h2>Sign Up</h2>
    <form>
    <p><label>Email</label><input type="text" /></p>
    <p><label>Password</label><input type="password" /></p>
    <p><label>Repeat Password</label><input type="password" /></p>
    <p><button>Sign Up</button></p>
    </form>
    </div>
    </div>
    </div>
    </div><!-- morph-button -->
    <p>for test</p>
    </div><!-- /form-mockup -->
    </section>
  • #767500
    Hi,
    Use following attributes to your HTM buttons so that they will be available at serverside.

    <button type="button" ID="Button1" runat="server">Login</button>

  • #767501
    thank you

  • #767503
    Hi,

    Refer this:

    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="Button" / >

    Regards,
    SonyShiva
    Never lose hope..You never know what tomorrow will bring

  • #768468
    try this.

    <asp:Button ID="savebtn" runat="server" OnClick="savebtn_Click" style="display:none" />
    html markup should be
    <button id="btnsave" onclick="fncsave()">Save</button>

    Change javascript to

    <script type="text/javascript">
    function fncsave()
    {
    document.getElementById('<%= savebtn.ClientID %>').click();
    }
    </script>

    Software Developer
    iFour Technolab Pvt. Ltd.

  • #768472
    You can use this code snippet to use javascript button in asp.net
     <script type="text/javascript">
    function fncsave()
    {
    document.getElementById('<%= savebtn.ClientID %>').click();
    }
    </script>

    Another Example

    <script type="text/javascript">
    function myClosure(){
    var r=confirm("Press a button!")
    if (r==true)
    {
    alert("You pressed OK!")
    return true;
    }
    else
    {
    alert("You pressed Cancel!");
    return false;
    }

    }
    </script>


  • Sign In to post your comments