473,499 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to use a JavaScript in Silverlight Application to reset all the Controls

45 New Member
Hi All,
My application is in VS2010 coded in c#.Net,im using Silverlight for the first Time.I have a form where there are
combo boxes,textboxes,rich TextBox,DTP.The data in all these controls are populated from database at the Loaded Event.
I hve a Cancel button on the same page.Now my requirement is that when the User click on Cancel all the controls should get reset and should be in the state as they were after the Loaded Event.
I want to do this using JavaScript.
I have the following code but im getting Error
Expand|Select|Wrap|Line Numbers
  1. <script language="javascript">
  2. formreset()
  3. {
  4. myform.reset(); 
  5. }
  6.  
The error im getting "The Type script was not found.Verify that you are not missing an assembly reference"
Im calling the Above code on Click of Cancel button.
Please guide me about how should i create Javascript for this and use in my Form.
Would be great if i gets the assistance by tomorow morning..
Aug 22 '11 #1
7 2454
Paul Johnson
97 New Member
Is this in the HTML? If it is, you could do with having a

Expand|Select|Wrap|Line Numbers
  1. </script>
at the end
Aug 22 '11 #2
SEhtesham
45 New Member
no its in XAML.
I want to include JavaScript in my XAML.Can i do this?
If yes please guide how.
Aug 22 '11 #3
Paul Johnson
97 New Member
This may help you

http://blogs.silverlight.net/blogs/m...lverlight.aspx

But from the looks of it, directly having JS in an XAML file is a no-no currently
Aug 22 '11 #4
SEhtesham
45 New Member
I have tried the Link mentioned above.
If u can please help out in how should i include a JavaScript or what is the process of Including JavaScript in my XAML.
Do i need to add any refernce or any header for this???
Aug 22 '11 #5
Paul Johnson
97 New Member
You can't directly put JS into XAML currently (from what I can see)
Aug 22 '11 #6
Plater
7,872 Recognized Expert Expert
If you are already in the server-side click function....why waste time with javascript, just clear it within your code.
Aug 24 '11 #7
SEhtesham
45 New Member
ya fine i got what you are saying.But Plater i also want to do validations and i want to do that on client side.I think JavaScript would be best option for that.So can u help me in Validations or if there is any other way i can better validate.
Aug 25 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1976
by: psinyc | last post by:
this may be a simple thing ... I am trying to reset all the page controls to their original setting, in the first line of this method call (event). I want to dynamically change the days of month...
1
1288
by: Jim Heavey | last post by:
Hello, I was wondering how I would go about attaching some Java script code to a <asp:EditCommandColumn. If the user presses the "edit" link, then I want to test other controls to see if any...
2
1143
by: Roh | last post by:
Hi, Can we use Javascript and .Net Validation controls on the same page. If yes how? Please provide some examples which will help me a lot....thanks.
1
2375
by: Chris | last post by:
Hi, I have a page with quite a few textboxes and dropdownlist controls. How can I clear the textboxes and reset the dropdownlist after the data is sent to the database? Do I have to perform ...
1
2132
by: CADD | last post by:
I've used http://www.bloglines.com to add RSS feeds to my sites there and setup javascript in my website to search bloglines for the input term. The code below works perfect, but I have 1 minor...
31
12161
imrosie
by: imrosie | last post by:
I have a form with a subform window. I have a command button on this form that clears only the controls on the form. However, if I enter data into the subform window, the cmd button won't clear it....
3
3849
by: vpascuzzi | last post by:
Hi, I am currently working on a small Silverlight application, but cannot find out what is wrong in my HTML. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
1
5178
LoanB
by: LoanB | last post by:
Hello team, I'm building a GIS Silverlight 4 application. I need to shut down the whole thing after a save event has taken place. So.. 1. User saves a new graphic to the SDE database, 2....
0
995
by: st mnmn | last post by:
I am in need of a "Transform" property on the "PerspectiveCamera" just like in the "System.Windows.Media.Media3D.Camera". Are there any plans to include this in silverlight?. If not, can anybody help...
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
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
7220
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...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4600
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
3099
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
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.