check dis condition in the javascript function and accordingly display the confirmation box else return back eg.button1.Attributes.Add("onclick","javascript:return test(cutomerId);") function test(val) { if(val ==0) { //call confirm() } } modify the code accordingly ..
kapil bhatnagar
Posts
-
Javascript confirmation in asp.net -
impFirst if condition getting executed implies the value of flag = 0 hence third if condition would be false and hence the inside code will not be executed. ;)
-
dir tag in form tagIt is used to set the text direction on the form value :ltr or rtl :)
-
Membership. Login is not case sensitivewat database is being used?
-
declaring object arrayuse this logic: ClassName[] obj = null; obj = new ClassName[size]; :)
-
Focus a textbox inside a DataGridPass the Client Id from the codebehind to javascript function.Create an element using that client Id. and then do document.getElementById('elementid').focus();
-
Decimal(18,2) Regular Expressionthe previous one will not... try this one : ^[-]?([1-9]{1,18}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|\.[0-9]{1,2})$
-
Dynamic Loading for Infragistics TreeViewCan anyone tell me if the TreeView control in Infragistics allows dynamic loading to be done by populating a node from a text file rather than using a Dataset for the same ??
-
Decimal(18,2) Regular Expression^[-]?([1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|\.[0-9]{1,2})$ This regular expression will match on a real / decimal / floating point / numeric string with no more than 2 digits past the decimal. The negative sign (-) is allowed. No leading zeroes or commas or use the following link: http://regexlib.com for further search
-
Open File Dialog without html file fieldtry using the following code: if (file.Exists) { Response.Clear(); Response.AddHeader("Content-Disposition", "filename=" + file.Name); Response.AddHeader("Content-Length", file.Length.ToString()); Response.ContentType = "application/pdf"; Response.WriteFile(file.FullName); Response.Flush(); Response.End(); Response.Close(); } Incase the content type has been defined for word doc or xls file, the file dialog box will open itself. Hope this is of some help !
-
TreeView Problem in Mozilla !!!Hi I am using a Microsoft Treeview control in my application. It works fine with IE. The problem is that it is not working for Mozilla/Firefox browser. The problem I found was that on javascript events like onexpand and oncollapse,it does a postback.It is not able to attach javascript event handlers to these events. Neither can it attach events in TreeView.htc file.I made the changes in treeview.htc file for preventing the postback.But was of no help. Cn somebody plz give a possible fix for this ... .. . ??? :omg: Thnx in advance
-
JavaScript with DropDownListtry this: if (parseInt(dt) != 0) { Form1.submit(); }
-
DataGrid 's Checkbox checked on Button clickpass the datagrid name via the codebehind: btnCheckAll.Attributes.Add("OnClick","javascript:return CheckAll("dgdGrid");"); function CheckAll(dataGridName) { var ChkState = true; //count the no. of rows in the DataGrid List var count = document.getElementById(dataGridName).rows.length; for(i = 2;i<=count+1; i++) { var id = dataGridName+"__ctl" + i + "_chkSelect"; var elem = document.getElementById(id); elem.checked = ChkState ; } } where "chkSelect" will be the name of the checkbox as mentioned in the item tempelate column in the html code for the datagrid. Hope this helps !!
-
TreeView single selectHow are you capturing the "selectedindexchanged" event for the treeview ? in the codebehind file ??
-
ASP.net TreeView Problem in MozillaHi Can please someone help me out with this problem ... I have developed a Treeview using Microsoft TreeView control in ASP.NET using C#. Its working perfectly in the Internet Explorer. The problem im facing is that its not working in Mozilla as its not able to attach javascript event handlers to the treenodes. The javascript events have been attached via the C# code behind file rather than html. eg.this.TreeCtrl.Attributes.Add("onexpand","javascript:return treeViewExpand(this);"); Can someone please help me in how to attach the treenode events so that they work perfectly for Mozilla browser.