I have converted text to Image(.png) using ASP.NET C# in Visual Studio 2010. But the image created cannot be displayed in the browser after submitting and it shows an message
The image “http://localhost:49670/WebSite1/Default.aspx” cannot be displayed, because it contains errors.
During debugging there is no error or warning or anything like that. How can I resolve this?
Looking at the Url there is a chance that you are rendering image intermixed with HTML content…
Using ASHX is better option to render images – check out http://aspalliance.com/1322_Displaying_Images_in_ASPNET_Using_HttpHandlers.all