473,394 Members | 2,160 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

onsubmit question - can't figure out

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?
Nov 19 '05 #1
2 1394
'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.

"Craig" <Cr***@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
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?

Nov 19 '05 #2
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
"Craig" <Cr***@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
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?

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Stuart Wexler | last post by:
Hi, I have a form with onSubmit embedded in the <form> tag. The form is submitted programatically through javascript . While the form submits fine, nothing I'm doing seems to get it to...
1
by: KathyB | last post by:
Hi, I have the following submit code: <form name="finish" action="Hidden_Birth2.aspx" method="post" onsubmit="return CheckInput(this);"> <input style="CURSOR: HAND" type="submit" name="finish"...
2
by: Justin Koivisto | last post by:
This is probabally a basic question, but I don't quite understand what is going on with this... Say I have a variable called "myObject" which is an object created from a class I wrote. The class...
3
by: n3mtkj3mzsir0cy | last post by:
I have created web pages that do client-side form validation using the onclick directive. E.g., <form action=other_page.cgi method=post> Enter your age: <input name=age> <input type="submit"...
2
by: Sean Dockery | last post by:
Which is the following is correct? a) <form ... onSubmit="return checkData()"> b) <form ... onSubmit="return checkData();"> c) <form ... onSubmit="checkData()"> d) <form ......
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
8
by: Mark Livingstone | last post by:
I have a form that uses the following: onSubmit="some_var = 'validated';" FireFox is OK with that. Internet Explorer isn't. any ideas why? Thanks.
3
by: Olivia Towery | last post by:
I cannot figure out how to complete two script validations onsubmit. Only the first one listed runs. If anyone knows how to do this, please help. -- Olivia Towery
1
by: vunet | last post by:
I write a JS library component which is applied to every form on a webpage. The component does something before it submits the form. Now, let's say user has his own onSubmit() handlers returning...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.