onsubmit question - can't figure out

G

Guest

This has got to be easy, but I can't figure it out.

I have a login control with a login button to process the username,password,
etc.
I have the login control within a login page, and this page has the form
tags in it.......
//this doesn't work for the onsubmit
<form id="Form1" method="post" runat="server" onsubmit="Button1_Click">
<uc1:Top id="Top1" runat="server"></uc1:Top>
<uc1:SideNav id="SideNav1" runat="server"></uc1:SideNav>
<uc1:Login id="Login1" runat="server"></uc1:Login>
</form>

I'm trying to call the Button1_Click method within Login control when the
form is submitted. It's not reaching it, what am I doing wrong?
 
M

Marina

'onsubmit' is a client side event. You can't call a server side function to
handle a client side event.
You need to write client side script to handle this event on the client,
probably written in javascript.
 
S

S. Justin Gengo

Craig,

You can access the button's click event from within the control itself. You
don't need to tie it to the form submittal at all.

If you're using Visual Studio.Net then the easiest way to access the button
click's event is to go to the design view of the control and double click
the button. That will create the button click event server side within the
control's code behind page.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top