Calendar and naming <A> i cells

Discussion in 'ASP .Net Building Controls' started by Karsten Lundsgaard, Jul 9, 2003.

  1. I have to name all the Dates in a Calendar-Control, so I
    can select the <A>-tags from javascript.

    The standart output is :
    <TD style="WIDTH: 14%" align="middle"><A style="COLOR:
    black" href="javascript:__doPostBack('DatePicker1
    $_ctl2','1310')">3</A></TD>

    I need to add : name="DatePicker1_14"

    <TD style="WIDTH: 14%" align="middle"><A
    name="DatePicker1_14" style="COLOR: black"
    href="javascript:__doPostBack('DatePicker1
    $_ctl2','1310')">3</A></TD>

    I'm using OnDayRender(), and can set the properties in
    the <TD>-tag. How do I set the properties in the <A>-Tag


    Regards

    Karsten Lundsgaard
     
    Karsten Lundsgaard, Jul 9, 2003
    #1
    1. Advertising

  2. Hi Karsten,

    I just did a quick check on this and it seems like you're out of luck. The
    private method GetCalendarButtonText is the one in charge of enclosing the
    LiteralControl representing the day number with an <a> element, this method
    is called *after* the DayRender event fires so you don't get a chance to
    modify the <a> element. This situation puts any nice solutions out of the
    picture. What you could do (we're entering the land of nasty solutions
    now...) is to subclass Calendar and override its Render method to call the
    base implementation and then do a search on every <a> element and add the
    required attribute.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Karsten Lundsgaard" <> wrote in message
    news:139b01c3461c$cef13a10$...
    > I have to name all the Dates in a Calendar-Control, so I
    > can select the <A>-tags from javascript.
    >
    > The standart output is :
    > <TD style="WIDTH: 14%" align="middle"><A style="COLOR:
    > black" href="javascript:__doPostBack('DatePicker1
    > $_ctl2','1310')">3</A></TD>
    >
    > I need to add : name="DatePicker1_14"
    >
    > <TD style="WIDTH: 14%" align="middle"><A
    > name="DatePicker1_14" style="COLOR: black"
    > href="javascript:__doPostBack('DatePicker1
    > $_ctl2','1310')">3</A></TD>
    >
    > I'm using OnDayRender(), and can set the properties in
    > the <TD>-tag. How do I set the properties in the <A>-Tag
    >
    >
    > Regards
    >
    > Karsten Lundsgaard
    >
    >
    >
    >
    >
     
    Victor Garcia Aprea [MVP], Jul 12, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    532
  2. Harman
    Replies:
    1
    Views:
    2,511
    Moiristo
    Jul 28, 2006
  3. Joel Finkel

    Cells[].Text or Cells[].Controls[0]

    Joel Finkel, Sep 1, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    313
    Joel Finkel
    Sep 1, 2003
  4. Parthiv Joshi
    Replies:
    1
    Views:
    709
    Samuel L Matzen
    Jul 6, 2004
  5. Webby

    Calendar Events Spanning Table Cells

    Webby, Jun 30, 2004, in forum: ASP General
    Replies:
    1
    Views:
    118
    Jeff Cochran
    Jun 30, 2004
Loading...

Share This Page