Saturday, March 24, 2012
passing variables between web page events & httpmodules events
which stores key/pair values but it is available every the httpcontext
object is available.
Regards
--
----
Got TidBits?
Get it here: www.networkip.net/tidbits
"shiv" <kadalli@dotnet.itags.org.hotmail.com> wrote in message
news:082a01c3b295$6d2db890$a501280a@dotnet.itags.org.phx.gbl...
> hi all,
> I need to access some variables which are generated in
> preRequestHandler Event in httpModule. I need these
> variables in Page ButtonControl Click event. Is that
> possible? I don't want to use session variables here. has
> anybody got some inputs here.
> Thanks in advance,
> regards
> shivThanks Alvin,
I too found out the same. You reaffirmed my findings!.
Thanks a millon!
regards
shiv
>--Original Message--
>Use the item property on the httpcontext object. It's a
dictionary object
>which stores key/pair values but it is available every
the httpcontext
>object is available.
>Regards
>--
>
>----
>Got TidBits?
>Get it here: www.networkip.net/tidbits
>"shiv" <kadalli@.hotmail.com> wrote in message
>news:082a01c3b295$6d2db890$a501280a@.phx.gbl...
>> hi all,
>>
>> I need to access some variables which are generated in
>> preRequestHandler Event in httpModule. I need these
>> variables in Page ButtonControl Click event. Is that
>> possible? I don't want to use session variables here.
has
>> anybody got some inputs here.
>> Thanks in advance,
>> regards
>> shiv
>>
>
>.
Wednesday, March 21, 2012
passing XDocument in DayRenderEvent?
This is probably a very simple solution but I am stumped. I am trying to render events on an asp:calendar control using LINQ. I have code behind that loads up my XDocument during Pageload and calls a dayrender event. But I can't figure out how to get my XDocument into the event argument to be tested on during the "if ..." statements. Here is the code, the commented out section is what is supposed to be run if I could get 'thismonth' into the event handler. The yellow-coloring section was just for testing.
protected void Page_Load(object sender, EventArgs e)
{
XDocument eventsXML = XDocument.Load(Server.MapPath("Events.xml"));var events = from theeventin eventsXML.Descendants("event")
selectnew
{
Organization = theevent.Element("organization").Value,
Creator = theevent.Element("creator").Value,
Name = theevent.Element("name").Value,
Description = theevent.Element("description").Value,
Location = theevent.Element("location").Value,
EventDate = DateTime.Parse(theevent.Element("Date").Element("Day").Value)
};var thismonth = from itemin events
where item.EventDate.Month == DateTime.Now.Month
select item;Calendar1.DayRender +=new DayRenderEventHandler(Calendar1_DayRender);
}
protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
if (!e.Day.IsOtherMonth && !e.Day.IsWeekend) <-------- Just for testing.
e.Cell.BackColor = System.Drawing.Color.Yellow;//foreach (var item in thismonth) <------ "thismonth does not exist in this context" how do I get it here?
//{
// if (item.EventDate.Date.Equals(e.Day.Date))
// e.Cell.BackColor = System.Drawing.Color.PaleVioletRed;
//}
}
Still no progress I've given up for now. When I move the entire data-access into the Calendar1_dayrender event it just "Object not an instance" errors out on "select new"
Weldon