473,387 Members | 3,801 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,387 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
5 2295
"cyrus" <cy***@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.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" 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>

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

"Jeff Dillon" wrote:
"cyrus" <cy***@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.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" 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>

View Source
Sep 3 '08 #3

"cyrus" <cy***@discussions.microsoft.comwrote in message
news:E4**********************************@microsof t.com...
what do you mean??

"Jeff Dillon" wrote:
>"cyrus" <cy***@discussions.microsoft.comwrote in message
news:79**********************************@microso ft.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" 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>


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***@discussions.microsoft.comwrote in message
news:E4**********************************@microsof t.com...
what do you mean??

"Jeff Dillon" wrote:
"cyrus" <cy***@discussions.microsoft.comwrote in message
news:79**********************************@microsof t.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" 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>



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***@discussions.microsoft.comwrote in message
news:AC**********************************@microsof t.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***@discussions.microsoft.comwrote in message
news:E4**********************************@microso ft.com...
what do you mean??

"Jeff Dillon" wrote:

"cyrus" <cy***@discussions.microsoft.comwrote in message
news:79**********************************@microso ft.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" 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>

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
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.