C# Equivalent

R

Ricardo Martins

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
 
M

Mythran

Ricardo Martins said:
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
 

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top