web part footer does not appear - asp.net

the web part footer does not appear in a webpart like this
<asp:WebPartZone ID="WebPartZone1" runat="server" style="height:100px;" CssClass="PartZone" PartChromeType="TitleAndBorder" ShowTitleIcons="true" Width="200">
<FooterStyle CssClass="PartFooterStyle" />
<PartTitleStyle CssClass="PartTitleStyle" />
<ZoneTemplate>
<asp:Panel ID="Panel2" runat="server" Width="200" Height="200">
<asp:Button ID="Button1" runat="server" Text="Button" />
</asp:Panel>
</ZoneTemplate>
</asp:WebPartZone>
what is wrong with this ?
thanks

Well I believe it's a bug cause it does not appear at any condition.

Related

click event for a group of controls

I've created a user control that has one asp:Image and one asp:Label below it and one more asp:Label below last label. I want this user control behaves like a button entirely, mean that we have a box that image and two labels are in it and when user click on every point on this box, it acts like a button and do anything according to it's click event.
can anyone please help me?
<%# Control Language="VB" AutoEventWireup="false" CodeFile="room.ascx.vb" Inherits="room" %>
<style type="text/css">
.image {
width:100px;
height:100px;
margin:2px;
border:solid;
border-width:1px;
}
.text {
margin-left:2px;
margin-right:2px;
text-wrap:normal;
text-align:right
}
</style>
<asp:Panel ID="Panel" runat="server" width="106px" BorderStyle="Solid" BorderWidth="3px" BackColor="Wheat">
<asp:Image ID="img" runat="server" CssClass="image" /> <br />
<asp:Label ID="name" runat="server" Text="name" Width="100px" CssClass="text" /> <br />
<asp:Label ID="price" runat="server" Text="Label" Width="100px" CssClass="text" /> <br />
</asp:Panel>
try adding onclick="yourFunction()" in asp:Panel so it will look like this
<asp:Panel ID="Panel" runat="server" onClick="yourJsFunction()" width="106px" BorderStyle="Solid" BorderWidth="3px" BackColor="Wheat">
<asp:Image ID="img" runat="server" CssClass="image" /> <br />
<asp:Label ID="name" runat="server" Text="name" Width="100px" CssClass="text" /> <br />
<asp:Label ID="price" runat="server" Text="Label" Width="100px" CssClass="text" /> <br />
</asp:Panel>
you can also check other questions on stackoverflow. Some already answered question can be found at following links
add mouseclick event to panel
Adding OnClick event to ASP.NET control

A way to display ASP.NET Wizard navigation controls on top

I have an asp.net wizard and I want the navigation controls (the next/previous buttons) to appear at the top instead of the bottom of the wizard.
Is there a simple way to set the location of the navigation area in the Wizard?
Or will I have to resort to have empty StartNavigationTemplate, StepNavigationTemplate, FinishNavigationTemplate so that standard navigation controls won't show, and then add div elements with custom buttons for the navigation?
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Width="95%" DisplaySideBar="False"
FinishCompleteButtonType="Link" FinishPreviousButtonType="Link" StartNextButtonType="Link"
StepNextButtonType="Link" StepPreviousButtonType="Link" OnActiveStepChanged="Wizard1_ActiveStepChanged"
OnNextButtonClick="Wizard1_NextButtonClick"
OnFinishButtonClick="Wizard1_FinishButtonClick">
<HeaderStyle HorizontalAlign="Center" Font-Bold="True" />
<HeaderTemplate>
Edit User Wizard
<br />
<br />
<div style="text-align:left">
<asp:Label ID="lblStepTitle" runat="server" Text="Step Title"></asp:Label>
</div>
</HeaderTemplate>
<StartNavigationTemplate>
</StartNavigationTemplate>
<StepNavigationTemplate>
</StepNavigationTemplate>
<FinishNavigationTemplate>
</FinishNavigationTemplate>
<WizardSteps>
</WizardSteps>
</asp:Wizard>
Here's a way I found to re-arrange the wizard areas relative to each other, using LayoutTemplate element and asp:PlaceHolder control for each wizard area (header, sidebar, step, navigation); only thing I had to do was moving the navigationPlaceHolder above the headerPlaceHolder; now navigation controls appear at the top of the wizard, which what I wanted.
<asp:Wizard ID="Wizard1" runat="server" ActiveStepIndex="0" Width="95%" DisplaySideBar="False"
FinishCompleteButtonType="Link" FinishPreviousButtonType="Link" StartNextButtonType="Link"
StepNextButtonType="Link" StepPreviousButtonType="Link" OnActiveStepChanged="Wizard1_ActiveStepChanged"
OnNextButtonClick="Wizard1_NextButtonClick"
OnFinishButtonClick="Wizard1_FinishButtonClick">
<HeaderStyle HorizontalAlign="Center" Font-Bold="True" />
<LayoutTemplate>
<asp:PlaceHolder ID="navigationPlaceHolder" runat="server"/>
<asp:PlaceHolder ID="headerPlaceHolder" runat="server" />
<asp:PlaceHolder ID="sideBarPlaceHolder" runat="server" />
<asp:PlaceHolder ID="WizardStepPlaceHolder" runat="server" />
</LayoutTemplate>
<HeaderTemplate>
Edit User Wizard
<br />
<br />
<div style="text-align:left">
<asp:Label ID="lblStepTitle" runat="server" Text="Step Title"></asp:Label>
</div>
</HeaderTemplate>
<WizardSteps>
</WizardSteps>
</asp:Wizard>

