Category Archives: WebPartZone

WebPartZone

Generation of designer file failed: Unknown server tag 'asp:WebPartManager'

Hi,

I recently rebuilt an application using the new Web Application Project in Visual Studio (rather than the previous Web Site Project).  I am using the January Futures CTP of Ajax and Webparts, (not to do anything with Ajax yet, just to fix drag and drop across
browsers).

A Web Application Project creates .designer.cs files for all of your aspx pages.  I am getting a warning on pages that contain an asp:WebPartManager or asp:WebPartZone control:

Warning   Generation of designer file failed: Unknown server tag 'asp:WebPartManager'.

 

 

Now if I try to add other controls to that page, Visual Studio can’t update the .designer.cs file for that page and I end up with errors.

I have seen many posts about correctly remapping web.config to use the Microsoft.Web.Preview assembly, and that does not seem to be my problem.  I have that set up as recommended and my code executes fine until I try to add new controls to my page.  I have
moved the Microsoft.Web.Preview.dll to my bin and added a reference.

Any idea why Visual Studio is having this issue?

 

Thanks,

Graham

Do you also have a reference to system.web.extensions.dll? I beleive the preview assembly has a dependency on this dll.

Hi,

I have similar problem with WAP project with custom control. Controls other than AJAX enabled work fine. However, the accordion control of the AJAX control toolkit gives me:

 Error 1 Element ‘Accordion’ is not a known element. This can occur if there is a compilation error in the Web site. 
Warning 2 Generation of designer file failed: Unknown server tag ‘ajaxToolkit:Accordion’. 

 My customer control does not have a web.config. That is in the root and my custom control is a subproject.

 I have the ajaxcontroltoolkit in the bin and the system.web.extensions.dll in the reference.

Jelle

Answer to the problem of Ajax is next:

