Category Archives: PageCatalogPart

[RESOLVED] how to change orientation of webparts from vertical to horizontal in catelog zone

dear experts,

by default  closed webparts are listed in catelog zone vertically

for example,

[checkbox]  [webpart 1]

[checkbox]  [webpart 2]

[checkbox]  [webpart 3]

any one guide me which property is used to list them horizontally?

i want them like

[checkbox]  [webpart 1]   [checkbox]  [webpart 2]    [checkbox]  [webpart 3]

any help would be appreciated.


You can use


<asp:CatalogZone ID="CatalogZone1" runat="server" BackColor="#F7F6F3" BorderColor="#CCCCCC"
                    BorderWidth="1px" Font-Names="Verdana" Padding="6" LayoutOrientation="Horizontal" >
                    <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />

                     <asp:DeclarativeCatalogPart ID="DeclarativeCatalogPart1" runat="server"  Title="Web Parts"  LayoutOrientation="Horizontal">


                    <PartLinkStyle Font-Size="0.8em" />
                    <PartTitleStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.8em" ForeColor="White" />
                    <EditUIStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
                    <PartStyle BorderColor="#F7F6F3" BorderWidth="5px" />
                    <HeaderVerbStyle Font-Bold="False" Font-Size="0.8em" Font-Underline="False" ForeColor="#333333" />
                    <PartChromeStyle BorderColor="#E2DED6" BorderStyle="Solid" BorderWidth="1px" />
                    <EmptyZoneTextStyle Font-Size="0.8em" ForeColor="#333333" />
                    <SelectedPartLinkStyle Font-Size="0.8em" />
                    <VerbStyle Font-Names="Verdana" Font-Size="0.8em" ForeColor="#333333" />
                    <LabelStyle Font-Size="0.8em" ForeColor="#333333" />
                    <FooterStyle BackColor="#E2DED6" HorizontalAlign="Right" />
                    <HeaderStyle BackColor="#E2DED6" Font-Bold="True" Font-Size="0.8em" ForeColor="#333333" />
                    <InstructionTextStyle Font-Size="0.8em" ForeColor="#333333" />


You can try to set the PartStyle:



Hope this can help you.

[RESOLVED] WebParts – how to open WebPartZone



I am not very familiar with web parts.

When I click link “Close” on WebPartZone all this control disappear. How can open again WebPartZone that has been closed before?



I'm assuming you were refering to the WebPart that is being closed from the WebPartZone. If so then basically all closed WebParts are stored in the WebParts PageCatalogPart.. If you wanted to open/add the Webparts that you have closed in the WebZone then you need to use the PageCatalog control.

But can I have just button with click event handler and code in this handler that will open previously closed webpartzone?

You can loop through the WebPartManager WebParts collection and then determine the previous closed WebParts and then use the AddWebPart method of WebPartManager to add WebParts to the WebPartZone:

[RESOLVED] A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote conn

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

we get this error when we try to use web parts in 

plz explain these error.......

thanx in adv...

Check Connection String...!!!

I think this may help u

It looks like you are tyring to connect to an instance of SQL Server and there is an error connecting to it. There may be many reasons for this to not work such as the instance name is wrong, sql server is not running, sql server is on another machine and it doesn't accept remote connections.

Please show us the code so we can help you better.

we r not using sql connectivity in web parts..

we are using web part

here is my sorce code::-

<html xmlns="">
<head runat="server">
<form id="form1" runat="server">
<asp:WebPartManager ID="WebPartManager1" runat="server">
<asp:WebPartZone ID="WebPartZone1" runat="server" HeaderText="Welcome to hell">
<asp:Label ID="Label1" runat="server" Text="Welcome to hell"></asp:Label>
<asp:WebPartZone ID="WebPartZone2" runat="server" HeaderText="Calendar1">
<asp:TextBox ID="TextBox1" Text="rohit" runat="server"></asp:TextBox>
<asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
<asp:Calendar ID="Calendar1" runat="server"></asp:Calendar>
<asp:CatalogZone ID="ct1" runat="server">
<asp:PageCatalogPart ID="cp1" runat="server" />
<asp:WebPartZone ID="WebPartZone3" runat="server" HeaderText="paresh">
<asp:Label ID="Label2" runat="server" Text="paresh"></asp:Label>
<div style="top: 15px; left: 10px; position: absolute; height: 33px; width: 830px">
<asp:WebPartManager ID="WebPartManger1" runat="server">

<asp:CreateUserWizard ID="CreateUserWizard1" runat="server" Email="">
<asp:CreateUserWizardStep runat="server" />
<asp:CompleteWizardStep runat="server" />

plz help 

tx in adv.


we r not using sql connectivity in web parts..

It is not related to webparts i guess..

Check the sql configuration Settings in your web.config file..

[RESOLVED] WebParts naming in a CatalogZone

Does anyone know how to set the default name of a WebPart.

When I load all of my WebParts into a CatalogZone, they all get displayed as "Untitled". Not easy to chose the right one!

I've tried creating a property called "Title" for the usercontrol then setting this in the WebPartsTemplate. No good.




Just a quick note: If you are working with WebParts you may also want to read: ASP.NET WebPart FAQ

Thanks for the reply.

I have tried this already (I did say! ;) ) but this does not change the displayed "Untitled" in a CatalogZone in Catalog mode.

Nice blog post, but several of the links in it are dead.

FYI, I'm using VS2012 and the 4.0/4.5 frameworks.


This works for me:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <asp:WebPartManager ID="WebPartManager1" runat="server">
    <asp:CatalogZone ID="CatalogZone1" runat="server">
            <asp:PageCatalogPart ID="PageCatalogPart1" runat="server" />
    <asp:WebPartZone ID="WebPartZone1" runat="server">
            <asp:Calendar ID="Calendar1" runat="server" Title="A Calendar"></asp:Calendar>


protected void Page_Load(object sender, EventArgs e) {
            WebPartManager1.DisplayMode = WebPartManager.CatalogDisplayMode;


On load

After closing the WebPart

Thanks again!

Yes, this does work and I figured out my problem. The property I had added to the user control (called "Title") was overriding this feature. Strange!

Thanks for the help!