WebPage Objetcs to another class

C

Cleber Schönhofen

Hi,
How i can pass webpage objects, like Server and Request, to another
class.
-------------
Page :
public partial class w_indice : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
libFunc.gravaLog("Test ");
}
}

Class :
namespace libFunctions {
public class libFunc : System.Web.UI.Page {
public libFunc() {
}
public void gravaLog(string msg)
{
// Escreve no arquivo de log
StreamWriter sw = File.AppendText(Server.MapPath("~/appWeb.log"));
sw.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + " : "
+ msg);
sw.Close();
}
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top