Howdy
I have an ASP.NET application that I'm having a little trouble with. I have a .aspx file that I want to use to call a DLL which contains functions to output information to the browser.
This is my DLL:
PHP Code:
using System;
namespace Test
{
public class Page : System.Web.UI.Page
{
public bool PrintHeader(string Title)
{
Response.Write("Hello " + Title);
return true;
}
}
}
And my aspx file:
PHP Code:
<%@ Assembly Name="Test.Page" %>
<%@ Page Language="C#" Debug="True" %>
<%
Test.Page bpage = new Test.Page();
bpage.PrintHeader("Hello world!");
%>
When I try to access the .aspx file though, I get an exception saying "Response is not available in this context.".
Heres the stack trace if it helps:
System.Web.UI.Page.get_Response() +63
BHeard.Page.PrintHeader(String Title) +14
ASP.index_aspx.__Render__control1(HtmlTextWriter __output, Control parameterContainer) in D:\B-Heard\Newroot\index.aspx:7
System.Web.UI.Control.RenderChildren(HtmlTextWrite r writer) +27
System.Web.UI.Control.Render(HtmlTextWriter writer) +7
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +243
System.Web.UI.Page.ProcessRequestMain() +1929
Can someone please explain to me how to go about using Response.Write and the Request property too in my DLL's?