.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

confirm JS is not working on imagebutton click

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

Dear Frens

I have a new issue, which i want to share.

When working with ASP.NET 1.1 Framework there is an imagebutton on click of that imagebutton client side validations are fired since it is an online application form

cline side validations are must i am using a javascript when user submitting the application form

for confirm messege .

but it is not working ... if i do the causevalidation="False" for the imagebutton it is working but the validation are bypassed.

How to achieve this please suggest

Thanks in Advance


View Complete Post

More Related Resource Links

ImageButton Click Event Not Working


I know this question has been asked before. But for some reason I can't find the exact answer I need for my problem. My problem is as follows:

I am creating a web page (The one posted is just an easy example) that creates multiple ImageButtons on one page via a loop.I have tried many other ways (for example, create instance in form_load and pass to the WriteHtml() method) but I can't figure out a way to complete this. In this example I have 10 buttons that need to be able to be clicked.

Thanks in advance,


The code is as follows:

    public partial class _Default : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)

        private void WriteHtml()
            StringWriter sw = new StringWriter();

            using (HtmlTextWriter writer = new HtmlTextWriter(sw))
                for (int i = 0; i < 10; i++)
                    ImageButton imgBtn = new ImageButton();
                    imgBtn.ID = "imgBtn_" + i;
                    imgBtn.ImageUrl = "images.jpg";
                    imgBtn.Attributes.Add("runAt", "server");
                    imgBtn.Click += new ImageClickEventHandler(imgBtn_Click);

jquery confirm windows isn't working


Hi, i am using jquery to implement a modal confirm windows but it not working

i have a template field button with ajax confirm using jquery but i have a problem. Apper the confirm windows but when i click on "yes" doesn't execute the delete command. without ajax (using template field button and simple confirm windows javascript) works so well.

Can you give me a hand with this?

thx in advance!

<link href="_assets/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<link href="_assets/css/confirm.css" rel="stylesheet" type="text/css" />
<script src="_assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="_assets/js/jquery.simplemodal-1.1.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
       $(".deleteCustomer").click(function(ev) {
                var msg = $(this).attr("title");
                confirm(msg + "?");

Dynamically creating Gridview Template - Linkbutton Click not working



I have written some code to dynamically generate template columns for gridview which works well. However, each cell in the gridview has to be a linkbutton, which when clicked does a db update and redirects to a specific url with some parameters in it.

I have attached a click event handler to the linkbutton in the InstantiateIn method but the event does not seem to fire.

Could someone please help? the code is below -

//Dynamically creating the Grid

protected void btnAnalyze_Click(object sender, EventArgs e)

click events not working in webparts

I tried to initiate the click events in my webpart.for simple test, Once I clicked the button it should set the label as empty string. But my click events not working when i integrate this webpart in my site. code    protected override void CreateChildControls()         {             base.CreateChildControls();             TextBox tx = new TextBox();             Button btn = new Button();             btn.Text = "Send to Consumer WebPart";             btn.Click+=new EventHandler(btn_Click);             this.Controls.Add(tx);             lbl = new Label();             lbl.Text = "Thank God!";                         this.Controls.Add(lbl);             this.Controls.Add(btn);        &nb

Click imagebutton open window.open in class asp.net 2.0

Click imagebutton open window.open in class asp.net 2.0

Disable "enter" click on imagebutton

When i press "enter" i dont want the first button that is on my page getting fired. This is a imagebutton. I did try with a javascript function that checks the event keycode but this always returns 13.<script language="javascript"> function noEnter() {  if (event.keyCode == 13) {  return false;    }  }  </script> When i add OnClientClick="return false;" then you can't press the button at all.<asp:ImageButton ID="backButton" runat="server" CausesValidation="false" ImageAlign="AbsBottom" ImageUrl="../../images/Global/back.gif" OnClientClick="GoBack2_Click" OnClick="GoBack_Click" OnClientClick="return false;"/> When i click with the mouse on the button the Goback function does not get called. So what i'm trying to get here that the imagebutton need to be clicked with a mouseclick and not with and enter keystroke. ty ;)      

Confirm js is not working

hello friends,                 i need a little help, i have create a javascript as abovefunction ProgressShowForDelete(){            //  find the popup behavior            alert('coming');            var answer = confirm("Are you sure you want to delete this Category?")            if (answer){               alert('tr');                this._popup = $find('ctl00_Body_mdlPopup');                this._popup.show();            }            else{                            }                             }it

>>How to open a page in seperate browser when Imagebutton click from parent page?



In parent page there is an imagebutton. What I want to when user click this image button, another page will open with width=200 and height=100 with no toolbar.

click a button to pop up new window to pass a value; is working on second click onwards


Hi all,


i am facing a problem to make a button onclick to pop up a new window with pass a value. it only working on second click on onwards.

i check the checkbox from a table then pass the ID for each data to another page.

below is my coding: hope anyone can help me. this is i add in button click; the PIID is a value i want to pass


 Protected Sub btn_download_in_excel_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_download_in_excel.Click


        Dim keyID As String = ""
        Dim CheckedItems As SortedList = ViewState("CheckedItems")
        Dim ChkBxIndex As String = ""
        Dim strPsId As String = ""
        Dim PIID As String = ""
        Dim rows() As DataRow

        Dim CheckedItemsKeys As ICollection = CheckedItems.Keys
        Dim keys As IEnumerator = CheckedItemsKeys.GetEnumerator

        While keys.MoveNext
            If Not IsNothing(CheckedItems) Then
                ChkBxIndex = keys.Current
                keyID = ChkBxIndex

                rows = pLookupDataSet.Tables("CCL_TB_PART").Select("PIID = " & Cmn.QStr(keyID))

                If String.IsNullOrEmpty(PIID) Then
                    PIID = keyID

JS Confirm not working


In my button Save event, I have to ask the user if they have something else to do before they proceed with the save. The below js seems to execute, but doesn't return back to the event (and proceed) if I choose Cancel and I don't get my screen back if I answer OK. Am I doing something incorrect with the function?

Here is my server side code inside the Save button event:


if (tsPatientDemographics.SelectedTab.Text == "Pri Ins")
                String s = "Sec_Ins()";
                ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "Secondary Insurance?", s, true);


Here is my js code:


function Sec_Ins() {

    if (confirm("Is there Secondary or Tertiary Insurance information available?") == true) {
        return false;

Isenabled property in WPF not working on mouse right click



   I set Isenabled =false on a paticular condition using trigger evry thing got disabled but mouse right click is working and Getting selected,can any one let me know how to resolve this issue.


Thanks in Advance

ImageButton click -> new window open

Hi all,
I have an ImageButton with PostBackUrl="~/AnotherForm.aspx".
Whether exists or not any way to open the AnotherForm.aspx page in different window?
Tnx in advance!

stop postback after imagebutton click on page validation error



i have some textbox that i validate with a customvalidator control (only, and must be, server side function) and i have an imagebutton control for submit.

I must stop the postback if there are some errors in the validation function.

I set the validation property argumets.isvalid = false in the customvalidator function but doesn't work, the postback continue.

i have tried to set the imagebutton property postbackurl = "" in the validation function but doesn't work.

Where is the error?

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

GridView Javascript Click Row and Ajax

This article shows 2 common tasks with the ASP.NET GridView: Binding a List (generic) of objects as DataSource and on clicking a row, getting the values of the selected row by a javascript function. In the example a List with User-objects is displayed. On clicking a row containing the data of a User-object, the Id of the object is used to get the address of the user by an Ajax-call and display it in a details-field.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend