locked
javascript RRS feed

  • Question

  • User-2108535101 posted
    Hello, I´m new in the ASP.net program, I´m programing in Visual studio net 2003 with ASP.NET and C#, I create a Mobile web form, but when I try to use javascript the html design say me this element is not available in the schema, Why?, How can I use javascript in the asp mobile?

    Please help me.
    Friday, October 21, 2005 11:54 PM

All replies

  • User-1781446331 posted
    You need to use the Page.RegisterClientScriptBlock Method if you want to add a block of script (i.e. code to call later on). And/Or use the WEBCONTROL.Attributes.Add method to trigger events (such as onFocus or onClick, etc.). This is a method of the Attributes collection that belongs to all WebControl objects. For example: myControl.Attributes.Add("onClick","alert('You clicked on myControl');"); would Create Javascript that would cause a MessageBox to appear that said "You clicked on myControl" when you click on the control. Have fun experimenting, and check the Library for more info on this function.
    Sunday, October 30, 2005 3:09 AM
  • User-751653828 posted
    That is not really the answer I think he was looking for [:)].

    Essentially on mobiles, you have very limited functionality to leverage off. Most mobiles do not support JavaScript. Only the most recent models, we have been seeing some support, however, still very limited. As I said to one of our clients, a mobile application should be small and lightweight. Not a lot of images, functionality that a PC can do cannot be expected a mobile to do. Why they still want to build this mobile application that only targets his type of phone model is beyond me...
    Sunday, October 30, 2005 3:31 AM