Jump to content

ASP.NET Server Control Not Render


winwei

Recommended Posts

Hi,I'm new to ASP.NET, refer the tutorial at http://www.w3schools.com/aspnet/aspnet_controls.asp. And having problem in very beginning stage. Well, when I try to run the example given, I found that my control didn't work. I.e: 1.) Under ASP.NET - HTML Server Controls, when cut and paste the sample, the link not work 2.)ASP.NET - Web Server Controls and ASP.NET - Validation Server Controls, not button display.3.) I'm using Win XP (SP 2) with IIS installed, and managed to get this result -> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322) from theRequest.ServerVariables("HTTP_USER_AGENT") to see if the framework is available.4.) From the tutorial under .NET Intall, as I understand that the .NET framework is available by default once we installed the IIS, right?Pls advise....................

Link to comment
Share on other sites

What code are you trying to execute currently? Post what you have.
1.)
Below is the code:<html><body><form runat="server"><p>Enter a number from 1 to 100:<asp:TextBox id="tbox1" runat="server" /><br /><br /><asp:Button Text="Submit" runat="server" /></p><p><asp:RangeValidatorControlToValidate="tbox1"MinimumValue="1"MaximumValue="100"Type="Integer"Text="The value must be from 1 to 100!"runat="server" /></p></form></body></html>
2.) I'm here would like to know is the .NET framework is available by default once we installed the IIS? or it must only available once we run window update or download it and install it manually?3.) Should we need any registration to IIS?Pls advise..
Link to comment
Share on other sites

2. .Net 1.1 comes preinstalled on Windows Server 2003, anything older requires manual installation. Vista comes installed with 3.0 and I thinnk Server 2008 will have 3.5 beta.3. the installer should take care of configuring IIS although you may need to go into IIS to turn .Net on.

Link to comment
Share on other sites

1. I'm not sure how your system is set up, but it may be that you are missing references to a couple of key namespaces. In Visual Studio, you can check your references to see if you have the System.Web.dll referenced in your project.Then, in the page - typically the code-behind, but it could be on the page itself - you may have to add references to the page in order to get those controls to work. The three controls you are using, besides the form, are:System.Web.UI.WebControls.TextBoxSystem.Web.UI.WebControls.ButtonSystem.Web.UI.WebControls.RangeValidatorSo, you might try explicitly declaring that referene to System.Web.UI.WebControls in your page:

<%@ Import namespace="System.Web.UI.WebControls" %><html><body><form runat="server"><p>Enter a number from 1 to 100:<asp:TextBox id="tbox1" runat="server" /><br /><br /><asp:Button Text="Submit" runat="server" /></p><p><asp:RangeValidatorControlToValidate="tbox1"MinimumValue="1"MaximumValue="100"Type="Integer"Text="The value must be from 1 to 100!"runat="server" /></p></form></body></html>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...