here is an odd one. I was able to add alink button and it can post back here
is how:
If e.Day.Date = Now.Date Then
Dim lbtntemp As New LinkButton
lbtntemp.Text = "go here"
lbtntemp.ID = "thsLnk"
lbtntemp.CommandName = "ths One"
lbtntemp.CommandArgument = "1"
lbtntemp.Attributes("onClick") =
"javascript
:__doPostBack('LinkButton1','2day') "
e.Cell.Controls.Add(lbtntemp)
Dim btnbx1 As New Button
btnbx1.ID = "mytxt"
btnbx1.Text = "go"
btnbx1.CommandArgument = "ths" & Now.Date
btnbx1.CommandName = "ok_GO"
e.Cell.Controls.Add(btnbx1)
' DataBind()
End If
the link did work. The button did also, but not the way i wanted. I'm still
working onthis do you want me, but made some progress.
do you want me to keep you posted?
thanks
kes
"Karl Seguin" wrote:
You should read the DayRender documentation:
Note Since the DayRender event is raised while the Calendar control is
being rendered, you cannot add a control that can also raise an event, such
as LinkButton. You can only add static controls, such as
System.Web.UI.LiteralControl, Label, Image, and HyperLink.
I guess you're stuck with using a <a href=....> and pass something in the
querystring..
AS for your <br> question, try:
e.Cell.Controls.Add(New LiteralControl("<br>"))
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Kurt Schroeder" <Ku***********@discussions.microsoft.com> wrote in message
news:0E**********************************@microsof t.com...I am trying to add a link button to a calendar.
this is a simple example:
Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
If e.Day.Date = Now.Date Then
Dim lbtntemp As New LinkButton
lbtntemp.Text = "go here"
lbtntemp.ID = "thsLnk"
e.Cell.Controls.Add((lbtntemp))
End If
End Sub
3. issues
1. i do not have a link, only text
2. i want to pass parameter(s) withthe link
3. how can i add a <br> to the cell if i want to add multile items?
Thanks!!!
kes