I did not install the items in the toolbox so the designer IDE did not find them. Read the instructions on the ajax control toolkit website how to add the controls to the designer. This did the trick for me :-(.

Jelle

What instructions are you referring to?  Can you provide a link?  I looked through the site, and couldn’t find anything in the installation instructions that said you explicitly needed to add the controls to the designer.

I am still getting the errors:

Generation of designer file failed: Unknown server tag ‘asp:ScriptManager’

and

Generation of designer file failed: Unknown server tag ‘asp:WebPartManager’

 

 on any page that contains those controls.  I have Ajax 1.0 and January Futures CTP installed, and my web.config looks exactly like the one that came with the CTP, and my site is using Web Application Project.  I have exhausted every suggestion from other
forum posts such as Reseting the Toolbox, opening all your masterpages at the same time, making sure I have proper references to System.Web.Extensions.dll and Microsoft.Web.Preview.dll, etc.  Nothing gets rid of the error.

If I manually keep the designer.cs file up to date, then the appliction works fine.  That makes me think there is not a problem with my references, just something wrong with VS.

 

In addition to what is mentioned above, I had to remove this line of code: 
<cc1:ToolkitScriptManager
ID="tsmScriptManager"
runat="server"></cc1:ToolkitScriptManager>

Then click and drag the ToolkitScriptManager from the toolbox back onto my page for it to work correctly.

VS is a bit buggy with ajax control toolkit.

Mine works now though. Good luck.

JustinCM83

In addition to what is mentioned above, I had to remove this line of code: 
<cc1:ToolkitScriptManager
ID="tsmScriptManager"
runat="server"></cc1:ToolkitScriptManager>

Then click and drag the ToolkitScriptManager from the toolbox back onto my page for it to work correctly.

 

Thanks, this fixed it for me!! after an hour of searching

 

 

 

[RESOLVED]ModalPopupExtender disables asp controls in in other webparts

Hi,

I am having problems getting a ModalPopupExtender ajax control to work on a page.

I have a single page containing 4 or 5 web parts displaying data from a sql database.  I want to add a ModalPopupExtender that will open a popup for me to enter data into the same database.  I have got the popup opening, validating imput and saving the record
on close, but when the extenders code is on the page it disables the <asp:LinkButton> on the other web parts.  These link buttons open datalist EditItmTemplate> that are on the other web parts.

If I remove any reference to the ModalPopupExtender, the link buttons work.

A stripped down version of the code is below:

The ASPX code (recruits.aspx):

<form id="frmRecruits" runat="server">
       
       <ajaxtoolkit:toolkitscriptmanager ID="AjaxToolkitScriptManager" runat="server"/>

        <asp:WebPartManager ID="wpmRecruits" runat="server" OnAuthorizeWebPart="wpmRecruits_AuthorizeWebPart">
            <StaticConnections>
                <asp:WebPartConnection ID="wpConnRecruitDetails"
                    ConsumerID = "idRecruitDetails"
                    ProviderID="idRecruitAdminTools"
                    ConsumerConnectionPointID="SelectedRecruit"
                    ProviderConnectionPointID="SelectedRecruit" />

                           
            </StaticConnections>
 
        </asp:WebPartManager>
                
        <div id="leftNav">
            
        <asp:LinkButton ID="linkAddNewRecruit" runat="server" Text="new recruit"  />
         
<asp:webpartzone id="wpzLeftSideBar_01" runat="server">
                <ZoneTemplate>
                    <ucRecruitAdminTools:RecruitAdminTools ID="idRecruitAdminTools" runat="server" title="Recruit"/>
                                          
                </ZoneTemplate>
            </asp:webpartzone>

        </div>
        
        <div id="content">
            <div id="centreContent">
                <asp:WebPartZone ID="wpzCentre" runat="server">
                    <ZoneTemplate>
                        <ucRecruitDetails:RecruitDetails ID="idRecruitDetails" runat="server" title="Contact Details"  />
                        
                    </ZoneTemplate>
                </asp:WebPartZone>
            </div>
        </div>

        <asp:Panel ID="panelAddNewRecruit" runat="server"  CssClass="modalPopup">
            <div style="border: 1px solid #000000">

               <table style="background-color: #e3e2fe;">
                    <tr>
                        <td>Interview Date</td>
                        <td>
                            <asp:TextBox ID="txtInterviewDate" runat="server"/>
                            <ajaxToolkit:CalendarExtender ID="calInterviewDate" runat="server" TargetControlID="txtInterviewDate" />
                        </td>
                        <td>Unit</td>
                        <td>
                            <asp:DropDownList ID="ddlUnitID" runat="server">
                                <asp:ListItem Text="-Select Unit-" Value= ""></asp:ListItem>
                                <asp:ListItem Value="2643" Text="PE" />
                                <asp:ListItem Value="2641" Text="FA" />
                                
                            </asp:DropDownList>
                        </td>
                    </tr>
                      
                    <tr>
                        <td>FirstName</td>
                        <td>
                            <asp:TextBox ID="txtFirstName" runat="server"/>
                            <asp:RequiredFieldValidator ID="vldTxtFirstName" runat="server" ErrorMessage="* Required" ControlToValidate="txtFirstName" />
                        </td>
                        
                        <td>MiddleInitial</td><td><asp:TextBox ID="txtMiddleInitial" runat="server"/></td>
                        <td>LastName</td>
                        <td>
                            <asp:TextBox ID="txtLastName" runat="server"/>
                            <asp:RequiredFieldValidator ID="vldTxtLastName" runat="server" ErrorMessage="* Required" ControlToValidate="txtLastName" />
                        </td>
                    </tr>
                    <tr>
                        <td>Address</td>
                        <td><asp:TextBox ID="txtHomeAddress" runat="server"/></td>
                    </tr>
                    <tr>
                        <td>City</td><td><asp:TextBox ID="txtHomeCity" runat="server"/></td>
                        <td>State</td><td><asp:TextBox ID="txtHomeState" runat="server"/></td>
                    </tr>
                    <tr>
                        <td>ZipCode</td><td><asp:TextBox ID="txtHomeZipcode" runat="server" />-<asp:TextBox ID="txtHomeExtZipcode" runat="server"/>
                        </td>
                    </tr>
                   
                    <tr>
                        <td >
                            <asp:LinkButton ID="linkInsert" runat="server">Insert</asp:LinkButton>
                            <asp:LinkButton ID="linkCancel" runat="server">Close</asp:LinkButton>
                            
                        </td>
                    </tr>
                </table>
              
            </div>
        </asp:Panel>
  
        <ajaxToolkit:ModalPopupExtender ID="mpeAddNewRecruit" runat="server" 
                TargetControlID="linkAddNewRecruit"
                PopupControlID="panelAddNewRecruit" 
                BackgroundCssClass="modalBackground" 
                DropShadow="true" 
                CancelControlID="linkCancel" >
        </ajaxToolkit:ModalPopupExtender>
       
       </form>

ASCX code for one of the web parts (wpRecruitsDetails):

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="wpRecuitsDetails.ascx.vb" Inherits="PayPer_WebParts.wpRecuitsDetails" %>
<asp:DataList id="dataRecruitDetails" runat="server" DataKeyField="PersonID" 
        DataSourceID="dsRecruitInfoByID" 
        OnEditCommand="dataRecruitDetails_EditCommand" 
        OnCancelCommand="dataRecruitDetails_CancelCommand" 
        OnUpdateCommand="dataRecruitDetails_UpdateCommand">

    <ItemTemplate>
               
       <%-- <asp:LinkButton ID="linkEdit" runat="server" CommandName="edit">edit</asp:LinkButton>--%>
 <asp:Button ID="linkEdit" runat="server" Text="Edit" CommandName="edit" />
         <br /> <br />
       
        <asp:Label ID="lblFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
        <asp:Label ID="lblMiddleInital" runat="server" Text='<%# Eval("MiddleInitial") %>' />
        <asp:Label ID="lblLastName" runat="server" Text='<%# Eval("LastName") %>' />
        <br /><br />
        <strong>Date Hired</strong>
        <asp:Label ID="lblDateHired" runat="server" Text='<%# Eval("DateHired","{0:MMM-dd-yyyy}") %>' />
        <strong>Interview Date</strong>
        <asp:Label ID="lblInterviewDate" runat="server" Text='<%# Eval("InterviewDate","{0:MMM-dd-yyyy}") %>'/>
        <br /><br />
        
        <strong>Address</strong>
        <br />
        <asp:Label ID="lblHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' />
        <br />
        <asp:Label ID="lblHomeCity" runat="server" Text='<%# Eval("HomeCity") %>' />
        <asp:Label ID="lblHomeState" runat="server" Text='<%# Eval("HomeState") %>' />
        <asp:Label ID="lblHomeZipcode" runat="server" Text='<%# Eval("HomeZipcode") %>' />
        <asp:Label ID="lblHomeExtZipcode" runat="server" Text='<%# Eval("HomeExtZipcode") %>' />
        <br />

    </ItemTemplate>

    <EditItemTemplate>
        
        <asp:LinkButton ID="linkUpdate" runat="server" CommandName="update">update</asp:LinkButton>
             &nbsp;
        <asp:LinkButton ID="linkCancel" runat="server" CommandName="cancel">cancel</asp:LinkButton>
            <br />
        <asp:TextBox ID="txtFirstName" runat="server" Text='<%# Eval("FirstName") %>' />
        <asp:TextBox ID="txtMiddleInitial" runat="server" Text='<%# Eval("MiddleInitial") %>' />
        <asp:TextBox ID="txtLastName" runat="server" Text='<%# Eval("LastName") %>' />
        <br /><br />
        <strong>Date Hired</strong>
        <asp:TextBox ID="txtDateHired" runat="server" Text='<%# Eval("DateHired","{0:MMM-dd-yyyy}") %>' />
        <ajaxToolkit:CalendarExtender ID="calDateHired" runat="server" TargetControlID="txtDateHired" />

        <strong>Interview Date</strong>
        <asp:TextBox ID="txtInterviewDate" runat="server" Text='<%# Eval("InterviewDate","{0:MMM-dd-yyyy}") %>' />
        <ajaxToolkit:CalendarExtender ID="calInterviewDate" runat="server" TargetControlID="txtInterviewDate" />
        <br /><br />
        
        <strong>Address</strong>
        <br />
        <asp:TextBox ID="txtHomeAddress" runat="server" Text='<%# Eval("HomeAddress") %>' />
        <br />
        <asp:TextBox ID="txtHomeCity" runat="server" Text='<%# Eval("HomeCity") %>' />
        <asp:TextBox ID="txtHomeState" runat="server" Text='<%# Eval("HomeState") %>' />
        <asp:TextBox ID="txtHomeZipcode" runat="server" Text='<%# Eval("HomeZipcode") %>' />
        <asp:TextBox ID="txtHomeExtZipcode" runat="server" Text='<%# Eval("HomeExtZipcode") %>' />
        <br />
     
    </EditItemTemplate>

</asp:DataList>

I also tried putting the popcontrol into its own ASCX web part and it would cause the same problem (and if I removed it from the <ZoneTemplate> the EditItemTemplates would work again).

Any suggestions?  I can post more code if need be

thanks

Ian

Hi,

Have you debug your code and see what make the issue?

Best wishes,

[RESOLVED]Web Parts Drag and Drop

Hello everyone.

If we can drag and drop controls in WebPartZone in Browse mode?

Yes, you can . please have view this video if you want to how to drag and drop with webparts

http://www.microsoft.com/uk/msdn/screencasts/screencast/186/ASPNET-AJAX-Enabling-WebParts-Drag-and-Drop.aspx

If I can do it with ASP.Net web application? not with AJAX?

Hi,

I think the user can drag Web Parts controls to edit the layout of the page in design mode, whereas in browse mode only standard Web browsing functionality is available. And you should contains a
WebPartManager control and One or more zones in your pages.

For detailed information, you can refer here

http://msdn.microsoft.com/en-us/library/ms366533(v=vs.100).aspx

Microsoft ASP.NET Futures release for Visual Studio 2010 (ASP.NET 4.0)

Does anybody know a way of how to install ASP.NET Futures release in VS 2010, ASP.NET 4.0? The original release can only be installed on VS2008 with ASP.NET 3.5.

The reason I need the release is that WebPartZone isn”t compatible with non IE browsers (drag and drop feature not supported). The only work around was to install the Future release back in time when VS 2008 was available. I was expecting in ASP.NET 4.0
to have the cross browser drag and drop feature included, however I was wrong.

Is WebPartZone supported at all in 4.0? MSDN says so but the drag and drop feature still doesn’t work in non-IE browsers.

are you talking about this then read instruction

http://www.microsoft.com/download/en/details.aspx?id=22457

Well that’s the issue: as I said in my initial message, the installation requires ASP.NET 2.0 AJAX Extension 1.0 or Visual Studio 2008 being installed first. I could undertand that the Futures release isn’t backward compatible with VS 2005 but why it wouldn’t
install with the latest Visual Studio 2010 which I have installed? Sounds weird

Did you try the right version for that?

Port WebParts from 4.0 to 4.5, drag-n-drop not working

Hi:

I have a site that was created using 4.0 WebParts (this is NOT SharePoint site).  I have tried to port the site to 4.5, but the drag-n-drop does not work.  I added the following two scripts to the master page (per fiddler they are loaded):

<script src="/Scripts/WebForms/WebForms.js" type="text/javascript"></script>
<script src="/Scripts/WebForms/WebParts.js" type="text/javascript"></script>

I have seen the following, but it does not present a solution:

http://forums.asp.net/t/1981763.aspx?Unable+to+drag+and+drop+Webparts+net+4+5+VS+2012

Phil

[RESOLVED]I am not able to get the drap and drop functionality in IE11

Is drag and drop functionality of Webparts supported in IE 11?

<asp:WebPartManager ID="WebPartManager1" runat="server">
            <StaticConnections>
                <asp:WebPartConnection ID="connection1"
                    ConsumerConnectionPointID="ZipCodeConsumer"
                    ConsumerID="zipConsumer"
                    ProviderConnectionPointID="ZipCodeProvider"
                    ProviderID="zipProvider" />
            </StaticConnections>
        </asp:WebPartManager>
        <div class="div1">
            <asp:WebPartZone ID="WebPartZone1" runat="server" AllowLayoutChange="true">
                <ZoneTemplate>
                    <uc1:UserCtrlForProperty runat="server" ID="UserCtrlForProperty"/>
                    <asp:BulletedList ID="BulletedList1" runat="server" Title="Select Movie/Book">
                        <asp:ListItem Text="Books" Value="B"></asp:ListItem>
                        <asp:ListItem Text="Movies" Value="M"></asp:ListItem>
                    </asp:BulletedList>

                </ZoneTemplate>
            </asp:WebPartZone>
        </div>
        <div class="div2">
            <asp:WebPartZone ID="WebPartZone2" runat="server" AllowLayoutChange="true">
                <ZoneTemplate>
                    <asp:Calendar ID="Calendar1" runat="server" Title="My Static Calendar"></asp:Calendar>
                </ZoneTemplate>
            </asp:WebPartZone>
        </div>

Hi,

For this situation, I have test the webparts in Internet Explorer 11, and it would not be able to support the drag and drop functionality. However, you could refer to the following links for more information:

http://waitink.blogspot.com/2008/06/ajax-web-parts-part-1-drag-and-drop.html

http://www.codeproject.com/Articles/337551/A-Beginners-Tutorial-on-ASP-NET-Web-Parts

Regards