Why some div content is missing from ZoneTemplate in asp.net webpart?

Here is my code:
<asp:WebPartZone ID="Zone1" runat="server" Width="100%" PartChromeType="None" Padding="0" PartStyle-CssClass="NoPadding"
PartStyle-BackColor="Transparent" BackColor="Transparent" PartChromeStyle-BackColor="Transparent">
<PartStyle BackColor="Transparent"></PartStyle>
<CloseVerb Visible="false" />
<MinimizeVerb Visible="false" />
<ZoneTemplate>
<div class="demo">
<p>Procedure Queues</p>
</div>
<div class="demoBottom">
<div class="divPortletContent">
<br />
<asp:DataList ID="dlProcedureQueues" runat="server" >
<ItemTemplate>
<asp:HyperLink ID="lbProcedureQueues" runat="server" Text='<%# Eval("site_nm") %>' NavigateUrl='<%# Eval("site_url") %>' />
</ItemTemplate>
</asp:DataList>
</div>
</div>
</ZoneTemplate>
</asp:WebPartZone>
The text from <div class="demo"><p>Procedure Queues</p></div> is miising and it works if I put it outside of webpart. Also, I am loosing all the css styles when placed inside webpart's ZoneTemplate.
Any ideas?? Thanks in advance.
Let me answer my own question. From what I found out, ZoneTemplate only considers the asp controls (including user controls) as web parts and ignores all the html.

asp.net ModalPopupExtender not behaving properly

I have the following code on a .aspx file. If I comment out the ModalPopupExtender code works fine.:
<cc1:ModalPopupExtender BehaviorID="mdlPopup" runat="server" TargetControlID="btn"
ID="mdl1" PopupControlID="pnlPopup" OkControlID="LinkButton1" BackgroundCssClass="modalBackground" />
<asp:Panel ID="pnlPopup" runat="server" CssClass="confirm-dialog" Style="display: none;">
<div class="inner">
Work Order #: <asp:TextBox ID="txtWorkOrder" runat="server" Width="285" Text=""></asp:TextBox><br /><br />
Please Enter Corrective Actions<br />
<asp:TextBox ID="TextBox2" runat="server" Height="150" Width="285" TextMode="MultiLine"
Text=""></asp:TextBox>
<asp:Button ID="btnOK" runat="server" Font-Bold="true" Text="Submit" OnClick="click"
Width="150" />
<asp:LinkButton ID="LinkButton1" runat="server" CssClass="close" OnClick="cancel" />
</div>
</asp:Panel>
<asp:Button ID="btn" runat="server" Style="display: none;" />
<asp:Label ID="id" runat="server" Text="Label" Visible="false"></asp:Label>
The problem that I am having is that the page just hangs when I have this code in the .aspx file. Is there anything I should do. It does not even get to the Page_Load.
I am calling this page that has the above code with the following:
string url = "Alerts.aspx?";
url += "ID=" + id.Text;
Response.Redirect(url);

how to stop refreshing of current page when any server side event of web user control being fired

