ASP.NET Literal control - Removed text

  • Thread starter Thread starter Ray Booysen
  • Start date Start date
R

Ray Booysen

Hi all

I have a function that generates some HTML for a literal control.

The code is simply:

public string RenderCalendar( string ControlID)
{
return "<span id=\"" + "cal_" + ControlID + "\" onclick=\"DoCalendar('"
+ ControlID + "');\">...</span>";
}

It simply adds the characters "..." to the literal control and onclick
opens a new window via DoCalendar() in javascript.

However, when rendered the id of the span is removed! Is there any
reason why ASP.NET would remove the ID tag from the span?

Kind Regards
Ray
 
Ray said:
Hi all

I have a function that generates some HTML for a literal control.

The code is simply:

public string RenderCalendar( string ControlID)
{
return "<span id=\"" + "cal_" + ControlID + "\"
onclick=\"DoCalendar('" + ControlID + "');\">...</span>";
}

It simply adds the characters "..." to the literal control and onclick
opens a new window via DoCalendar() in javascript.

However, when rendered the id of the span is removed! Is there any
reason why ASP.NET would remove the ID tag from the span?

Kind Regards
Ray
My fault, The code that didn't have the ID wasn't using this method to
generate the span.
 
Back
Top