Last post Jun 28, 2019 03:33 AM by Yongqing Yu
Jun 27, 2019 06:27 AM|sreedhardax|LINK
I am using HTML page for designing a website. I have a user registration form and a Register button.
Here my complication is how to write method for the Register button click event.
Please suggest below is my html tag for button.
<input type="button" name="btnSubmit" id="btnSubmit" value="Register Now" onclick="RegisterProcess" />
Jun 27, 2019 07:03 AM|AddWeb Solution|LINK
I recommend you to refer the following links
Based on your requirement if you want to call server side function you have to refer below
If you want to create simple registration form using asp.net
Kindly refer the following example
I hope this will help you
Jun 27, 2019 07:10 AM|sreedhardax|LINK
Thanks for the suggestion here I am using HTML page for design. I have wrote the same HTML tag for submit button as below
<input type="submit" id="btnSubmit" value="Register Now" runat="server" onserverclick="btnSubmit_Click" />
And here is my .CS code below is the way what I am doing is correct?? Please suggest
public class UserRegistration
public void btnSubmit_Click(object sender,EventArgs e)
Jun 27, 2019 07:30 AM|Yongqing Yu|LINK
Yes, you're absolutely right to do that.
You can also use Button control to achieve this function like below:
<asp:Button ID="Button1" runat="server" Text="Register Now" OnClick="Button1_Click" />
For more details, you could refer to this link : https://docs.microsoft.com/en-us/dotnet/api/system.web.ui.webcontrols.button?view=netframework-4.8
Jun 27, 2019 08:12 AM|sreedhardax|LINK
Actually I am designing website completely through HTML only. Do we have any provision to achieve the same flow that you have mentioned in your reply with HTML website??
Jun 28, 2019 03:33 AM|Yongqing Yu|LINK
According to your description, if you want to use server controls (that is, similar to the button I gave you), you just need to create a webform project using Visual Studio software to use these controls directly.
Here is the download link: https://visual studio.microsoft.com/downloads/
You can learn the asp.net web server control from this link: http://w3schools.sinsixx.com/aspnet/aspnet_refwebcontrols.asp.htm
Of course, you can still use your original HTML to achieve your functions.