I'm building a web user control.
Now i need to fire some server side events on web user control.
And also need to stop page refreshing.
Can any one tell me how can i fire server side event on web user control without refreshing hole page.
Edit-1
My control (.ascx)
<%--Control designer start--%>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div style="position:relative;border:none;" id="divComboContainer" runat="server" >
<%--Hidden fields for datacombo values--%>
<asp:HiddenField ID="Hidden_Value" Value="" runat="server" />
<asp:HiddenField ID="Hidden_SorDir" Value="" runat="server" />
<asp:HiddenField ID="Hidden_RowIndex" Value="" runat="server" />
<asp:HiddenField ID="hfScrollPosition" Value="" runat="server" />
<%--Seleted text display textbox--%>
<asp:TextBox ID="txtDisplay" runat="server" CssClass="tb10" autocomplete="off" ToolTip="Type for search"></asp:TextBox>
<%--Panal and controls for dropdown--%>
<asp:Panel ID="DropPanel" runat="server" CssClass="ContextMenuPanel" Width="1000px"
style="display :none;
visibility: hidden;
border:2px solid #E5E5E5;
padding-bottom:-1px;
margin-top:-28px;
background-color:#83ACF3;
overflow:hidden;
height:auto;
max-height:700px;
max-width:1000px;">
<%--<asp:Button ID="Button1" runat="server" Text="Button" />--%>
<%--Search textbox div--%>
<div class="ddeSerch">
<div style="padding-top:5px;float:left;">
Look-Up
</div>
<asp:TextBox runat="server" ID="txtSearch" autocomplete="off" CssClass="tb10" BackColor="White" Width="50%" MaxLength="150"
onclick="return false;"
style="background: url(GridViewCSSThemes/Images/tia.png) no-repeat top right;background-color:White;padding-right:25px;">
</asp:TextBox>
<div style="padding-top:5px;float:right;cursor:pointer;" runat="server" id="dcmbClose" >
Close
</div>
</div>
<%--Datacombo header--%>
<asp:Table ID="Table1" runat="server" CssClass="header" GridLines="Vertical" Width="100%">
</asp:Table>
<%--Datacombo body(records)--%>
<div id="divGrid" runat="server" style="max-height:615px;width:100%;overflow-X:auto;overflow-Y:auto;">
<asp:GridView ID="gridEdit" GridLines="Vertical" runat="server" Width="100%"
ShowFooter="false" AutoGenerateColumns="false" ShowHeader="false" AllowSorting="true"
Font-Size = "11pt" Font-Names = "Arial" style="color:Black;"
AlternatingRowStyle-BackColor="#CCDDFB"
RowStyle-BackColor="WhiteSmoke"
OnRowCreated="gridEdit_RowCreated" OnRowDataBound="gridEdit_RowDataBound" OnSorting="gridEdit_Sorting">
<HeaderStyle HorizontalAlign="Left" CssClass="header" Font-Bold="false" />
<RowStyle CssClass="rowstyle"/>
<Columns>
</Columns>
</asp:GridView>
</div>
<%--Datacombo footer--%>
<table class="footer" id="tblfooter" runat="server">
<tr>
<td style="text-align:left;">
<asp:TextBox Enabled="false" autocomplete="off" ID="lblOrd" CssClass="footer" runat="server" Width="100%"></asp:TextBox>
</td>
<td style="text-align:right;">
<asp:TextBox Enabled="false" autocomplete="off" ID="lblTot" CssClass="footer" style="text-align:right;" runat="server" Width="100%"></asp:TextBox>
</td>
</tr>
</table>
</asp:Panel>
<ajaxToolkit:DropDownExtender runat="server" ID="DDE"
TargetControlID="txtDisplay"
DropDownControlID="DropPanel" HighlightBorderColor="Transparent">
</ajaxToolkit:DropDownExtender>
</div>
</ContentTemplate>
</asp:UpdatePanel>
Use on aspx page
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<uc1:UCDataCombo runat="server" ID="UCDataCombo4"/>
</ContentTemplate>
</asp:UpdatePanel>
When user clicks on header of gridview it fires some events.
And hole page got refreshed.
I need to stop refreshing of hole page.
UpdatePanel enables sections of a page to be partially rendered without a postback.
You can have a full understanding by reading here.
-EDIT-
I don't if this will help but you gotta try this:
Check if is set in your web.config, if it is there you may want to remove it.
Go to this link for more details.
Hope it helps!
Problem i solved by setting clientIDMode to Static.
clientIDMode="Static".
Now update panel works fine.

Resources