473,395 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Can Calendar Control days be hyperlinks?

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.
Nov 18 '05 #1
4 1998
do you want just the day text to be a link or the entire cell to be a link?
"Bruce W..1" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
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.

Nov 18 '05 #2
Have you tried setting the Text property of the cell in the DayRender to be
your HTML?

"Bruce W..1" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
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.

Nov 18 '05 #3
Brian Henry wrote:

do you want just the day text to be a link or the entire cell to be a link?

================================================== =======

Either would be fine.
Nov 18 '05 #4
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)
"Bruce W..1" <br***@noDirectEmail.com> wrote in message
news:3F***************@noDirectEmail.com...
Brian Henry wrote:

do you want just the day text to be a link or the entire cell to be a link?

================================================== =======

Either would be fine.

Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Greg | last post by:
How do you get rid of the days of the month that are not in the month selected in a calendar control? For example, I have a calendar control that shows November, at the beginning and end of the...
8
by: Shyguy | last post by:
Is it possible to create a calendar that shows previous input data and also allows for input of new data?
2
by: patrick delifer | last post by:
I am binding some data to a calendar control. Since I don't want to return all the Data from the DB, I would like to return only the data for the current view of the calendar. The calendar has...
0
by: Robert Ladd | last post by:
Hi, I'm trying to disable the asp.net calendar control from a javascript function, but it doesn't disable the doPostBack. To simplify the situation, assume a page with 4 controls. A...
4
by: Nad | last post by:
Hello, I have a user control that has a button and a Calendar. Once you click on the button I display the calendar. Now when I move this user control to a web form, once I click on this button...
3
by: Peter | last post by:
Does anyone have an example of how you would do a popup window when a user clicks on a day number link in the ASP.NET Web Calendar control? I am trying to create an event calendar similar to how...
5
by: Peter | last post by:
Is it possible to span / display a graphic in the web calendar control that spans more than one cell / day? Does anyone have an example of this? Thanks Peter
4
by: mimo | last post by:
Hi, I trying to develop an application that will have a calendar control that will allow me to put hyperlinks in the days of the calendar. And I need to be able to do this in a day, week, and...
4
by: Simon | last post by:
By default, days in the calendar control are simply displayed as numbers, I want to show some days in a different color in this control. What is the best way to do that? Thanks very much.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.