Click here to Skip to main content
16,005,080 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionReports Pin
Deepak the Cool22-Nov-07 18:28
Deepak the Cool22-Nov-07 18:28 
AnswerRe: Reports Pin
Vasudevan Deepak Kumar22-Nov-07 19:26
Vasudevan Deepak Kumar22-Nov-07 19:26 
GeneralRe: Reports Pin
Deepak the Cool22-Nov-07 19:45
Deepak the Cool22-Nov-07 19:45 
GeneralRe: Reports Pin
Vasudevan Deepak Kumar22-Nov-07 20:36
Vasudevan Deepak Kumar22-Nov-07 20:36 
GeneralRe: Reports Pin
Deepak the Cool22-Nov-07 20:54
Deepak the Cool22-Nov-07 20:54 
QuestionRow Delete In GridView Pin
Rinki Mukheraji22-Nov-07 18:23
Rinki Mukheraji22-Nov-07 18:23 
AnswerRe: Row Delete In GridView Pin
Sun Rays22-Nov-07 18:59
Sun Rays22-Nov-07 18:59 
Question(asp:calendar) Linq to XML in DayRenderEvent Pin
welldone10122-Nov-07 18:12
welldone10122-Nov-07 18:12 
I can't seem to get this to work. I just doesn't do anything at all. I've been working on it for about a week and I think I'm doing something fundamentally wrong here. I know I'm executing my Calendar1_DayRender event because when I just make it draw peachpuff for a background color it does it. However I can't get the access to my document to go right. I'm not really sure if it's accessing my document correctly, and the debugger isn't communicating to me. Is there a better way to do this? (such as putting the data-access in a different method and calling it from the event?)

protected void Page_Load(object sender, EventArgs e)
{
}

protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
XDocument eventsXML = XDocument.Load(Server.MapPath("Events.xml"));

var events = from theevent in eventsXML.Descendants("event")
where theevent.Element("event") != null
select new
{
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 item in events
where item.EventDate.Month == DateTime.Now.Month
select item;

foreach (var item in thismonth)
{
if (item.EventDate.Date == e.Day.Date)
e.Cell.BackColor = System.Drawing.Color.PaleVioletRed;
}
}



Example of XML:



"1.0" encoding="utf-8" ?>

<event>
JET
Marti
Mid-Year Conference
Mid-Year Conference
Hachinohe

2007/11/21
8am

event>
<event>
JET
Marti
Mid-Year Conference
Mid-Year Conference
Hachinohe

2007/11/22
8am

event>
<event>
JET
Marti
Mid-Year Conference
Mid-Year Conference
Hachinohe

2007/11/23
8am

event>
Questiongridview row select Pin
Sunil Wise22-Nov-07 17:48
professionalSunil Wise22-Nov-07 17:48 
AnswerRe: gridview row select Pin
Sun Rays22-Nov-07 18:05
Sun Rays22-Nov-07 18:05 
GeneralRe: gridview row select Pin
Sunil Wise22-Nov-07 18:31
professionalSunil Wise22-Nov-07 18:31 
GeneralRe: gridview row select Pin
Sun Rays22-Nov-07 18:54
Sun Rays22-Nov-07 18:54 
GeneralRe: gridview row select Pin
Sunil Wise22-Nov-07 23:34
professionalSunil Wise22-Nov-07 23:34 
QuestionSearch Pin
Rock Star.22-Nov-07 17:45
Rock Star.22-Nov-07 17:45 
AnswerRe: Search Pin
Christian Graus22-Nov-07 18:06
protectorChristian Graus22-Nov-07 18:06 
AnswerRe: Search Pin
Deepak the Cool22-Nov-07 18:17
Deepak the Cool22-Nov-07 18:17 
QuestionLast 10 disit number or 10 character from from 13 disit nuber or 13 character Pin
Sarfaraj Ahmed22-Nov-07 12:27
Sarfaraj Ahmed22-Nov-07 12:27 
AnswerRe: Last 10 disit number or 10 character from from 13 disit nuber or 13 character Pin
Mustafa Ismail Mustafa22-Nov-07 12:41
Mustafa Ismail Mustafa22-Nov-07 12:41 
QuestionError Message - Try-Catch Block Pin
dataminers22-Nov-07 9:26
dataminers22-Nov-07 9:26 
AnswerRe: Error Message - Try-Catch Block Pin
dataminers22-Nov-07 9:57
dataminers22-Nov-07 9:57 
GeneralRe: Error Message - Try-Catch Block Pin
pmarfleet22-Nov-07 11:23
pmarfleet22-Nov-07 11:23 
AnswerRe: Error Message - Try-Catch Block Pin
Sherin Iranimose22-Nov-07 18:12
Sherin Iranimose22-Nov-07 18:12 
QuestionDropdown inside a repeator control using vb Pin
Oga M22-Nov-07 5:53
Oga M22-Nov-07 5:53 
QuestionASP.NET variables and javascript Pin
The Onslaught22-Nov-07 5:04
The Onslaught22-Nov-07 5:04 
AnswerRe: ASP.NET variables and javascript Pin
Braulio Dez22-Nov-07 5:53
Braulio Dez22-Nov-07 5:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.