.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

javascript issues converting ASP.NET application from VS2008 to VS2010

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :ASP.Net

I have encountered some javascript issues migrating an ASP.NET web application from Visual Studio 2008 to VS 2010.

1. When retrieving a value from a control, the following javascript syntax worked in VS2008:


In VS2010, I have to change everything to the following format:


2. I use Master pages extensively.  In VS2008, when the ASP.NET web form is displayed in the browser, the ID for a control in a child form in the content placeholder uses the following convention:


In VS2010, the ID for a control in the placeholder uses the following convention:


The "ctl00" is dropped.  Wherever I have used


has to be replaced with


Is there an alternative to modifying reams of javascript code?

Are there any other javascript surprises I should anticipate during the conversion?





View Complete Post

More Related Resource Links

Any issues or concerns in converting VS2008 project to VS2010


I have been working on this project for a few months in VS2008.. now that we are getting closer to the end, one of the other programmers has been working and doing his in VS2010, so when i try to open his projects in VS2008 it just shows up as XML.. so i have to open in VS2010.. thats fine..

But if i try to open my project in 2010, it prompts to use the conversion wizard..

Should i be concerned or are there any issues with doing the conversion? Being the end of the project, i dont want to cause issues at this point.. So would like to know if converting the project file at this stage in our project a good idea? Will there be any issues using his code with mine since they were developed in 2 different versions..

Converting local report from VS2008 to VS2010

I am new to the local reports I have created one report in VS 2008. which has two tables 1st Table has attached to dataset name - dsPRMIQuote_dtblQuotationMain 2nd Table has attached to dataset name - dsPRMIQuote_dtblQuotationPayRoll (both the table contains sub reports).. To view this report I am using Reportviewer 9.0 It is working fine in VS 2008 But my project is moved to VS2010 I just copied reports including xsd files from to VS 2010 In VS 2010 to view this report I am using Reportviewer 10.0 But I am getting following error at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings) at Microsoft.Reporting.WebForms.LocalModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileNameExtension) at Microsoft.ReportingServices.Rendering.HtmlRenderer.ViewerRenderer.SPBProcessingStub.GetNextPage(RPLReport& rplReport) at Microsoft.ReportingServices.Rendering.HtmlRenderer.HTML4Renderer.GetNextPage() at Microsoft.ReportingServices.Rendering.HtmlRenderer.HTML4Renderer.InitializeReport() at Microsoft.ReportingS

Can I send an email from a smart device application in VS2008 or VS2010?


I have a smart device application for a portable terminal (terminal has GPRS and a SIM card) created using Visual Basic in VS2008.  I need to be able to send an email from this applicaiton. Can anyone tell me how to do this with either VS2008 or VS2010.

Test Run: Web Application HTTP Request-Response Test Automation with JavaScript


Write a simple browser-based request-response test automation using JavaScript that's platform independent and useful when you are working in a highly dynamic environment.

James McCaffrey

MSDN Magazine January 2010

Stress Testing: Custom LoadGenerator Tool Identifies the Issues Your Application Faces Under Stress


It's easy to postpone stress testing when developing an application, and it's easy to forgo it altogether. Having an easy-to-use framework at your fingertips to conduct these tests can make the task far less painful. This article walks you through an application that eases the task of generating load for a variety of layers within an application.

Brian Otto

MSDN Magazine April 2004

Blogging: Design Your Own Weblog Application from Scratch Using ASP.NET, JavaScript, and OLE DB


The ASP.NET advanced templated controls, such as the DataList and DataGrid, are perfect for many data representation situations. However, when you need the flexibility to render a variety of layouts, the Repeater control is what you need. In this article the author builds a full-featured blog application to illustrate the use of the Repeater and DataList controls that render nested data in a master-detail relationship. He then discusses how to override the default implementations of these controls by adding some client-side JavaScript code that makes the blog more responsive and enhances its usability.

Marco Bellinaso

MSDN Magazine October 2003

Issues with multiline textbox, javascript and IE


Hi All,

i have a requirement to embolden/italicise the selected  text in a textbox. the way it is implemented as is by using a js function which inserts <b> and </b> tags at the start and end of the selected text  for bold, and similarly <i> and </i> tags at the start and end of the selected text  for italics.

here is the code in c# (to add attributes to link buttons)

lkbBold.Attributes.Add("onclick", "AddHTMLTags('" + txtTitle.ClientID + "', 'B'); return false;");
lkbItalic.Attributes.Add("onclick", "AddHTMLTags('" + txtTitle.ClientID + "', 'I'); return false;");

the txtTitle is the id of the text box, which contains the selected text to be emboldend.

and here's the javascript method

function AddHTMLTags(textBoxId, format)
  var textComponent = document.getElementById(textBoxId);
  var selectedText;
  var textToReplace; 
  var content = document.getElementById(textBoxId).value;
  var content1 ;
  var content2 ;
  var newContent; 
      // For IE 
      if (document.selection != undefined)
        var len =  document.selection.createRange().text.length;
        var myrange

VS2010: Upgrading projects from VS2008

I just upgraded my VS2008 solution to VS2010 and have run into a problem. I have a .NET C# application that references a managed C++ DLL, which in turn links to a native static library. All this works just fine. However, whenever I attempt to run the C# application, Visual Studio claims that the native static library is out of date and must be recompiled. It does that even after I've just compiled the native library. When allowing VS2010 to build the native project, the only thing it does is this: 1>  LibraryName.vcxproj -> C:\Bleh\Blah\LibraryName.lib Is there a way I can figure out what's causing VS2010 to think the project is out of date?

How to open project in VS2008 which was created in VS2010?

How to open project in VS2008 which was created in VS2010?

Converting a Javascript/SQL array for use in asp.net VB

