Thursday, March 22, 2012

Why the server controls do not show?

Hi,

I try to use WEB Controls on the ASP application but when I try to display
them on the WEB they don't show.
It's only the HTML controls that show only.
Thanks,
Doru> I try to use WEB Controls on the ASP application but when I try to display
> them on the WEB they don't show.
> It's only the HTML controls that show only.

Can you please post an example of some code that is failing to display
the controls correctly?
Check that you have runat="server" on the missing controls.

"Doru Roman" <doruroman@.rogers.com> wrote in message
news:uyAk1fgEGHA.2012@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I try to use WEB Controls on the ASP application but when I try to display
> them on the WEB they don't show.
> It's only the HTML controls that show only.
> Thanks,
> Doru
Thanks Sosh and Paul for the reply.
I use the runat="server"
Here is an example:

<%@. Page Language="VB" %>
<script runat="server"
sub Page_Load(obj as object, e as eventargs)
lblMessage.text = "Welcome to ASP.NET"
end sub
</script
<htmlk><body
<asp:Label id="lblMessage" runat="sever" />
</body></html
This was created in a text editor, but it same happens when I use Studio
..Net (2002) to create an ASP project.
Sorry, it is
<html> not <htmlk>, my typo. It seems that IIS is incapable of dealing with
server controls
Ah, you've written sever instead of server - is this the case with all of
them?

<asp:Label id="lblMessage" runat="sever" /
"Doru Roman" <doruroman@.rogers.com> wrote in message
news:ezSWPshEGHA.336@.TK2MSFTNGP14.phx.gbl...
> Thanks Sosh and Paul for the reply.
> I use the runat="server"
> Here is an example:
> <%@. Page Language="VB" %>
> <script runat="server"
> sub Page_Load(obj as object, e as eventargs)
> lblMessage.text = "Welcome to ASP.NET"
> end sub
> </script>
> <htmlk><body>
> <asp:Label id="lblMessage" runat="sever" />
> </body></html>
> This was created in a text editor, but it same happens when I use Studio
> .Net (2002) to create an ASP project.
The ASP application has the right spelling.
This is the part that the IIS is not recognizing:
<asp:Label id="lblMessage" runat="server" /
What I noticed is if I take out this
<script runat="server"
</script
and in the HTML body I have regular html controls they show, but if I put
the script tag back they dissapear from the page.
It seems that the <script> is something that triggers the whole problem.
> The ASP application has the right spelling.
> This is the part that the IIS is not recognizing:
> <asp:Label id="lblMessage" runat="server" /
What appears in the source code shown from the browser - do the
<asp:label ... /> tags exist there, or have they been stripped ?

If they *are* there, then ASP.NET can't be set up to parse pages
properly for your application. Do you have any other working ASP.NET
apps on your server?
> <script runat="server"
> </script
You're missing a > at the end of the first line there; should be:

<script runat="server">
...
</script
I made the correction, but no change, here is what the source code returns:

<%@. Page Language="VB" %>
<script runat="server">
sub Page_Load(obj as object, e as eventargs)
lblMessage.text = "Welcome to ASP.NET"
end sub
</script
<html><body>
test<P>test again
<asp:Label id="lblMessage" runat="server" />
</body></html
which means the script is not recognized. Only the "test<P>test again" is
shown with the paragraph in between.
Thank you very much, I registered again and it works now.
> I made the correction, but no change

Is ASP.NET definitely installed correctly?
Try running
aspnet_regiis -u
then
aspnet_regiis -i

to re-register it with IIS.

Then, confirm that an ASP.NET tab is displayed in your IIS application
property pages

0 comments:

Post a Comment