473,472 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Javascript Confirm problem

Hi
am having some problems with the javascript confirm.
i have it working fine on one page and it doesnt even pop up at the
other.

The code on the working page is,

private void Page_Load(object sender, System.EventArgs e)
{
if(! Page.IsPostBack)
{
DataSet _DSSections =
VariableHandler.GetInstance().FetchAllVariables();
if (_DSSections.Tables[0].Rows.Count > 0)
{
lblInstructions1.Visible = true;
btnEdit.Visible = true;
btnDelete.Visible = true;
btnDelete.Attributes.Add("OnClick","javascript:ret urn confirm('Do
you wish to delete the selected variable');");
GrdVariableList.DataSource = _DSSections;
GrdVariableList.DataBind();
}
}
}
The one not working has the same javascript in the same way.

but it doesnt work. Other alerts on the page are showing up. but the
confrim isnt.

When i viewed the source of both the pages i found the following
diference

working:
<input type="submit" name="btnDelete" value="Delete Selected"
onclick="if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate(); " language="javascript" id="btnDelete"
OnClick="javascript:return confirm('Do you wish to delete theselected
variable variable');" style="height:29px;width:100px;" />&nbsp;
Not Working:
<input type="submit" name="btnDelete" value="Delete Selected"
id="btnDelete" OnClick="javascript:return confirm('Do you wish to
delete the selected variable');" style="height:29px;width:100px;"
/>&nbsp;
i have no idea when the "iftypeof" thing was added in the first code
and why wasnt it added in the second one.

kindly help me out of this.
thnkx
MA
Nov 18 '05 #1
1 2636
if you have any custom validation, asp.net throws some client side scripts
to do the validation. thats why you see if(istypeof()) stuff..

but coming to your problem, u mentioned the second peice of code is not
working..infact that should be the one working. and first should not.

when i tried without any custom validators on the page, it gave me the
output like in the second piece of code. it worked.

when i tried with custom validator on the page, it gave me this output which
is correct.
onclick="javascript:return confirm('do you want to delete?');if
(typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "

Av.

"Muhammad Abdullah" <ab**************@yahoo.com> wrote in message
news:c2**************************@posting.google.c om...
Hi
am having some problems with the javascript confirm.
i have it working fine on one page and it doesnt even pop up at the
other.

The code on the working page is,

private void Page_Load(object sender, System.EventArgs e)
{
if(! Page.IsPostBack)
{
DataSet _DSSections =
VariableHandler.GetInstance().FetchAllVariables();
if (_DSSections.Tables[0].Rows.Count > 0)
{
lblInstructions1.Visible = true;
btnEdit.Visible = true;
btnDelete.Visible = true;
btnDelete.Attributes.Add("OnClick","javascript:ret urn confirm('Do
you wish to delete the selected variable');");
GrdVariableList.DataSource = _DSSections;
GrdVariableList.DataBind();
}
}
}
The one not working has the same javascript in the same way.

but it doesnt work. Other alerts on the page are showing up. but the
confrim isnt.

When i viewed the source of both the pages i found the following
diference

working:
<input type="submit" name="btnDelete" value="Delete Selected"
onclick="if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate(); " language="javascript" id="btnDelete"
OnClick="javascript:return confirm('Do you wish to delete theselected
variable variable');" style="height:29px;width:100px;" />&nbsp;
Not Working:
<input type="submit" name="btnDelete" value="Delete Selected"
id="btnDelete" OnClick="javascript:return confirm('Do you wish to
delete the selected variable');" style="height:29px;width:100px;"
/>&nbsp;
i have no idea when the "iftypeof" thing was added in the first code
and why wasnt it added in the second one.

kindly help me out of this.
thnkx
MA

Nov 18 '05 #2

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

Similar topics

1
by: cheezebeetle | last post by:
ok, so I am having problems passing in an ASPX function into the Javascript in the codebehind page. I am simply using a confirm call which when they press "OK" they call this ASPX function, when...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
6
by: tshad | last post by:
I am trying to set up a Javascript popup box that has a way of sending back a message to asp.net on how to process some data. At the moment I am just doing: ...
9
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
12
by: tshad | last post by:
I have the following code that attaches a Javascript confirm box to my checkbox. When I select the checkbox, the window comes up fine, but it never executes the XfertoDefault_Click function when I...
3
by: TJ | last post by:
Hi, I would like to ask something to user after user submits the form... I know I can ask user whehter they want to submit the form or not using client-script code such as onClick or onSubmit by...
8
by: rn5a | last post by:
I have gone through a no. of posts in this NewsGroup regarding my problem but alas, couldn't come across one which would have helped me in resolving the issue. My problem is this: An ASPX Form...
6
by: Peter Afonin | last post by:
Hello, I'm creating an application in ASP.NET 1.1. I need to check whether at least one checkbox in my datagrid has been checked. To do this, I'm using Javascript - I'm adding this code to...
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...
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
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...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.