Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 14th, 2006, 04:41 PM
Banned
 
Join Date: Mar 2005
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with user controls

Hi,
   Following code is generating error "Unrecognized Namespace "UIDUControl"" Can someone please show me what I am doing wrong? I am new to ASP.NET.
   The .ascx files are in the bin/App_code folder of my website.
Thanks!

Here's the code:

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.Caching



<% @Register TagPrefix="UIDUControl" TagName="Header" Src="ScanningAppHeader.ascx" %>
<% @Register TagPrefix="UIDUControl" TagName="Footer" Src="ScanningAppFooter.ascx" %>
<% @Register TagPrefix="UIDUControl" TagName="SAFunctions" Src="ScanningAppFunctions.ascx" %>

<% @Page Inherits="SAFunctions.SAFunct" Src="SAFunct.vb" %>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us"/>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0"/>
<meta name="ProgId" content="FrontPage.Editor.Document"/>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>

<title>Delete Units and All Associated Records</title>
<link rel="stylesheet" type="text/css" />

</head>
<body>
</body>
<script type="text/jscript" language="jscript">
function additional_delete(myform) {
    myform.action = "delete_unit_no.asp"
    myform.submit();
}


</script>

<UIDUControl:SAFunctions id="SAFunctions1" runat="server" >


<body>
<form name="myForm" method="POST" action="delete_unit_no.aspx">
<table width="100%">
    <tr>
        <td colspan="2" align="center">
        <UIDUControl:Header id="Header1" runat="server" />
        </td>
    </tr>
    <tr>
        <td width="10%" height="100%" bgcolor="#003399" valign="top">
                   <td width="90%" align="center">
               <table>
                    <tr align="center">
                        <td align="center">
                            <%

                                If(Len(Err.Description) > 0) Then
                                    Response.Write ("<p>Error. Please Check Input and Try Again.</p>")
                                    Response.Write ("<p>" & Err.Description & "</p>")
                                    Response.Write ("<p><input type=""Button"" onclick=""javascript:history.go(-1);"" value=""Go Back""></p>")
                                Else
                                    Response.Write ("<p><b>Record deleted from database!</b></p>")
                                    Response.Write ("<input type=""submit"" value=""Delete Another"" name=""B1"" tabindex=""3"">")
                                End If
                            %>
                            </td>
                    </tr>

                </table>
       </td>
    </tr>
</table>



<table>
  <tr>
        <td colspan="2" align="center" >
        <UIDUControl:Footer id="Footer1" runat="server" />
        </td>
    </tr>
</table>
 </form>
</body>
</html>


Reply With Quote
  #2 (permalink)  
Old November 15th, 2006, 11:37 AM
Banned
 
Join Date: Mar 2005
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Can anyone please help me on this? I have read every User Control posing in this site. I really cannot find the problem here. I've been looking at this for 3 days and am so very frustrated...besides being so very behind on my project now.


Reply With Quote
  #3 (permalink)  
Old November 15th, 2006, 11:46 AM
Authorized User
 
Join Date: Nov 2006
Location: Bristol, TN, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to davidrodrigues40
Default

Can you post the code for the whole page? From top to bottom including the <%@ Page %> tag.

David Rodrigues
"There is no box"
Reply With Quote
  #4 (permalink)  
Old November 15th, 2006, 01:06 PM
Banned
 
Join Date: Mar 2005
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sure! And thanks for your assistance on this. Please note: the .ascx files reside on my D drive. in other pages, I've tried the full path in the register command but that doesn't work either.

Here's the page code:

Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.Caching



<% @Register TagPrefix="UIDUControl" TagName="Header" Src="ScanningAppHeader.ascx" %>
<% @Register TagPrefix="UIDUControl" TagName="Footer" Src="ScanningAppFooter.ascx" %>
<% @Register TagPrefix="UIDUControl" TagName="SAFunctions" Src="ScanningAppFunctions.ascx" %>

<% @Page Inherits="SAFunctions.SAFunct" Src="SAFunct.vb" %>

<%
'Declare all variables

Dim strUsername, strPassword, strInstance
Dim strUIDNo, strSerNo, strPartNo1, strUIDType, strUIDTypeKey
Dim strPartNo, strKeyLen, startSN, strKey, strVKey
Dim oConn, oRst, mySQL, oRstNHA, boolDisplayOnly
Dim strUIDNo1
Dim ErrorEOF, ErrorEOF2
Dim ErrorDBText, ErrorDB

Const strSysName = "ScanApp%"

'If there is an error continue on the next line - comment next line for debugging
'On Error Resume Next

