hankthetank Posted March 10, 2004 Posted March 10, 2004 I'm trying to write to a server-side <span> tag but cannot make it work....can someone please help?? <span id="Message" runat="server"></span> When I try to write to the tag from the code-behind page I get a "Name 'Message' is not declared" error.... Public Class adminheader Inherits System.Web.UI.Page Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Message.InnerHTML = "<b>This is the text to display</b>" End Sub End Class Quote
WebJumper Posted March 10, 2004 Posted March 10, 2004 Your code normaly should work but ASP.net has it's own "server span" and it's named "Literal". Try it with this Control! Regards, Stefan Quote
*Gurus* Derek Stone Posted March 10, 2004 *Gurus* Posted March 10, 2004 http://www.xtremedotnettalk.com/showthread.php?t=83429 Quote Posting Guidelines
kahlua001 Posted March 10, 2004 Posted March 10, 2004 What do you mean it wont work? Any errors? How did you declare "Message" in your code behind, what type is it? Quote
hankthetank Posted March 10, 2004 Author Posted March 10, 2004 Thanks Derek....just needed to include the following declaration at the start of the code-behind page Protected WithEvents Message As HtmlGenericControl Cheers Matt Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.