newbie problem with ASP.NET

  • Thread starter Thread starter Gary Coutts
  • Start date Start date
G

Gary Coutts

Hi,

I have just started developing web application using ASP.Net and I am have a
problem.

I have generated a web form (using .NET 2003) with various buttons, labels,
drop-downs etc ( just to see what they would look like on screen) but when I
run it in Explorer the various controls are not where the are in the design
form.

Explorer has all the current updates and everything is running under Windows
2K.

Has anyone come across this problem or know what I am doing wrong?


Best Regards

Gary Coutts
 
Gary,

Verify that each of those server controls has the attribute "runat" set to
"server", like this:
<asp:Button id="okButton" runat="server" text="OK"></asp:Button>
 
Hi Dennis,

Each of the controls has the attribute "runat" set to "server". I have not
modified the web form in any way, it has been completely genrated by .NET.


Best Regards

Gary Coutts
 
Hmm that is strange..
Although i am sure i recognize this kind of problem, i cannot remember.

Also verify the controls is in a form tag that has runat="server",
and your application is run from a web folder.

It is interesting to see the HTML generated.
You can create an empty web form, put a single asp:button into it, take
View->Source or similar in your browser window and copy it into a new post.

Otherwise.. Jon, any ideas?
 
Hi Dennis,

Find enclosed the generated HTML from a web form with a single button.

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false"
Inherits="button.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>WebForm1</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="Form1" method="post" runat="server">
<asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 624px; POSITION:
absolute; TOP: 288px" runat="server"
Text="Button"></asp:Button>
</form>
</body>
</HTML>


Best Regards

Gary Coutts
 
Hi Cor,

Yes, the page layout atrribute is set to "Grid Layout"

Best Regards

Gary
 
Gary,

because the asp:button is still there in the generated HTML, this indicates
that the tag is not
processed at all(if it had been processed, there would be an <input> element
instead of the asp:button element by now).
As i mentioned, i recognize this type of error from some place, i will look
into that.
But otherwise i cannot help you, because i do not know how, i would hope
someone else might had a clue.
 
Back
Top