J
Jeff
Hi
..Net 3.5
Below is some vb.net code I'm trying to understand and convert to c#. Okay
the 2 first lines are okay. but the last 2 lines I have trouble with. For me
it looks like an if test,
TextBox1.Text = Calendar1.SelectedDate.ToShortDateString()
Dim div As System.Web.UI.Control = Page.FindControl("divCalendar")
If TypeOf div Is HtmlGenericControl Then
CType(div, HtmlGenericControl).Style.Add("display", "none")
End If
----
I converted the if test to this:
if (typeof(div) == HtmlGenericControl)
{
}
not sure that is correct translation
and another thing that bugs my mind is that in the vb.net code AFAIK, the if
test if div is of type HtmlGenericControl. okay but the code inside the if
test tryes to covert to HtmlGenericControl. don't see how a covert is needed
there... I'm confused here
any suggestions?
..Net 3.5
Below is some vb.net code I'm trying to understand and convert to c#. Okay
the 2 first lines are okay. but the last 2 lines I have trouble with. For me
it looks like an if test,
TextBox1.Text = Calendar1.SelectedDate.ToShortDateString()
Dim div As System.Web.UI.Control = Page.FindControl("divCalendar")
If TypeOf div Is HtmlGenericControl Then
CType(div, HtmlGenericControl).Style.Add("display", "none")
End If
----
I converted the if test to this:
if (typeof(div) == HtmlGenericControl)
{
}
not sure that is correct translation
and another thing that bugs my mind is that in the vb.net code AFAIK, the if
test if div is of type HtmlGenericControl. okay but the code inside the if
test tryes to covert to HtmlGenericControl. don't see how a covert is needed
there... I'm confused here
any suggestions?