Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Page_Load not executed

Reply
Thread Tools

Page_Load not executed

 
 
Jeff
Guest
Posts: n/a
 
      05-04-2009
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();


 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      05-04-2009
Turn AutoWireEvents to true. The other option is to add the event wire
explicitly in code. Those are the most likely solutions.

--
Gregory A. Beamer
MCP: +I, SE, SD, DBA

*********************************************
| Think outside the box!
|
*********************************************
"Jeff" <> wrote in message
news:%...
> 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();
>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page_Load is not executed in codebehind ericw3@gmail.com ASP .Net 3 02-03-2006 08:21 PM
Page_Load(...) not executed in MainWebForm.aspx Richard Lionheart ASP .Net 2 10-15-2005 06:15 AM
in VB.NET Page_load of a base class called after the derived class Page_load ? z. f. ASP .Net 0 10-19-2004 12:01 PM
page_load is executed twice when using validation controls =?Utf-8?B?TWFnZXNo?= ASP .Net 0 08-25-2004 11:39 AM
Why does page_load fire twice when inheriting from a common overridable Page_Load bminder ASP .Net 1 02-23-2004 08:54 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57