Login


1
  Oracle
1
Tips about using JavaScript in Asp.Net
22 Feb 2015| Abdullah

All the samples are built using VS2015 preview. I decided against switching to VS2015 CTP for now in order to save time. Once the VS2015 full version is released, I'll upload the samples for that version. One of the most annoying issues you may face while using JavaScript in an Asp.Net application is referencing a server control in a page that inherits from a Master page. As an example, say we have an asp textbox server control and we want to get it’s text, if you’ve tried to do this using the document.getElementById(‘controlId’) function, you’d get the error message so why we get those errors while we are sure that the control’s ID and the JavaScript syntax are correct?! Well, the server controls’ IDs are changed in runtime, and they are concatenated with a prefix which is their content place holder, which in our case it would be the content of the master page and you can be sure from this if you run any page and view it’s source HTML using IE, try to search for any server control’s ID, you will find that it’s completely different from the one in the aspx file, so you have two choices in order to reference these controls correctly.I assume that installing roslyn related dlls is exactly the same in VS2015 CTP as it is in Preview version.In VS 2015 Preview you need to use the package manager to install your Roslyn

Your Comments



All the samples are built using VS2015 preview. I decided against switching to VS2015 CTP for now in order to save time.

  Info
Views 100
First Posted :2/22/2015