Home All Groups Group Topic Archive Search About
Author
30 Nov 2005 9:41 PM
larry
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

Author
1 Dec 2005 5:31 PM
Santhi Maadhaven
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
>
>