I have added a webservice to my website that references NewtonSoft.JSON library and it is giving me the following error
'Formatting' is an ambiguous reference between 'Newtonsoft.Json.Formatting' and 'System.Xml.Formatting'
I obviously don't want to change the .net page below, has anybody come across this issue before? Is there any way to disable the refernce for web services?
I have downloaded Json.net dll from http://json.codeplex.com/releases/view/43775. I extracted asp.net 2.0 dll and copied into my application bin folder under applicationin folder in inetpubwwwroot.Then I added json refrence in inline aspx code page as<%@ Import Namespace="Newtonsoft.Json" %>Now whenever I try to run my aspx page, it gives me following errorThe type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) at System.Web.Compilation.AssemblyBuilder.Compile()
I am getting an error when trying to serialize an object products. Product product = new Product(); product.Name = "Apple"; product.Expiry = new DateTime(2008, 12, 28); product.Price = 3.99M; product.Sizes = new string[3,2] { {"Small","40"}, {"Medium","44"}, {"Large","50"} }; string json = JsonConvert.SerializeObject(product);//this line is throwing an error
Array was not a one-dimensional array. Is there any way to serialize a two dimensional array with Newtonsoft.json.
Please suggest me some good reference for learning RDLC reports. Does it provides all the features as provided by BOE3.1(Business Objects Enterprise 3.1).
How to Find All the Web Services and Windows Services Running on a Server in ASP.Net. I have the server details with me and want to find all the Web services running on it.
I am using Visual Studio 2010 Release candidate1. I have to deploy my web application which consists of a website, certain window services, certain WCF services and Sql Server 2005 database.I read Vishal Joshi's blog(http://vishaljoshi.blogspot.com/2009/09/overview-post-for-web-deployment-in-vs.html) detaing Web Package in VS2010. I want to know how to deploy window services and WCF services using Web Package. Also, I want to create a web setup (.msi) for deployment instead of Web Package so that the .msi takes care of all the application and database deployment like the web package does.
I am using HTML controls while using Ajax in my .net project. Now I want to make my text box to be autocomplete. I am fetching a data using a query for the respective typed text but i am not sure how to bind that data to text box and show it the way it is being displayed in google and other famous sites. I would also love to know the way using web services. Which way is more efficient?
When you use ASP.NET web site (instead of web application model) and add reference to an assembly from local folder, Visual Studio, it seems, understands that this local assembly is also in GAC and so does NOT copy this assembly to bin folder (as it does with non-GAC assemblies), but simply adds new record in web.config file.
Why such a behaviour? Is it possible to force copy to bin folder (I need this since .dll is not on target environment)? I can add assembly to bin folder as file and it will work, but in this case bin folder contents will be in source control, which is not good.
I am working on converting a project from C# to VB and am facing this weird issue. 1 page cannot compile and I get the reference error, but the weird thing is that the compiler shows the error as coming from ASP.NET generated code. Visual Studio shows me that error is coming from my ASPX page. I cannot seem to figure out why or where this error is occuring. Also if I take the inherits attribute out I don't get the compilation error. The code in aspx page is below:
I have a Web service which, when updated on one computer with VS2008 works perfectly fine, but on another computer does not. The critical difference is the contents of the auto-generated Reference.cs.
In the correctly functioning environment, the methods have fully qualified class names, refering to classes in a class library. However, in the problem environment, the class names are unqualified and partial classes are declared near the end of the file. E.g.
[code]....
The code is under source control. Checking out to the working environment works straight away, checking out to the problem environment will only work if the reference.cs is manually edited to be like the working environments. Transferring the project manually from problem environment to the working one only requires an "Update Web Reference" to be performed to allow compilation. Both Reference.cs files claim to be auto-generated by the same tool version. The settings from the good environment have been exported to the other. No success so far...
http://www.somepage.com/main.aspx. In this page, when I click on a link it takes me to a page http://www.somepage.com/cental.aspx?cid=200. So in the cental.aspx.cs page I did the following in the page load:
if(request.querystring["comp"].tostring() != null) { //do some thing [code].....
So I got an error like: object reference not set to an instance of reference.My problem is, I am using the same page. So when I go from some page, I will have "comp". but other times not. So when there is no "comp", how do I handle it in request.querystring?
Makes it sense to use ASP.NET applications together with WCF RIA Services or WCF Data Services (to encapsulate the data access layer) ? Or are these technolgies only useful for Silverlight applications.
So I'm trying to get away from Tables for positioning. I labored through making my page look how I want it to with CSS. When I run it through the debugger, it comes up looking how I want it to in I.E. 8. Then I publish it and run it off of IIS on a network server through I.E., and all the controls are lined up against the left side of the screen, stacked on top of one another.? My colors are correct so it is reading my style sheet, it just seems to be ignoring any positioning.
I have a multiline textbox whose .Text property get saved in an SQL 2008 DB. When I submit the textbox, I loose the returns. How do I handle this?
I've used Enviroment.Newline() to do some html conversion stuff, but I've never ran into this specific problem.
Edit: Nevermind, it was working just fine, but I was replacing " " incorrectly. Stupid mistake. I have to convert the " " to <p> tags. I've done this before, but if anybody wants to answer, I'll mark their answer as correct.
I have a problem with my XML that I am trying to display on my ASP.NET page. What I would like to do is display it on a multi-line so I have an XML file that looks like this:
<?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="News.xslt" ?> <newslist> <news> <date>20th June 2010</date> <detail>Detail line 1.
[Code]....
When it displays the first detail line everything is on the same line. I've done some digging about and I have tried the following:
xml:space="preserve" in the XSLT file in the XML file<br />
I've even tried leaving it as it is.
I am using Microsoft Visual Web Developer 2010. The control I am using is the XML control under the standard tab, and the language I am using is C#.
Using: .Net 4.0/C#/VS 2010 Express/ASP.NetImplemented the Routing as described here: http://msdn.microsoft.com/en-us/library/cc668202(VS.90).aspx.Here is my application: I have created a blog, the main page of which is called "default.aspx." Default.aspx contains a series of links to posts, each with a unique link. To get to an individual post, I utilize routing, using this URL format: tp://localhost:55074/WebSite3/2010/9/15/this-is-a-test-post~4. i parse the URL to get the year/month/date of the post, as well as the post title.This works fine.The problem occurs when I go to an individual post.All the links are broken.For example, I have a link at the top that takes you back to default.aspx (in the html, I have the link set up like this: <a href="default.aspx">Home</a>), except that now the link takes me here: http://localhost:55074/WebSite3/2010/9/15/default.aspx.Obviously, there are no 2010, 9, or 15 subdirectories, and default.aspx is in the root directory.Also, when I load an individual post, Request.Url.AbsolutePath returns this: /WebSite3/2010/9/15/this-is-a-test-post~4.
to fix the following "feature" of Htmleditor:1. Go to Htmleditor demo http://www.asp.net/ajax/ajaxcontroltoolkit/samples/htmleditor/htmleditor.aspx 2. Type "æøåąčęėįšųūžвьпаджфк" or something more or less weird there 3. Press Submit buttonResult: First free letters (danish) are replaced with question marks, all other letters (lithuanian and russian) remains as they should.What's wrong with danish letters and can it be fixed without replacing such letters with html escape sequences?
I have an autocomplete extender on my page and it works fine. However as soon as I set focus of its textbox via either straight javascript or codebehind the autocompleteextender no longer works.
I am running into a strange problem I don't fully understand. The main symptom is that when I double click a link (that points to a controller action) in my MVC application, my database server connection gets blown, and I get the error :
Execution of the command requires an open and available connection. The connection's current state is broken.
If I step through starting at a breakpoint at the top of the controller action, it will step down a couple lines and then jump back up to the breakpoint. Somehow the first request isn't executing fully before the second one gets there, and somehow my database connection breaks when it gets to any query. Every time this happens, I have to restart the application server.
It was happening intermittently at first, but the double clicking of links seems to reproduce it everytime. Does this happen to anyone else? What am I missing here?
Update :
A.) I incorrectly tagged this as Linq-to-sql when we are actually using Linq-to-entities. B.) The connection object is defined as a member variable of the controller :
[Code]....
I noticed in some of the asp.net tutorials they declare the variable in the same spot but have a separate constructor for the controller where the db object is initialized. Does this make any difference?
C.) The problem is not only with the double-clicking as described above. The connection breaks at other seemingly random times; I cannot seem to reproduce the error consistently (even double-clicking does not always break it). Restarting the web site usually fixes it, although sometimes I have to restart the host machine. After its back up, repeating the same sequence of actions usually does not reproduce the same error!
Maybe there's something I don't understand about setting up my linq-to-entities classes or the nature of the database connection. Does anyone have any thoughts? I really don't even know how to investigate this one!