Can Calendar Control days be hyperlinks?

B

Bruce W..1

When someone clicks on a day in my Calendar control I want to postback
to the same page but with information in a querystring, different for
each day. Rather than posting back twice by using its SelectionChanged
event I want to do it the first time.

I've tried adding links and javascript in the Calendar's DayRender event
like this:
string x = "<a href=\"default.aspx?topic=" +
ViewState["topic"].ToString() +
"date=" + myDate + "</a>";

e.Cell.Attributes.Add("OnClick", x);
But maybe I'm just not doing it right.

It seems in the 1.0 Framework that the Calendar controls will postback
first (to the same page) no matter what. Is there a way I can change
the querystring on the client side?

Thanks for your help.
 
F

Francis Shanahan

Have you tried setting the Text property of the cell in the DayRender to be
your HTML?
 
B

Bruce W..1

Brian said:
do you want just the day text to be a link or the entire cell to be a link?
=========================================================

Either would be fine.
 
B

Brian Henry

just put the link text the normal <a href ='address'>e.day.daynumber</a> in
the text property of the e.cell

(i dont remember the name for the day number i just pulled that off the top
of my head, you will have to look at the member list for it to find it)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top