473,394 Members | 1,749 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.

OnClick

Ron
I have created a 'LoginDialog ' user control with 'OK'
and 'Cancel' buttons. Then I have included the control
into a Web Form.

<form id="Login" method="post" runat="server" onclick="">
<div align="center">
<uc1:LoginDialog id="cntLoginDialog"
runat="server"></uc1:LoginDialog>
</div>
</form>
The control buttons have OnClick event handler but I
don't want the click event to initiate the round trip to
the server. I want the cancel handler to clear the user
name and password textboxes and the ok handler to
explicitely initiate the round trip

private void btOK_Click(object sender, System.EventArgs e)
{
if (Verifier.Verify(username, passowrd) == false)
{
// don't do the round trip
return;
}

Response.Redirect();
}

Only if the user name and the password are correct.
Nov 17 '05 #1
1 1460
How are you going to avoid a "round trip" (PostBack) from server-side code?
The only way to execute that code is via PostBack!

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.
"Ron" <na********@hotmail.com> wrote in message
news:07****************************@phx.gbl...
I have created a 'LoginDialog ' user control with 'OK'
and 'Cancel' buttons. Then I have included the control
into a Web Form

<form id="Login" method="post" runat="server" onclick="">
<div align="center">
<uc1:LoginDialog id="cntLoginDialog"
runat="server"></uc1:LoginDialog>
</div>
</form>
The control buttons have OnClick event handler but I
don't want the click event to initiate the round trip to
the server. I want the cancel handler to clear the user
name and password textboxes and the ok handler to
explicitely initiate the round trip

private void btOK_Click(object sender, System.EventArgs e)
{
if (Verifier.Verify(username, passowrd) == false)
{
// don't do the round trip
return;
}

Response.Redirect();
}

Only if the user name and the password are correct.

Nov 17 '05 #2

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

Similar topics

8
by: Shock | last post by:
Hello everyone, I am having a problem with the program below. I have isolated the problem to the onclick event that is located throughout arrQuestions. The onclick event refers to a function...
17
by: Mike Gratee | last post by:
Is it possible to use JavaScript to cause the browser to click a link on a page and have the browser act exactly like the user had clicked on the link directly? In other words, I need to...
2
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display...
3
by: Jamie Jackson | last post by:
I'm rewriting all links' onclick events, but I'm having a problem. The onclick event that I'm inserting works correctly in Opera, but not in FF or IE. I'm retroactively adding the statement...
7
by: extremerep | last post by:
My task is to change the value of a button and then make it functional with the onClick handler. Changing the value to "Play Again" works, but making the onClick work accordingly does not. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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: 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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.