p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Professional ASP.NET 4 : in C# and VB (http://p2p.wrox.com/book-professional-asp-net-4-c-vb-554/)
-   -   regarding user controls (http://p2p.wrox.com/book-professional-asp-net-4-c-vb/88324-regarding-user-controls.html)

Jaskaranmehta August 27th, 2012 06:12 AM

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

Imar August 27th, 2012 07:27 AM

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

Jaskaranmehta August 27th, 2012 07:33 AM

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

Imar August 27th, 2012 07:41 AM

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

Jaskaranmehta August 27th, 2012 07:49 AM

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.................. .................................................. ...................

Imar August 27th, 2012 08:09 AM

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

Jaskaranmehta August 27th, 2012 08:13 AM

regarding user controls
 
Sir
Thank you sir....the browser gives the error Unknown server tag 'Wrox:banner'.
jaskaran

Imar August 27th, 2012 08:19 AM

Quote:

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

Imar

Jaskaranmehta August 27th, 2012 08:21 AM

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

Imar August 27th, 2012 08:24 AM

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


All times are GMT -4. The time now is 10:06 AM.

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