'Get the passed form variables and set other variables
strUsername = Request.Form("Username")
strPassword = Request.Form("Password")
strInstance = "c4sdev"
strKey = Request.Form("UnitKey")
strUIDType = Request.Form("UIDType")
strUIDNo = Request.Form("strUIDNo")

%>

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Language" content="en-us"/>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0"/>
<meta name="ProgId" content="FrontPage.Editor.Document"/>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>

<title>Delete All Associated Records</title>
<link rel="stylesheet" type="text/css" />

</head>
<body>
</body>
<script type="text/jscript" language="jscript">
function additional_delete(myform) {
    myform.action = "delete_unit_no.asp"
    myform.submit();
}


</script>

<UIDUControl:SAFunctions id="SAFunctions1" runat="server" ></UIDUControl:SAFunctions>



<%


If UCase(strUIDType) = "SCANAPP" Then
   getMatrixType (strKey, strUIDType, strUIDNo, strSerNo, strUIDTypeKey)
End if

DeleteUIDTree (strUIDNo)

%>
<form name="myForm" method="POST" action="delete_unit_no.aspx">
<table width="100%">
    <tr>
        <td colspan="2" align="center">
        <UIDUControl:Header id="Header1" runat="server"></UIDUControl:Header>
        </td>
    </tr>
    <tr>
        <td width="10%" height="100%" bgcolor="#003399" valign="top">

        </td>
        <td width="90%" align="center">
               <table>
                    <tr align="center">
                        <td align="center">
                            <%

                                If(Len(Err.Description) > 0) Then
                                    Response.Write ("<p>Error. Please Check Input and Try Again.</p>")
                                    Response.Write ("<p>" & Err.Description & "</p>")
                                    Response.Write ("<p><input type=""Button"" onclick=""javascript:history.go(-1);"" value=""Go Back""></p>")
                                Else
                                    Response.Write ("<p><b>Record deleted from database!</b></p>")
                                    Response.Write ("<input type=""submit"" value=""Delete Another"" name=""B1"" tabindex=""3"">")
                                End If
                            %>
                            </td>
                    </tr>

                </table>
       </td>
    </tr>
</table>
                <input type="hidden" value="<%=strUsername%>" name="Username"/>
                <input type="hidden" value="<%=strPassword%>" name="Password"/>
                <input type="hidden" value="<%=strKey%>" name="UnitKey"/>
                <input type="hidden" value="<%=strUIDType%>" name="UIDType"/>


<table>
  <tr>
        <td colspan="2" align="center" >
        <UIDUControl:Footer id="Footer1" runat="server" ></UIDUControl:Footer>
        </td>
    </tr>
</table>
 </form>

</html>

Reply With Quote
  #5 (permalink)  
Old November 15th, 2006, 01:07 PM
Banned
 
Join Date: Mar 2005
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I should add that the software and all other .aspx files are also on my D drive. I have no idea if that makes a difference...

Reply With Quote
  #6 (permalink)  
Old November 15th, 2006, 04:29 PM
Authorized User
 
Join Date: Nov 2006
Location: Bristol, TN, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to davidrodrigues40
Default

One thing I noticed is the UIDUControl:Header and footer. I am unaware of the included file and will probably need to see that code as well. One thing you could do is place the control inside a WebPartZone to achieve the same results.

David Rodrigues
"There is no box"
Reply With Quote
  #7 (permalink)  
Old November 15th, 2006, 04:39 PM
Authorized User
 
Join Date: Nov 2006
Location: Bristol, TN, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to davidrodrigues40
Default

Try reformating the register tag from <% @Register to <%@ Register

David Rodrigues
"There is no box"
Reply With Quote
  #8 (permalink)  
Old November 17th, 2006, 04:34 PM
Banned
 
Join Date: Mar 2005
Location: , , .
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have found the issue with the User Controls. It was because I had the software and files on my D drive. Once I reinstalled on the C drive, it worked fine except for .jsp and .html files (new post).

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch.14 Creating Windows Form User Controls problem SAIFI BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 1 September 29th, 2008 05:51 AM
User controls dcct84 C# 2 October 28th, 2007 07:20 PM
User controls' content: Chapter 2 User Controls AGS BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 10 July 26th, 2007 05:36 AM
problem in user controls nishantmp1 ASP.NET 1.0 and 1.1 Basics 1 September 27th, 2006 09:43 AM
User Controls Duncan Pro VB.NET 2002/2003 1 October 27th, 2003 11:51 AM



All times are GMT -4. The time now is 03:44 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.