473,396 Members | 1,858 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,396 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 1461
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: 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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.