473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

ASP.NET Literal control - Removed text

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
May 23 '06 #1
1 1226
Ray Booysen wrote:
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.
May 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
14
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I...
6
by: Joe | last post by:
I know that the Literal control will not render a <span> tag so I can not format its text. Other than this, what is the difference betwen the Literal control and the LiteralControl Control? How...
5
by: George Jordanov Ivanov | last post by:
All, Today I was playing with Literal control. Basically it is more or less like the Label control with this difference that Literal control is something like "lightweight" text container (that...
2
by: Mark A. Sam | last post by:
Hello, I want to use a literal control to provide information about people listed on a webpage, where the control is on the same line as the person it addresses, so that I have a button, the...
5
by: Mark A. Sam | last post by:
Hello, I am trying to use a literal control to past test onto a page from several buttons, so that each button displays something different. The problem I am encountering is that the text wraps...
5
by: paul.hester | last post by:
Hi all, I have a custom control with an overridden Render method. Inside this method I'm rendering each control in its collection using their RenderControl method. However, I'm running into a...
4
by: Neo Geshel | last post by:
Just moved to C# from VB.NET, frustrated to hell and back by inability to get much-copied (from about 20+ different resources) literal example to work. Master Page content: <meta...
5
by: cameljs18 | last post by:
Converting a string variable into a string literal. How do I add the @ character in front of the string? I cannot add it when the string is created as it will affect other parts of the program. ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.