C# Equivalent

Discussion in 'ASP .Net Web Controls' started by Ricardo Martins, Aug 23, 2004.

  1. How to transform the folowing code to C#:

    DatePicker os a Web Calendar Control


    private sub DatePicker_DayRender(ByVal sender as Object, ByVal e As
    System.Web.UI.WebControls.DayRenderEventArgs) Handles
    DatePicker.DayRender)

    Dim h1 as new Hyperlink()

    h1.Text = CType(e.Cell.Controls(0), LiteralControl).Text

    (...)

    End Sub


    Thanks
     
    Ricardo Martins, Aug 23, 2004
    #1
    1. Advertising

  2. Ricardo Martins

    Mythran Guest

    "Ricardo Martins" <> wrote in message
    news:...
    > How to transform the folowing code to C#:
    >
    > DatePicker os a Web Calendar Control
    >
    >
    > private sub DatePicker_DayRender(ByVal sender as Object, ByVal e As
    > System.Web.UI.WebControls.DayRenderEventArgs) Handles
    > DatePicker.DayRender)
    >
    > Dim h1 as new Hyperlink()
    >
    > h1.Text = CType(e.Cell.Controls(0), LiteralControl).Text
    >
    > (...)
    >
    > End Sub
    >
    >
    > Thanks


    private void DatePicker_DayRender(object sender,
    System.Web.UI.WebControls.DayRenderEventArgs e)
    {
    Hyperlink h1 = new Hyperlink();

    h1.Text = ((LiteralControl) e.Cell.Controls(0)).Text;

    (...)
    }

    You will need to attach the event handler where the rest of the code initializes.

    (Off top of head, not tested).

    Mythran
     
    Mythran, Aug 23, 2004
    #2
    1. Advertising

  3. Ricardo Martins

    jagadeesh Guest

    Hi
    Use this link,
    It is really helpful in such cases.
    Regards,
    Jagadeesh
    http://www.developerfusion.com/utilities/convertvbtocsharp.aspx
    "Ricardo Martins" <> wrote in message
    news:...
    > How to transform the folowing code to C#:
    >
    > DatePicker os a Web Calendar Control
    >
    >
    > private sub DatePicker_DayRender(ByVal sender as Object, ByVal e As
    > System.Web.UI.WebControls.DayRenderEventArgs) Handles
    > DatePicker.DayRender)
    >
    > Dim h1 as new Hyperlink()
    >
    > h1.Text = CType(e.Cell.Controls(0), LiteralControl).Text
    >
    > (...)
    >
    > End Sub
    >
    >
    > Thanks
     
    jagadeesh, Aug 23, 2004
    #3
    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. Brendan Duffy

    Re: Image Scanning - TWAIN equivalent

    Brendan Duffy, Jul 24, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    1,497
    Brendan Duffy
    Jul 24, 2003
  2. Lolo
    Replies:
    3
    Views:
    602
  3. Sanjeev
    Replies:
    4
    Views:
    3,591
    Jonathan Bromley
    Jul 23, 2004
  4. Eric Peers
    Replies:
    2
    Views:
    1,392
    Jonathan Bromley
    Nov 18, 2004
  5. mag
    Replies:
    1
    Views:
    683
    Andy Peters
    May 19, 2005
Loading...

Share This Page