What you want to see on DotNetFunda.com ?
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 599 |  Welcome, Guest!   Register  Login
 Home > Forums > JavaScript > How To use Javascript in asp.net Web application? ...
Samy33

How To use Javascript in asp.net Web application?

Replies: 7 | Posted by: Samy33 on 2/19/2010 | Category: JavaScript Forums | Views: 8901 | Status: [Member]  


Hai .....
I am having one doubt in using Javascript on asp.net Web application.Its not working on asp.net. I wrote a java script for validation purpose in asp.net its not working enough....how to use the script in asp.net


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Vuyiswamb
Vuyiswamb  
Posted on: 2/19/2010 7:22:43 AM
Level: NotApplicable | Status: [Member] [MVP] [Administrator]

why do you say its not working. tell us more about your problem

Thank you for posting at Dotnetfunda
[Administrator]

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Samy33
Samy33  
Posted on: 2/19/2010 7:45:56 AM
Level: Starter | Status: [Member]

I dont know how to Call javascript funtion in asp.net Button control.Can you send the javascript codings which you are already used in your project

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Vuyiswamb
Vuyiswamb  
Posted on: 2/19/2010 7:57:41 AM
Level: NotApplicable | Status: [Member] [MVP] [Administrator]

its Simple

in your markup in the head you can add the following

   <script language="javascript">

function Showit()
{

alert('Wow i did it');
return false;
}
</script>

and in your button right click on it and go to the properties of your button, and look for onclientClick and write this

  Showit()


and run your test app and click the button and you will see your message

Thank you for posting at dotnetfunda

Vuyiswa Maseko



Thank you for posting at Dotnetfunda
[Administrator]

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Samy33
Samy33  
Posted on: 2/21/2010 3:04:29 AM
Level: Starter | Status: [Member]

This is not problem in my script.Alert msgs are working very nicely. i wrote javascript for validation.How to call the TextBox Name in Javascript.
for Example>>.
If(document.form1.GetElementId("TextBox1")="")
{
alert("Please Enter Ur Name");
return false;
}
>>>>
This Is my coding for validation at one Part


how to call a script in asp.net

tell me

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Nishithraj
Nishithraj  
Posted on: 2/24/2010 8:42:54 AM
Level: Bronze | Status: [Member]

instead of document.form1.GetElementId("TextBox1"), try with document.GetElementId("TextBox1")

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Nishithraj
Nishithraj  
Posted on: 2/24/2010 8:43:40 AM
Level: Bronze | Status: [Member]

And where do you want to call this code. That you should have told us before.

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Samy33
Samy33  
Posted on: 2/24/2010 11:17:47 PM
Level: Starter | Status: [Member]

Script is called in asp.net button control for validation checking

Samy33, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

Found interesting? Add this to:


 Latest Posts

Write New Post | More ...

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/24/2013 10:05:21 PM