.net calendar - make a whole cell postback (clickable)

I have a .net calendar that starts and runs information from a database. By default, the day number has the opposite effect.

I am trying to do this with respect to the whole cell, so the user does not need to click only the text link.

I am a dayRenderer action. I have the following line to try and replicate the action, but the second argument I'm not sure how to set it.

It seems to give an identifier, for example. 3315, but I'm not sure how to get the required id manually for this code below. I hope this makes sense! I am new to .NET, so I don’t really understand my terminology!

e.Cell.Attributes.Add("OnClick", 
    string.Format("javascript:__doPostBack('{0}','{1}')", 
    Calendar1.ClientID, ***ID_NEEDED_HERE***));
+3
source share
3 answers

A parameter is the number of days from January 1, 2000, on the first day of your calendar, preceded by "V".

Thus, the identifier "V0" means January 1, 2000, the identifier "V5" means January 6, 2000, the identifier "V-5" means December 27, 1999.

Greetings

Ruben

0
source

put

e.Cell.Attributes.Add ("OnClick", e.SelectUrl);

in your dayRenderer will simulate a click on the number.

+3
source

, . DayRender Sub()

Private AdditionaleText ( ByVal , ByVal e As System.Web.UI.WebControls.DayRenderEventArgs)

= "MyText"

e.Cell.Text = "< ref =" e.SelectUrl "style =" "color: # 663399 font-size: X-small" " > " "

'

e.Cell.Text + = "
" e.Day.DayNumberText e.Cell.Attributes.Add( "OnClick", e.SelectUrl);

Sub

, , e.SelectUrl ,

"javascript: __ doPostBack ('ctl00 $ctl00 $MainContent $ContentPlaceHolder1 $CalendarSailingDay $Calendar', '" ID "style =" "color: # 663399" " >

.... . !!!

0
source

Source: https://habr.com/ru/post/1704341/


All Articles