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

How to run a CLient Side Function for a <asp:button >

RSB
Hi Every one,

Having tuff time to make this work ..
i want to have a button and on my form say Delete button. So once i click on
it i want to confirm "Are you sure?" on the Client Side and if client select
"Cancel" then i want to ignore the action and if "OK" selected then i want
to Execute a Server side Event or Procedure.
Now what is happening here is for "Delete1" button (in my code) even if
Client Select Cancel it is still submitting the request...
and i am getting an error for the <asp:Button> control.
Please help me...
This is what i am doing..

<%@ Page Language="vb" AutoEventWireup="false" src="mypage.aspx.vb"
Inherits="mypage"%>

<SCRIPT language="javascript">
function buttonDelete()
{
if (!(window.confirm("Are You sure u want to delete?")))
{
return(false);
}
}

</SCRIPT>

<HTML>
<BODY>
<form id="Form1" name="Form1" method="post" runat="server">

<table >
<tr>
<td >
<asp:label id="lbl1" runat="server" >Name:</asp:label></td>
<td >
<asp:textbox id="txtName" runat="server" ></asp:textbox>
</td>
</tr>
<tr>
<td >
<INPUT name="cmdDelete1" type="submit" Value="Delete1"
onClick="javascript:buttonDelete()" onserverclick="buttonDeleteServer()">
<asp:button name ="cmdDelete" id="cmdDelete" runat="server"
Text="Delete" onClick="javascript:buttonDelete()"
onserverclick="buttonDeleteServer()" > </asp:button>
</td>
</tr>
</form>
</BODY>
</HTML>

Thank you in advance

RSB
Jul 19 '05 #1
1 2168
This (inetserver.asp.general) is a classic asp newsgroup. While you may be
lucky enough to find a
dotnet-savvy person here who can answer your question, you can eliminate the
luck factor by posting your question to an appropriate group. I suggest
microsoft.public.dotnet.framework.aspnet.

Please do not crosstab to irrelevant newsgroups. I've trimmed the dotnet
groups from this reply since the question is obviously on topic there.

Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2

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

Similar topics

0
by: Martin Jacobsson | last post by:
Hi! I have just installed VS.NET 2003, I have problem with intelisense in <asp:>-tags in aspx-files. I prevoiusly ran VS.NET and had no problems with this. Is it some property on the project or...
1
by: s8chem | last post by:
I'm working with an XSL document that renders ASP.NET Server Controls. In order to do this, I have to declare an "asp" namespace within the XSL document. This namespace is the same as when you see...
4
by: z. f. | last post by:
Hi, I'm having an aspx page with a server form. i have a grid with a delete button and below the grid, another area with inputs for inserting new values and an "add" button for submiting the...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
4
by: Jim Bancroft | last post by:
Hi everyone, I've been working with ASP.Net for about a month, and in all the samples I've seen the authors know ahead of time how many DropDownLists or Labels they're going to need. My...
2
by: Dee | last post by:
Hi I have to <asp:button>'s one on top of the other in a cell of a Table layout. When I put a <br> I get too big a gap. Without it they are touching. The only way I can think of separating them...
1
by: CharlesA | last post by:
Hi folks, first off, I'm using Framwork 1.1 with ASP.net and C# I'm trying to do something quite basic and can't figure out why it won't behave without going into massive details I want a...
5
by: Shaqman | last post by:
I have a server side asp button that submits a form after completion and a postback to acknowledgement. I need to disable the button after the user clicks on this once to prevent duplication. There...
1
by: FredZimmerman | last post by:
How do I dynamically generate <ASP:buttoncontrols for a repeating recordset (using reader with while loop). Each row would have ASP:Button and CommandName="sameFunctionForAll()"...
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
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: 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
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...

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.