473,799 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

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

function ShowConfirmDele te() {
var theMessage =
document.getEle mentById('<%=Co nfirmMessage.Cl ientID%>').valu e;

return confirm(theMess age);
}

</script>

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

<ItemTemplate >

asp:Label ID="itemdateLab el" runat="server" Text='<%#
Eval("CreatedDa te","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="Remove Btn_Click" OnClientClick=" return ShowConfirmDele te();" />

</ItemTemplate>

</asp:Repeater>

</asp:Content>
Sep 2 '08 #1
5 2318
"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:79******** *************** ***********@mic rosoft.com...
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" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

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

function ShowConfirmDele te() {
var theMessage =
document.getEle mentById('<%=Co nfirmMessage.Cl ientID%>').valu e;

return confirm(theMess age);
}

</script>

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

<ItemTemplate >

asp:Label ID="itemdateLab el" runat="server" Text='<%#
Eval("CreatedDa te","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="Remove Btn_Click" OnClientClick=" return ShowConfirmDele te();" />

</ItemTemplate>

</asp:Repeater>

</asp:Content>

View Source
Sep 2 '08 #2
what do you mean??

"Jeff Dillon" wrote:
"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:79******** *************** ***********@mic rosoft.com...
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" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

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

function ShowConfirmDele te() {
var theMessage =
document.getEle mentById('<%=Co nfirmMessage.Cl ientID%>').valu e;

return confirm(theMess age);
}

</script>

<asp:Repeater ID="DataList1" runat="server" DataSourceID="S qlDataSource1"
>
<ItemTemplate >

asp:Label ID="itemdateLab el" runat="server" Text='<%#
Eval("CreatedDa te","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="Remove Btn_Click" OnClientClick=" return ShowConfirmDele te();" />

</ItemTemplate>

</asp:Repeater>

</asp:Content>

View Source
Sep 3 '08 #3

"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:E4******** *************** ***********@mic rosoft.com...
what do you mean??

"Jeff Dillon" wrote:
>"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:79******* *************** ************@mi crosoft.com...
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" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

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

function ShowConfirmDele te() {
var theMessage =
document.getEle mentById('<%=Co nfirmMessage.Cl ientID%>').valu e;

return confirm(theMess age);
}

</script>

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

<ItemTemplate >

asp:Label ID="itemdateLab el" runat="server" Text='<%#
Eval("CreatedDa te","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="Remove Btn_Click" OnClientClick=" return ShowConfirmDele te();"
/>

</ItemTemplate>

</asp:Repeater>

</asp:Content>


View Source
Are you familiar with View Source in IE? Look at the page after it renders,
and look for differences.
Sep 4 '08 #4

Thank you again,

Actually I dont familiar with view soruce and dont understan, i am going to
google about it.
"Jeff Dillon" wrote:
>
"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:E4******** *************** ***********@mic rosoft.com...
what do you mean??

"Jeff Dillon" wrote:
"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:79******** *************** ***********@mic rosoft.com...
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" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

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

function ShowConfirmDele te() {
var theMessage =
document.getEle mentById('<%=Co nfirmMessage.Cl ientID%>').valu e;

return confirm(theMess age);
}

</script>

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

<ItemTemplate >

asp:Label ID="itemdateLab el" runat="server" Text='<%#
Eval("CreatedDa te","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="Remove Btn_Click" OnClientClick=" return ShowConfirmDele te();"
/>

</ItemTemplate>

</asp:Repeater>

</asp:Content>



View Source

Are you familiar with View Source in IE? Look at the page after it renders,
and look for differences.
Sep 5 '08 #5

"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:AC******** *************** ***********@mic rosoft.com...
>
Thank you again,

Actually I dont familiar with view soruce and dont understan, i am going
to
google about it.
"Jeff Dillon" wrote:
>>
"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:E4******* *************** ************@mi crosoft.com...
what do you mean??

"Jeff Dillon" wrote:

"cyrus" <cy***@discussi ons.microsoft.c omwrote in message
news:79******* *************** ************@mi crosoft.com...
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" ContentPlaceHol derID="ContentP laceHolder1"
Runat="Server">

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

function ShowConfirmDele te() {
var theMessage =
document.getEle mentById('<%=Co nfirmMessage.Cl ientID%>').valu e;

return confirm(theMess age);
}

</script>

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

<ItemTemplate >

asp:Label ID="itemdateLab el" runat="server" Text='<%#
Eval("CreatedDa te","{0}") %>' />

<asp:Button ID="RemoveBtn" runat="server" Text="delete"
OnClick="Remove Btn_Click" OnClientClick=" return
ShowConfirmDele te();"
/>

</ItemTemplate>

</asp:Repeater>

</asp:Content>

View Source

Are you familiar with View Source in IE? Look at the page after it
renders,
and look for differences.
If you are using Internet Explorer, right click on the page, and choose View
Source. It will show all the HTML markup and Javascript too. It sounds like
your Javascript isn't rendering correctly
Sep 5 '08 #6

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

Similar topics

4
3809
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(); } </script>
0
3810
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 a point. This does get an OnClientClick event onto the menu items but it causes the codebehind ItemCommand for the Menu to become unwired. It seems that when my Menu is rendered to html the link buttons in the menu have two <atags rendered one...
2
18437
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 fine, however when I click OK, I expect the Server Side Postback OnClick event to fire, but it does not. Any Ideas? Here is the code:
5
18499
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
18776
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. <asp:ImageButton id="myButton" runat="server" OnClientClick="myButtonClick();" src=... ></asp:ImageButton> In the javascript: function myButtonClick()
2
19149
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 </asp:LinkButton>
0
2085
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 Image, code is below: <asp:Image ID="imgLarge" Name="imgLarge" runat="server" AlternateText="Large Custom Image" Height="300" Width="400" /> <asp:Repeater ID="rptSmall" runat="server" OnItemDataBound="rptSmall_ItemDataBound1">
2
3012
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 (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
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10484
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10251
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10228
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.