Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Professional ASP.NET 4 in C# and VB by Bill Evjen, Scott Hanselman, Devin Rader; ISBN: 9780470502204
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET 4 : in C# and VB 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
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 27th, 2012, 06:12 AM
Registered User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding user controls

Sir

Getting problem in banner it is giving some parse error when i am writing it in web.config file.i have given the proper link of wrox:banner .....I dont know whats the exact problem
plzzz help...and sir you have written a wonderful book....i m a big fan of your books
Jaskaran
  #2 (permalink)  
Old August 27th, 2012, 07:27 AM
Imar's Avatar
Wrox Author
Points: 71,692, Level: 100
Points: 71,692, Level: 100 Points: 71,692, Level: 100 Points: 71,692, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,019
Thanks: 79
Thanked 1,580 Times in 1,557 Posts
Default

Hi there,

Is this about Beginning ASP.NET or about Professional ASP.NET? In the former case, you find the book's own forum category here: http://p2p.wrox.com/book-beginning-asp-net-4-c-vb-560/

That said, can you post the code and the error message you get? Have you tried closing all documents or restarting VS?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #3 (permalink)  
Old August 27th, 2012, 07:33 AM
Registered User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding user controls

sir,
it is giving a parse error and says that wrox is not suitable control
?xml version="1.0"?>
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix="Wrox" tagName="banner" src="~/Controls/banner.ascx"/>
</controls>
</pages>
<compilation debug="false" targetFramework="4.0" />
</system.web>
</configuration>
this is what i m writing in config file
and i have deleted @directive from main file...everything is as per code you have give
yours sincerely
jaskaran
  #4 (permalink)  
Old August 27th, 2012, 07:41 AM
Imar's Avatar
Wrox Author
Points: 71,692, Level: 100
Points: 71,692, Level: 100 Points: 71,692, Level: 100 Points: 71,692, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,019
Thanks: 79
Thanked 1,580 Times in 1,557 Posts
Default

Can you post the exact error message (right-click it and choose copy), as well as the full code for the page that uses this control?

If you post code, can you please paste it in Notepad first to remove color coding and then use the forum editor's Code toolbar button to wrap your code in code tags. Otherwise, this forum messes up the code.

Quote:
Have you tried closing all documents or restarting VS?
Have you? And did that help?


Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #5 (permalink)  
Old August 27th, 2012, 07:49 AM
Registered User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding user controls

Sir,
Code:
I have tried closing visual studio..but it didnt help.
<?xml version="1.0"?>
<configuration>
    <system.web>
      <pages>
        <controls>
          <add tagPrefix="Wrox" tagName="banner" src="~/Controls/banner.ascx"/>
        </controls>
      </pages>
      <compilation debug="false" targetFramework="4.0" />
    </system.web>
</configuration>
.................web.config file.............................................. ........................................
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="banner.ascx.cs" Inherits="Site_Controls_banner" %>
<asp:Panel ID="VerticalPanel" runat="server">
   <a href="http://www.google.com" target="_blank"> <asp:Image ID="Image1" runat="server" AlternateText="This is a simple banner" 
        ImageUrl="~/Images/36kv_xlpe (5).jpg" /></a>
</asp:Panel>
....................................banner.ascx file.............................................. ...............,,,
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="banner.aspx.cs" Inherits="Site_banner" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>banner</title>
</head>
<body>
    <form id="form1" runat="server">
    <div class="img" >
    
        <Wrox:banner ID="banner1" runat="server"  />
    
    </div>
    </form>
</body>
</html>
.....................banner.aspx.................. .................................................. ...................
  #6 (permalink)  
Old August 27th, 2012, 08:09 AM
Imar's Avatar
Wrox Author
Points: 71,692, Level: 100
Points: 71,692, Level: 100 Points: 71,692, Level: 100 Points: 71,692, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,019
Thanks: 79
Thanked 1,580 Times in 1,557 Posts
Default

Not sure what's going on, but it looks like your site structure is not OK. Take a look at this:

Site_Controls_banner

See the Site_ prefix? That seems to suggest you openend C:\BegASPNET as the site, instead of C\BegASPNET\Site. This in turn could lead to issues like this, where ~/Controls is not where you think it is.

Can you post an image of your Solution Explorer online somewhere?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #7 (permalink)  
Old August 27th, 2012, 08:13 AM
Registered User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding user controls

Sir
Thank you sir....the browser gives the error Unknown server tag 'Wrox:banner'.
jaskaran
  #8 (permalink)  
Old August 27th, 2012, 08:19 AM
Imar's Avatar
Wrox Author
Points: 71,692, Level: 100
Points: 71,692, Level: 100 Points: 71,692, Level: 100 Points: 71,692, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,019
Thanks: 79
Thanked 1,580 Times in 1,557 Posts
Default

Quote:
Thank you sir....the browser gives the error Unknown server tag 'Wrox:banner'.
Sure. But did you see my last reply?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
  #9 (permalink)  
Old August 27th, 2012, 08:21 AM
Registered User
Points: 40, Level: 1
Points: 40, Level: 1 Points: 40, Level: 1 Points: 40, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default regarding user controls

sir
yes i saw your last reply......i am working with this.can you give me the details of book you have written sir
???
yours sincerely
jaskaran
  #10 (permalink)  
Old August 27th, 2012, 08:24 AM
Imar's Avatar
Wrox Author
Points: 71,692, Level: 100
Points: 71,692, Level: 100 Points: 71,692, Level: 100 Points: 71,692, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,019
Thanks: 79
Thanked 1,580 Times in 1,557 Posts
Default

Quote:
can you give me the details of book you have written sir
I don't understand what you mean with this. You have the book, don't you?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 


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
User Controls JBMarland BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 March 24th, 2012 04:36 AM
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
User Controls Duncan Pro VB.NET 2002/2003 2 December 1st, 2003 04:41 AM
User Controls Duncan Pro VB.NET 2002/2003 1 October 27th, 2003 11:51 AM
User Controls raZZa VS.NET 2002/2003 3 July 30th, 2003 07:36 AM



All times are GMT -4. The time now is 06:02 PM.


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