I tried to create a simple web application to trigger mail from my company domail address to the outside mailbox. While doing so, i came to know about system.web.dll namespace. I couldn't find the system.web.dll in the add reference. Where can i find? or Is there any other namespace that can be used for mail triggering? This is the reference page i checked.
If there is any other pages which can teach me basic asp.net mail triggering concepts means, please post the link here. It will be very useful.
You have to add reference to that web.dll Right click on reference folder and choose Add Reference. New window will open, select the first .net Tab. You will find list of dlls go to web.dll and select it.
Karthik,
I don't recommend using the System.Web.Mail, since it's been deprecated since 2005.
Use the SmtpClient class in the System.Net.Mail namespace instead.
Related
I just created a new web site in Visual Studio 2012. I also created a new Class Library. I added a class, another class inside that first class and then a method. I compiled the library and added as the reference in the bin folder for the web site.
In a aspx.cs page I can now see my new method. Great. I go to create a second method in the same location, go back in my aspx.cs page, can't see it. It says there is definition for this method.
I compile the class library just in case. Can't see it. I clean the solution, build the whole solution, still can't see it.
I actually have to remove the reference from the bin folder of the web site and add it back so that now I can see the second method.
I worked on another project where (I believe) things were set up the same way (web site + class library) and by typing the new method in the class and saving the file was enough to reach this method from an aspx page.
What can I change in my solution so that the new method in the class library can be seen directly?
ps: the aspx.cs page has using myLibrary; at the top;
Thanks
Make sure in your solution that you are using the References folder. Right-click it, choose "Add Reference" and then use the Solution tab to reference your class library project. Taking this approach, every time you update your class library the web project will automatically receive the update.
It sounds like you might be adding the binary to the BIN folder of the website project and then referencing it from there?
First of all check if build is going to debug folder or bin folder. If you are referencing project then make sure that build order is correct and dependency set accordingly. Also check for class library or project referred solution is not building on client profile, select targeted framework.
I went through this article (http://msdn.microsoft.com/en-us/library/cc667410.aspx) which shows how one can debug asp.net source code.
Now, I'm having some serious trouble using the new SimpleMembershipProvider in WebMatrix.WebData namespace, and I want to debug it, but I'm not able to. When I try to step into the WebSecurity.CreateAccount method, it just steps over the method call.
I'm using Visual Studio 2012 Ultimate. What am I missing?
Is WebMatrix.WebData a third party dll? If so, you might need to decompile it, get the source and then add the source to your solution. Otherwise I don't think you'll be able to set into it.
Hi I have created a user control which is inside a folder called Controls and the class is a partial class which inherits from Web.UI.UserControl. Now from my page which is one level up I just try to access the method inside the usercontrol and so trying to cast it as the type of user control.
But I get build errors. It just cannot recognize that class. I get Type not defined error. But at times it has recognized the class. Dont know why it does that.
Hi Finally I was able to resolve the issue by converting to web application from a website. Now it works exactly as desired. I think there are problems with visual studio website apps. As far as I have read websites do not have as robust support as web app has. So thankyou all for your comments. Finally the flakiness is gone.
I have converted my old VS2008 Website to Web Application, now everything was working before I tried to convert it. But now I don't seem to be able to reference my Classes? For example I have a BasePage class that every .aspx page inherits like so
public partial class SomePageName : BasePage
{
}
But now I get this message? And the same for all the other classes?
The type or namespace name 'BasePage' could not be found (are you missing a using directive or an assembly reference?)
How do I find out which 'using' directive I am missing and whats an assembly reference?
The conversion namespaced your classes. Perhaps it should be NewlyAddedNamespace.BasePage?
Locate the class BasePage in your project using the object explorer.
In object explorer you will be able to see the complete name Something.Somethingelse.BasepAge
Do mass search and replace to the complete name.
In Solution Explorer (available on the View menu if you can't see it), you will see that your web application contains a node marked "References". Right click on this and choose "Add reference", and when the dialog box appears, on the Project tab you be able to add a reference to the other project which defines this BasePage class. This then becomes an assembly reference when compiled.
You probably already have the using statement you need from before. Previously, this would have been picked up by the presence of the necessary DLL in the bin folder of the web project. It works differently for a web application.
How to convert in a Web Site Project - will get you started - it is for VS2005 but will still be applicable for Visual Studio 2008.
You might want to take a look at the difference between the 2 types of projects. That said, website projects generally are not created with namespaces, I would guess that "BasePage" was in you appCode folder and has now been converted into a different namespace. You just need to line you your namespaces and everything should work correctly.
What you could try is "Convert to Web Application" in Visual Studio. It is available in the context menu of the new Web Application project in Visual Studio.
There's another possible issue. You might need to set the "Build Action" to "Compile instead of Content. Right-click the .cs file, bring up the properties and make sure the Build Action is compile.
I am working in a .NET 2.0, recently upgraded to .NET 3.5 environment (VS2008, VB.NET) on an existing ASP.NET website project. I am able to generate a Linq-to-SQL Class (also called a DataContext?) in the App Code folder, drag over tables from an active connection, and save it. Let's call it MyDB. When I go to the code-behind file for my page and try to declare an object of "MyDBDataContext" it is not in the intellisense, indicating that it is not accessible.
I checked the references, and that has to be set correctly because I made the .dbml file.
I made a new test windows app project and it behaved exactly as expected, and I could follow this blog without a problem.
Is there something inherent to web projects that doesn't allow for these auto-generated objects to be usable? Is App Code the right place to declare it?
If you can't tell from the above, I am new to the industry and really new to LINQ.
thanks for your help.
Try expanding the dbml file and open the designer.cs file underneath, and make sure the DataContext class is in the same namespace as the codebehind class. If not, either change the namespace or include it with a using Namespace statement the top.
If it your dbml is in a folder inside of '/App_Code/' it may pick up the folder's name as a namespace. Eg: '/App_Code/DAL' would have the namespace 'DAL'. Give it a namespace in the designer or just use the namespace it is given, if this is the case.