Hi all:   Thank you all in advance for your patience with me on this one!  This will be my first attempt at understanding code-behind. I have a JavaScript banner marquee that I am currently using in an ASP classic site.  I feed the script with banner info from a SQL array and the script runs the banners in a loop.  I want to use this on my ASP.net site conversion (from ASP classic) but I don't even know how to begin.  I have read some books, did the tutorials, but I will still need some help getting off the ground on this. Here is the ASP code.  I don;t care about the tables, rows, etc as that will be converted to CSS.  I just really need to know how to handle the array to feed the script.  Also, I am working in VB.net. I did not include the actual Javasrcipt either...  <% Set RS = Server.CreateObject("ADODB.Recordset") SQL = "SELECT xlaABMiBannersZones.bannerID, bannerfile, link FROM (xlaABMbanners INNER JOIN xlaABMiBannersZones ON xlaABMbanners.bannerid = xlaABMiBannersZones.bannerid) WHERE zoneid = '18' AND enddate >= GetDate()-1 ORDER BY enddate" set RS = conn.execute(SQL) Dim arrMini If RS.BOF AND RS.EOF Then RS.close set RS = nothing Else arrMini = RS.GetRows() End If RS.close set RS = nothing %> <div id="marqueecontainer" onmouseover="copyspeed=pausespe

Create a new target application - Secure Store Service administration issues

Hi,I am trying to create new target application, when I go to Secure Store Service in Centra admin I have:Cannot complete this action as the Secure Store Shared Service is not responding. Please contact your administrator.I have used this few days ago and avarything else is working fine on the server, and I have applications created with it running fine.Any help is appreciated.cheersValko

Visual studio converting from website to web application

I have followed the MSDN instructions in converting an VS 2008 Website project into a VS 2008 Web application project. I am running across the following two issues, let me know if anybody has any suggestions:1) When using the "Convert to Web Application" option, it shows an error "Generation of designer file failed. Unknown server tag XXXX"Most of the server controls are registered in web.config with:<add tagPrefix="UControls" namespace="APP_NAME.UI.WebApp.Utils" assembly="APP_NAME.UI.WebApp"/>How can I make the web application converter recognize the web.config settings?2) After the convertion above, when I try to compile the project I get errors of the form "Name 'CETest' Is not decaled". These are classes from an external library in the code behind files. The code behind files on the old website did not use "Imports" but again relied on web.config "<add namespace="APP_NAME.Business.Entities"/>"Is it possible to not use imports in the code behind file for web application ilike n the website project? Or is there other alternatives? Or will this be fixed if #1 is fixed?Any suggestions would be appreciated.

converting rdl to rdlc in VS2008


Hi I just read that this is nearly impossible. But in any case, I need to use my rdl design in a rdlc file.

I have been trying to replicate the design by hand, but the options are different, an I do not

know how to do it. Basically I need two row groups a details, and a parent on the same row.

Can anybody help? Thanks!

Opening vs2008 solution file in vs2010 - Framework targeting issue


Hey guys,

I am opening a vs2008 .sln file inside vs2010 - the conversion wizard shows up, and it goes through with no errors other than a pop up warning me that this solution needs .Net Framework 3.5 and that it is "not installed on this machine" - I chose to target it to .Net Framework 4.0 and to try to switch it later as an option.

I then bring up Properties - >Application -> Target Framework and in the dropdown, .Net Framework 3.5 is not listed - which is strange since in "Add or Remove Programs" I can see .Net Framework 3.5 is installed on my machine.

How can I get Framework 3.5 to show up in the dropdown so I can target this project to that framework?

Can't say I've ever done this, so I'm pretty sure I'm doing something wrong.


Update: I tried Method #1 here (http://blogs.msdn.com/b/robvi/archive/2004/02/17/75272.aspx) and I cannot see v3.5 - so where did it go? I'm confused why it is not in my registry but shows up in "Add or Remove Programs" list...


VB6 to VS2008 Conversion Issues


I have a VB6 component which is used by VC++6 component and other VB6 front end applications. 

I have converted VB6 component to VS.NET 2008 and built the DLL and TLB, then registered the same using RegAsm. But when I run application, the application is not getting loaded by saying DLL failed (invalid procedure or call).

I understand that we are calling a managed dll from unmanaged environment (VC++ and VB).

Can anyone help me on this issue at the earliest?

Many Thanks, SKampel

converting windows application to web application

I was trying to convert my windows application to a web application.
All things done , I have left with the single error while is like this.

Error   1       The ValueSerializer 'RoutedEventValueSerializer' cannot convert
from 'System.String'.

This error comes in the XAML file on the line :

 <EventTrigger RoutedEvent="MouseLeave">

Any idea how can I eliminate this... This application works perfectly
fine as windows application.

In the browser however I get this exception :

System.Windows.Serialization.BamlParseException: Error at element 'EventTrigger' in markup file 'Page1.xaml' : An EventTrigger requires a value for its Event property..
   at System.Windows.Serialization.BamlRecordReader.ThrowExceptionWithLine(Int32 lineNumber, Int32 linePosition, String message, ParserContext parserContext, Exception innerException)

I am using JAN CTP.

VB WCF Workflow Service Application - WcfTestClient.exe different to C# in VS2010



I was following the simple introduction to WWF at http://msdn.microsoft.com/en-us/netframework/ff802403.aspx and I've noticed that a new C# WCF Workflow Service Application project created will then compile and run WcfTestClient.exe.  If I create the VB Version of that same project I get a Browser web page, not the WCF client. Is this a bug in the VS2010 VB bits?  How do I change the project to correctly execute WcfTestClient.exe manually in my VB Project?

Jamie Clayton http://www.jenasysdesign.com.au
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend