T
Trond
I'm having a problem when creating several calendars in a web form.
Here's a snippet of my code:
******************************
public string username;
private void CreateCalendars()
{
....misc DB-stuff
while (dr.Read())
{
username = dr["username"].ToString; //Sets the current user's
username
//to the global
variable,username.
Calendar usercalendar = new Calendar();
usercalendar.ID = "cal" + username ;
usercalendar.DayRender += new DayRenderEventHandle
(this.Calendar_dayrender);
usercalendar.SelectionChanged += new EventHandle
(this.Calendar_selectday);
PlaceHolder1.Controls.Add(usercalendar);
}
}
private void Calendar_dayrender(object sender, DayRenderEventArgs e)
{
Response.Write(username); //Should be written for every
while- //loops, not after the
last one.
}
**************************
My problem is:
The dayrender method writes the LAST user's username for every
calendars.
That means, the placeholder does not render the calendar object for
every while-loop.
Are there any work-arounds here?
Thanks in advance!
Here's a snippet of my code:
******************************
public string username;
private void CreateCalendars()
{
....misc DB-stuff
while (dr.Read())
{
username = dr["username"].ToString; //Sets the current user's
username
//to the global
variable,username.
Calendar usercalendar = new Calendar();
usercalendar.ID = "cal" + username ;
usercalendar.DayRender += new DayRenderEventHandle
(this.Calendar_dayrender);
usercalendar.SelectionChanged += new EventHandle
(this.Calendar_selectday);
PlaceHolder1.Controls.Add(usercalendar);
}
}
private void Calendar_dayrender(object sender, DayRenderEventArgs e)
{
Response.Write(username); //Should be written for every
while- //loops, not after the
last one.
}
**************************
My problem is:
The dayrender method writes the LAST user's username for every
calendars.
That means, the placeholder does not render the calendar object for
every while-loop.
Are there any work-arounds here?
Thanks in advance!