Connecting Tech Pros Worldwide Forums | Help | Site Map

onClientClick does not work correctly after deploying

=?Utf-8?B?Y3lydXM=?=
Guest
 
Posts: n/a
#1: Sep 2 '08
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>



Jeff Dillon
Guest
 
Posts: n/a
#2: Sep 2 '08

re: onClientClick does not work correctly after deploying


"cyrus" <cyrus@discussions.microsoft.comwrote in message
news:79E20E8A-FCF7-4C57-AABA-86402F260705@microsoft.com...
Quote:
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"
Quote:
>
>
<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


=?Utf-8?B?Y3lydXM=?=
Guest
 
Posts: n/a
#3: Sep 3 '08

re: onClientClick does not work correctly after deploying


what do you mean??

"Jeff Dillon" wrote:
Quote:
"cyrus" <cyrus@discussions.microsoft.comwrote in message
news:79E20E8A-FCF7-4C57-AABA-86402F260705@microsoft.com...
Quote:
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"
Quote:
>
<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
>
>
>
Jeff Dillon
Guest
 
Posts: n/a
#4: Sep 4 '08

re: onClientClick does not work correctly after deploying



"cyrus" <cyrus@discussions.microsoft.comwrote in message
news:E4EF3017-7581-4523-B8B3-EB6BDE00FF13@microsoft.com...
Quote:
what do you mean??
>
"Jeff Dillon" wrote:
>
Quote:
>"cyrus" <cyrus@discussions.microsoft.comwrote in message
>news:79E20E8A-FCF7-4C57-AABA-86402F260705@microsoft.com...
Quote:
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.


=?Utf-8?B?Y3lydXM=?=
Guest
 
Posts: n/a
#5: Sep 5 '08

re: onClientClick does not work correctly after deploying



Thank you again,

Actually I dont familiar with view soruce and dont understan, i am going to
google about it.


"Jeff Dillon" wrote:
Quote:
>
"cyrus" <cyrus@discussions.microsoft.comwrote in message
news:E4EF3017-7581-4523-B8B3-EB6BDE00FF13@microsoft.com...
Quote:
what do you mean??

"Jeff Dillon" wrote:
Quote:
"cyrus" <cyrus@discussions.microsoft.comwrote in message
news:79E20E8A-FCF7-4C57-AABA-86402F260705@microsoft.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.
>
>
>
Jeff Dillon
Guest
 
Posts: n/a
#6: Sep 5 '08

re: onClientClick does not work correctly after deploying



"cyrus" <cyrus@discussions.microsoft.comwrote in message
news:ACA953F1-3AA8-4EE3-86ED-5D76596E2E85@microsoft.com...
Quote:
>
Thank you again,
>
Actually I dont familiar with view soruce and dont understan, i am going
to
google about it.
>
>
"Jeff Dillon" wrote:
>
Quote:
>>
>"cyrus" <cyrus@discussions.microsoft.comwrote in message
>news:E4EF3017-7581-4523-B8B3-EB6BDE00FF13@microsoft.com...
Quote:
what do you mean??
>
"Jeff Dillon" wrote:
>
>"cyrus" <cyrus@discussions.microsoft.comwrote in message
>news:79E20E8A-FCF7-4C57-AABA-86402F260705@microsoft.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


Closed Thread