Script in WebForm

  • Thread starter Thread starter AV
  • Start date Start date
A

AV

I am not able to use the script below,
its giving and Execption (MessageName Space)
THE TYPE OR NAMESPACE NAME 'MESSAGE' COULD NOT BE FOUND

this is an example from the GOTDOTNET site

http://samples.gotdotnet.com/quickstart/util/srcview.aspx?
path=/quickstart/aspplus/samples/webforms/controls/controls
3.src&file=CS\controls3.aspx&font=3

<script language="C#" runat="server">


void EnterBtn_Click(Object Src, EventArgs E) {
Message.Text = "Hi " + HttpUtility.HtmlEncode
(Name.Text) + ", welcome to ASP.NET!";
}

</script>
 
The script is referencing a Control (most likely a Label) named "Message".
If it isn't on your Page, that would cause the problem you describe.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.
 

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

Back
Top