J
Jeff
hi
asp.net 3.5
In the code below I put the contens of Report.aspx into an email.
The problem is that the Page_Load of Report.aspx isn't executed
How can I get the Page_Load to be executed? In the Page_Load to set value to
a few Literal objects and load a picture from the database....
If Page_Load cannot be executed, then how can I set those values?
string url = Request.Url.ToString();
url = url.Substring(0, url.IndexOf(Request.ApplicationPath));
url += Request.ApplicationPath;
url += "/Email/Report.aspx";
MailMessage msg = new MailMessage(from, "<recipient>");
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
WebResponse res = req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
msg.Body = sr.ReadToEnd();
msg.IsBodyHtml = true;
sr.Close();
res.Close();
asp.net 3.5
In the code below I put the contens of Report.aspx into an email.
The problem is that the Page_Load of Report.aspx isn't executed
How can I get the Page_Load to be executed? In the Page_Load to set value to
a few Literal objects and load a picture from the database....
If Page_Load cannot be executed, then how can I set those values?
string url = Request.Url.ToString();
url = url.Substring(0, url.IndexOf(Request.ApplicationPath));
url += Request.ApplicationPath;
url += "/Email/Report.aspx";
MailMessage msg = new MailMessage(from, "<recipient>");
HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create(url);
WebResponse res = req.GetResponse();
StreamReader sr = new StreamReader(res.GetResponseStream());
msg.Body = sr.ReadToEnd();
msg.IsBodyHtml = true;
sr.Close();
res.Close();