473,396 Members | 1,693 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.

onClientClick does not work correctly after deploying

Hi everybody,

I have created a simple web form which contains a repeater. every item of
the repeater has a button to delete the tiem.

my web form uses Resource files to globalizing the form (multiLanguage). the
value of the resource string is saved in a asp:hidden control to be used
later in a javascript function, so in the following code ConfirmMessage is a
asp:hidden control which saves the value of the properties of the resource
files.

So the value of ConfirmMessage is a confirm message from Resource files in 4
languages which will be showen when a client click on the RemoveBtn to delete
an item.

in developing environment everything works good and i deploy it to
production. within the production machine I browse to my site
(http://mydomain.com) and here everything works good, I get the confirm
message and when I click on Cancel it nothing happen (the item is not
deleted). But the problem is when I browse to production from another machine
it removes the item even when I click Cancel. it seems the javascript does
not works at all. it do a reload and it seems to go in to the onClick event.

Thank you for any help.
here is my code:

asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">

<script language="javascript" type="text/javascript">

function ShowConfirmDelete() {
var theMessage =
document.getElementById('<%=ConfirmMessage.ClientI D%>').value;

return confirm(theMessage);
}

</script>

<asp:Repeater ID="DataList1" runat="server" DataSourceID="SqlDataSource1" >

<ItemTemplate>

asp:Label ID="itemdateLabel" runat="server" Text='<%#
Eval("CreatedDate","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="RemoveBtn_Click" OnClientClick="return ShowConfirmDelete();" />

</ItemTemplate>

</asp:Repeater>

</asp:Content>

Sep 2 '08 #1
2 3001
cyrus wrote:
Hi everybody,

I have created a simple web form which contains a repeater. every
item of the repeater has a button to delete the tiem.
There was no way for you to know it (except maybe by browsing through
some of the previous questions before posting yours - always a
recommended practice), but this is a classic (COM-based) asp newsgroup.
ASP.Net is a different technology from classic ASP. 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
a newsgroup where the dotnet-savvy people hang out. I suggest

microsoft.public.dotnet.framework.aspnet.

There are also forums at www.asp.net where you can find a lot of people
to help you.

HTH,
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.
Sep 2 '08 #2
=?Utf-8?B?Y3lydXM=?= wrote on 02 sep 2008 in
microsoft.public.inetserver.asp.general:
</asp:Content>
This is a classic asp group. Dotnet questions should be asked in
<microsoft.public.dotnet.framework.aspnet>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 2 '08 #3

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

Similar topics

4
by: Steve | last post by:
<script language=javascript> function selectFile(fileUrl) { if(navigator.appName.indexOf('Microsoft')!=-1) window.returnValue=fileUrl; else window.opener.setAssetValue(fileUrl); self.close();...
0
by: jtencate | last post by:
I am trying to add an OnClientClick event to links in an asp:Menu. I tried using a StaticItemTemplate to bind the MenuItem data to a LinkButton with an OnClientClick attribute. This works fine to...
2
by: Opa | last post by:
Hi, I have a asp:button which allows a user to delete a record, and I wish to prompt them with a client side confirmation. The javascript confirm messagebox does show and the cancel button is...
5
by: Dan | last post by:
Hi, i try to redirect to another aspx page with jscript. I use "OnClientClick" but nothing happens. I tried two ways. What am i doing wrong? Thanks Dan ....
7
by: =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ== | last post by:
I am having trouble getting client-side events to fire on ImageButtons. Instead I am seeing postbacks. The client-side handlers end with "return false;" but they are never called. ...
2
by: dddan | last post by:
Here's my code: <asp:LinkButton OnClick="DeleteFile" OnClientClick="if (!confirm ('Are you certain you want to delete this file?') ) return false;" runat="server" ID="DeleteButton">DELETE...
0
by: Sully | last post by:
Hi Guys, I have this about 98% done and I cannot get it work properly. I have a Repeater bound to a MySQL DataSource, inside the Repeater I have an ImageButton, outside the repeater I have a...
1
by: Mark Handy | last post by:
Here's my code snippet: protected void Page_Load(object sender, EventArgs e) { Page.RegisterStartupScript("SetFocus", "<script>document.getElementById('" + txtKeyword.ClientID +...
5
by: =?Utf-8?B?Y3lydXM=?= | last post by:
Hi everybody, I have created a simple web form which contains a repeater. every item of the repeater has a button to delete the tiem. my web form uses Resource files to globalizing the form...
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:
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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.