|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Lost with User ControlsI'm a newbie to ASP.NET. I'm having difficulty create user controls in Visual Studio.NET. I have tried to use the User Control template provided by Visual Studio.NET but the intellisense won't let me use basic UI controls. So far to create User Controls, I have been creating web forms and saving them as .ascx files. I'd like to be able to User Control template provided by Visual Studio to accomplish the task. I don't know how to integrate the user controls into Web Forms in Visual Studio. All the exaples I have seen online don't have any includes, but Visual Studio automatically creates the following code. Public Class XXXX Inherits System.Web.UI.Page and when I try to set up the page to include the user control, intellisense doesn't include any controls, including the script tag I don't know where to put the text which registers the the User Control (i.e.) <% Register TagPrefix="usercontrol1" TagName="LoginForm" src="LoginForm.ascx" %> I"m really lost and frustrated here. I'd really appreciate if someone could tell me the syntax of how to integrate a user control in a web form. Thanks, Larry Sincerely, Larry I want to use Visual Studio 3.0 to accomplish this task, but the user control template doesn't allow for basic UI controls Larry,
Add this in aspx file , <%@ Register TagPrefix="usercontrol1" TagName="LoginForm" > src="LoginForm.ascx" %> at the top of the file..Above the page directive. Your user control will work fine..Show quoteHide quote "larry" wrote: > Hi, > > I'm a newbie to ASP.NET. > I'm having difficulty create user controls in Visual Studio.NET. I > have tried to use the User Control template provided by Visual > Studio.NET but the intellisense won't let me use basic UI controls. > > So far to create User Controls, I have been creating web forms and > saving them as .ascx files. I'd like to be able to User Control > template provided by Visual Studio to accomplish the task. > > I don't know how to integrate the user controls into Web Forms in > Visual Studio. > All the exaples I have seen online don't have any includes, but Visual > Studio > automatically creates the following code. > > Public Class XXXX > Inherits System.Web.UI.Page > > and when I try to set up the page to include the user control, > intellisense doesn't include any controls, including the script tag > > I don't know where to put the text which registers the the User Control > (i.e.) > <% Register TagPrefix="usercontrol1" TagName="LoginForm" > src="LoginForm.ascx" %> > > I"m really lost and frustrated here. I'd really appreciate if someone > could tell me the syntax of how to integrate a user control in a web > form. > > Thanks, > Larry > > > Sincerely, > Larry > I want to use Visual Studio 3.0 to accomplish this task, but the user > control template doesn't allow for basic UI controls > >
Checkbox and Javascript
VS2005 DataList with Nested GridView using ObjectDataSource Validators in composite control firing prematurely BoundField and DataFormatString in ASP.NET 2.0 - Bug ? issues using webbrowser in a service GridView whole row select Custom control that ingerits from textbox Problem with Custom Web Controls in Visual Studio 2005 datagrid pixel height not respected Losing Session Values |
|||||||||||||||||||||||