The type or namespace name 'Ajax' could not be found - asp.net

I got an old project which consist of three different projects. When I am trying to build the project I am getting this error message:
"The type or namespace name 'Ajax' could not be found (are you missing a using
directive or an assembly reference?)"
I have found solution for missing project or namespace online but it looks like I am missing some default library.
The code looks like this:
//Ajax method to Check for existing file name
[Ajax.AjaxMethod()]
public DataTable CheckSearchName(string searchname){
// code goes here
}
Any help?

Finally the problem was solved. I was missing a reference for this project. I found a Ajax.dll file in my website's bin folder. Then all I had to do is just adding a reference to this file (Website/Project > Add reference > Browse > (Browse to Bin folder) > Ajax.dll
That did the trick.

That sounds like the really old Microsoft AJAX.NET library from the .NET 1.1/2.0 days.
See here: Microsoft AJAX.NET, which has a download link to the class library: Ajax.NET Professional.

Related

'bootstrap' is not a valid script name. The name must end in '.js'

I'm learning asp.net and so I'm trying to build up the project named "Wingtip Toys" from MSDN.
The project is developed on VS 2013 and I have VS 2012. When I try to add Bootstrap per the instruction from here I get the error on runtime in browser.
Server Error in '/' Application.
'bootstrap' is not a valid script name. The name must end in '.js'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: 'bootstrap' is
not a valid script name. The name must end in '.js'.
when I add the .js on the master page it shows me to another error:
The assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource that has the name 'bootstrap.js'. Make sure that the resource name is spelled correctly.
I also add the CSS file to Bundle.config but still the same result. I already have the NuGet package available, like for the jQuery.js error, but I'm unable to sort this out yet.
Here's what worked for me.
I added this to my BundleConfig.cs file:
ScriptManager.ScriptResourceMapping.AddDefinition("bootstrap", new ScriptResourceDefinition
{
Path = "~/scripts/bootstrap.min.js",
DebugPath = "~/scripts/bootstrap.js",
LoadSuccessExpression = "bootstrap"
});
Please go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solutions.
In Browse, search for: AspNet.ScriptManager.bootstrap
If your version of bootstrap is higher than AspNet.ScriptManager.bootstrap first uninstall bootstrap and then install AspNet.ScriptManager.bootstrap
go to:
Tools
NuGet Package Manager
Manage NuGet Packages for Solutions...
search for Bootstrap.css
install it
try to run your app

Can't reference Microsoft.Practices namespace after NuGet update

I updated NuGet packages today (8/19/2014) for both MVVM Light and the CommonServiceLocator. After doing this, my project can no longer resolve the Microsoft.Practices namespace. This means that the following won't work:
ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);
What should I do to resolve this? Thanks.
Are you having a namespace collision with another package perhaps?
You can access the object with it's full namespace:
Microsoft.Practices.ServiceLocation.ServiceLocator
Posting the full error message will help.
Can you make sure that the CommonServiceLocator dll and reference made it into the project?

How to import dll from bin folder without adding reference in asp.net

As in my project i used some dll by referencing in my project bin folder which only works when i paste my dll in my "C:windows/system32/mydll.dll" but when i paste my dll in bin folder and then runs my website on server it will show me error...."file not found" .
and i also used this method [DllImport("~/bin/mydll.dll")] to import it....
but it still showing me the same error "file not found"
And if i used add reference method then it shows me "Invalid COM component" error.....
please do suggest some simple and useful solution...
Because your dll had added as COM composant in your reference explorer, not as simple assembly.
Nota : If you want register an assembly as COM you can use RegSvr32 tool
Link : http://msdn.microsoft.com/en-us/library/ms859484.aspx
Try in code:
if (!Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process).Contains(HttpRuntime.BinDirectory))
Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process) + ";" + HttpRuntime.BinDirectory, EnvironmentVariableTarget.Process);

could not resolve <local:Item> to a component implementation

I am trying to implement item rendere example from TourdeFlex application. However, when I tried to run the application its giving me " could not resolve to a component implementation" error message beside the local items. I also added the assets folder and verified the visualization.swc.
Please let me know the solution to fix the issue.
THanks in advance.
Serenity.
local is XML namespace declared at the top of example, its like import in ActionScript. "Could not resolve" means referenced class is not found. Look at that namespace to determine where it must be placed. For example, xmlns:gui="gui.*" declares namespace gui which references classes from folder "gui".
Edit: xmlns:local="*" means "import all files from src directory". In src should be file Item.mxml or Item.as and it is missing (or failed to compile).

Unable to find web resource from assembly

I'm trying to load web resources from a linked assembly. Whatever I try, I get the exception:
Web resource 'MyNameSpace.scripts.jquery-min.js' was not found.
I'm using the following code to load it:
ScriptManager.RegisterClientScriptResource(this, typeof(MyNameSpace.SomeClass), "MyNameSpace.scripts.jquery-min.js");
What am I missing / doing wrong here, causing that exception?
My observations so far:
In the Reflector these resource is visible, and named as MyNameSpace.scripts.jquery-min.js
In the AssemblyInfo.cs file of the project, the file is registered as:
[assembly: WebResource("scripts/jquery-min.js", "text/javascript")]
The file lives in the 'scripts' directory
On a sidenote, I've tried using Page.ClientScript.GetWebResourceUrl() but this generates an URL without checking if the resource exists. It also seems WebResource.axd is not mapped in Web.config at all.
[assembly: WebResource("scripts/jquery-min.js", "text/javascript")]
Should be:
[assembly: WebResource("MyNameSpace.scripts.jquery-min.js", "text/javascript")]

Resources