ASP.NET - javascript return flase

Asked By srikar
09-Sep-10 04:07 AM
javascript return flase waht it's do. wht is the necessity of it.
  Santhosh N replied to srikar
09-Sep-10 04:09 AM
Whenever you require to get any boolean result from a function you could use that..especially in validation functions this reurn false will be used
  Super Man replied to srikar
09-Sep-10 04:17 AM

You can use this to test any condition.

If test returns then something is to execute.

Else do nothing or execute something else.

 

 

  Sagar P replied to srikar
09-Sep-10 04:22 AM
Actually its very useful in validations.... Like if you want user to only enter numbers in textbox then you can write JS function which will return true or false depedning on entered character... and you can use it for text box like;

txtNumbers.Attributes.Add("onkeypress","return OnlyNumbers()");

So it will not handle keypress event if its return false...... it will not enter that char at all in text box....

Same way if you dont want to refresh a page onclick on button you can use it like;

btn.Attributes.Add("onclientclick","return false;")
  Anand Malli replied to srikar
09-Sep-10 05:51 AM
Hi Sriakr,

Return false suppress the original event of your control ,say you have button and onclientclick is also there and onclick is also there so if your javascript function return false your server side event will never get fired,so now to make it fire you will need to rerun true

i think you got the point
Thanks
  [ Kirtan ] replied to srikar
09-Sep-10 05:11 PM
You have not mentioned what code returns false . still i m trying to give answer

False / True are boolean values that some time taken as 1 and 0 also they are written in java script for indicating success or failure / some other type of condition inside code of java script
  Goniey N replied to srikar
10-Sep-10 01:40 AM
-- First Of I Want To Say That There Is One Datatype Which Return Either "True" Or "False".

-- Means When You need This Kind Of True Or False Return Type Then You Can Use This Type As Return Type.


-- Let's Take One Example :

01.<script type="text/javascript">
02.  function My(Name)
03.  {
04.    if(Name == 'EggHeadCafe')
05.      //If Given "Name" Is "EggHeadCafe" Then It Will Return True...
06.      return True;
07.    else
08.      //Else Return False...
09.      return False;
10.  }
11.</script>
12. 
13.//Here On Button Click Event It Will Call The Function
14.<asp:Button ID="button1" Text="Check" runat="server" OnClick="button1_Click" OnClientClick="return My('EggHeadCafe');"/>


-- Depending On Your Condition It Will Return Either "True" Or "False"....

-- Hope This Will Helpful To You...
Create New Account
help
Net hi friends Any one send frequently asked Important questions in C# .Net, ADO .Net, Asp .Net and Sql Server. . . . . . . . tx in Advance. . . . . . Hi, Find this. . (B)What is an IL? (B A) What is scavenging? (B) What are different types of caching using cache object of ASP.NET? (B) How can you cache different version of same page using ASP.NET cache object? (A) How will implement Page Fragment Caching? (B) Can you compare ASP.NET sessions with classic ASP? (B) Which are the various modes of storing ASP.NET session
you must create a windows application or web application to consume this service? It is True / False? FALSE How many classes can a single.NET DLL contain? Answer1: As many Answer2: One or String strCon = ”data source = IBM-6BC8A0DACEF;initial catalog = pubs;integrated security = SSPI;persist” +” security info = False;user id = sa;workstation id = IBM-6BC8A0DACEF;packet size = 4096?; String strCom1 = ”SELECT * FROM employee in Sql server as var_name int How do you separate business logic while creating an ASP.NET application? There are two level of asp.net debugging 1. Page level debugging For this we have to edit the page level debugging
authentication modes and its implementation in projects hi, i am doing a project in asp.net. . i want to use a authentication mode in this project.it is a educational based do some authentication in this project. How To: Use Forms Authentication with SQL Server in ASP.NET 2.0 patterns & practices Developer Center J.D. Meier, Alex Mackman, Blaine Wastell, Prashant Bansode, Andy Wigley, Kishore Gopalan Microsoft Corporation August 2005 Applies To • ASP.NET version 2.0 • SQL Server 2000 Summary This How To shows you how you can authentication, create the user store database, grant database access to your Web application account, configure ASP.NET membership settings, and set password complexity rules. Contents Objectives Overview Summary of Steps Step 1
faqs on masterpages Hi all, can anybody tell me the FAQs on Masterpages in asp.net. Thanks alot var Hi What are Master Pages in ASP.NET? or What is a Master Page? ASP.NET master pages allow you to create a consistent layout for the pages in your application pages element of the application's configuration file (Web.config), you can specify that all ASP.NET pages (.aspx files) in the application automatically bind to a master page. At the folder
control at runtime Refer this: http: / / www.ezzylearning.com / tutorial.aspx?tid = 2761931 http: / / www.asp.net / ajax / ajaxcontroltoolkit / Samples / PopupControl / PopupControl.aspx Working with Modal Popup extender control. This blog discusses about the ASP.NET AJAX ModalPopupExtender control. In this blog we will see how to use the ModalPopupExtender control how to display / show / call the ASP.NET AJAX ModalPopupExtender control from javascript, showing / displaying / calling the modal popup from a hyper link control within the gridview control and finally some important javascript methods of the ASP.NET AJAX ModalPopupExtender control. So first lets see how to use the ModalPopupExtender control. How to