Click here to Skip to main content
15,888,461 members
Please Sign up or sign in to vote.
1.80/5 (2 votes)
See more:
Hi.. Am working in asp.net. In my page i have button as
HTML
<input id="Button1"  runat="server" class="button right"  onclick="Button1_Click" type="button"
            value="Update" />


Here i would like to add Name,mail and password for each user. But the break point doesnot captured in code behind
C#
protected void Button1_Click(object sender, EventArgs e)
{
    try
    {

    }
    catch (Exception ex)
    {
        Exception E = ex;
    }
}

So, i couldnt code further.
Can anyone help me?

[Edit]Code block added[/Edit]
Posted
Updated 18-Mar-17 8:08am
v2
Comments
ZurdoDev 3-Apr-13 7:12am    
That's because you are using an input, which does not have server side events. Use an <asp:Button instead.

Try this
C#
<input id="Button1" runat="server" class="button right" onserverclick="Button1_Click" type="button" value="Update" />
 
Share this answer
 
Comments
Member 10583386 23-Mar-14 20:44pm    
how can i retrive de valy of a type="text" into codebehind
pradiprenushe 24-Mar-14 5:49am    
<input type="text" id="idText" runat="server" value="test"/>
you can check value property of control.
string temp = idText.Value;
Member 8673894 8-May-14 7:13am    
thanks...
it is working successfully..
pradiprenushe 8-May-14 14:50pm    
plz accpt solution if it work correctly
akash dhonde 7-Aug-18 14:12pm    
Will it perform page load
onclick event runs on client side while onserverclick runs on server side. Change your code to:
ASP.NET
<input id="Button1"  runat="server" class="button right"  önserverclick="Button1_Click" type="button" value="Update" />
 
Share this answer
 
v2
use java script like this....

XML
<SCRIPT LANGUAGE="JavaScript">
function myFunction(passForm) {
    var userPass = document.getElementById('Email');
    var Password = document.getElementById('Passwd');
     alert(userPass.value);
 
Share this answer
 

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