It doesnt appear on the screen when I run it..but it does appear in visual studio 2010 in the design view. Also i want to set the tabs from left to right to right to left:
<asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="2"
Height="584px" Width="739px" AutoPostBack="True" BackColor="#666699"
BorderColor="#666699">
<asp:TabPanel ID="Questions" runat="server" HeaderText="שאלות">
<ContentTemplate>
<asp:GridView runat="server" Height="547px"
style="margin-left: 2px; margin-top: 15px" Width="667px">
</asp:GridView>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="Answers" runat="server" HeaderText="תשובות">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" Height="547px"
style="margin-top: 17px" Width="666px">
</asp:GridView>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="Responses" runat="server" HeaderText="תגובות">
<ContentTemplate>
<asp:GridView ID="GridView2" runat="server" Height="547px"
style="margin-top: 21px" Width="666px">
</asp:GridView>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
For set tabs right to left add the following style onto the page:
.ajax__tab_header
{
text-align: right;
}
But for resolving visibility issue it is not enough information. Do you play with visibility property in code-behind?
Or even better:
.ajax__tab_header
{
direction: rtl;
}
that will switch the order of the tabs too. (for rtl languages)
Related
When the user selects a row in my datagrid view the label outside the datagridview does not update.
Here is my datagridview
As you can see in visual studio the value of the selected row is captured. However visually it does not update.
Here is what my datagrid code looks like.
<asp:UpdatePanel ID="uplPanel" runat="server" >
<ContentTemplate>
<asp:GridView ID="gvInventario" runat="server" AutoGenerateColumns="false" AllowSorting="true" ShowFooter="false" DataKeyNames="componente_id, ubicacion_id, proveedor_id" PageSize="20"
ShowHeaderWhenEmpty="true" AllowPaging="True" OnPageIndexChanging="gridView_PageIndexChanging" OnSelectedIndexChanged="OnSelectedIndexChanged" OnRowDataBound="OnRowDataBound"
CellPadding="3" AllowColumResize="True" onsorting="grdDetails_Sorting" GridLines="None" CssClass="mGrid" PagerStyle-CssClass="pgr" AlternatingRowStyle-CssClass="alt">
<Columns>
Here is what the code for the labels outside the grid looks like
<div id="ChangeQuantitySection" class="menusection">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label7" runat="server" Text="Cambiar la cantidad" CssClass="second-menu-title"></asp:Label>
<br/>
<b><asp:Label ID="Label3" runat="server" Text="Proveedor: "></asp:Label></b>
<asp:Label ID="lblProveedor" runat="server" Text=""></asp:Label>
<br/>
<b><asp:Label ID="Label2" runat="server" Text="Tipo: "></asp:Label></b>
<asp:Label ID="lblType" runat="server" Text=""></asp:Label>
<br/>
<b><asp:Label ID="lblQtRequired" runat="server" Text="Cantidad requerida: "></asp:Label></b>
<asp:TextBox width="50px" ID="txtQtRequired" runat="server" TextMode="Number" min="0" step="1" Value="0"></asp:TextBox>
<br/>
<asp:Button class="btn btn-primary" ID="Button1" runat="server" Text="Validar" OnClick="Confirm_purchase_order_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
Check if you use correct lable IDs. Because in your example labels ids are not consistent. Update the correct labels in your event.
I change UpdateMode="Conditional" to UpdateMode="Always" Thanks to the answer I found here how to update a control in another updatepanel?
I am using an update panel inside which I have a treeview control. I wrote an async trigger with the same. I am getting an error which I couldn't solve as I am seeing it for the first time. I also got this error for the my control which was in update panel but that got solved as i used $ for separation of parent and child. Now i am having problem for finding event name. Following is my error
Could not find an event named 'PopulateNode' on associated control 'TreeView_Parent_Child' for the trigger in UpdatePanel '_updatepnlTreeview'.
My code is
<asp:Panel ID="Panel1" Visible="true" runat="server"
ScrollBars="Auto">
<div style="overflow: auto; height: 400px; width:230px; border-right: solid; border-right-color: gray">
<asp:UpdatePanel ID="_updatepnlTreeview" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:TreeView ID="TreeView_Parent_Child" EnableClientScript="true" align="left"
AutoGenerateDataBindings="true" LeafNodeStyle-ForeColor="Black" NodeStyle-ForeColor="Black"
PopulateNodesFromClient="true" runat="server" Font-Names="Arial"
OnTreeNodePopulate="PopulateNode"
HoverNodeStyle-BackColor="ActiveBorder" Font-Size="Small" ImageSet="Arrows" NodeStyle-HorizontalPadding="5px">
<HoverNodeStyle Font-Bold="true" BackColor="Beige" />
<Nodes>
</Nodes>
<NodeStyle ForeColor="Black" />
<LeafNodeStyle ForeColor="Black" />
</asp:TreeView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TreeView_Parent_Child" EventName="PopulateNode" />
</Triggers>
</asp:UpdatePanel>
</div>
</asp:Panel>
The EventName needs to be changed to the name of the event instead of the method:
<Triggers>
<asp:AsyncPostBackTrigger ControlID="TreeView_Parent_Child" EventName="TreeNodePopulate" />
</Triggers>
I have two panels. I want to show them abreast, but they don't.
.aspx:
<asp:Panel ID="treeviewMenu" Width="20%" Height="500" runat="server" ScrollBars="Both" HorizontalAlign="Left">
<asp:TreeView ID="treeview" runat="server" ShowLines="True" ImageSet="XPFileExplorer" OnSelectedNodeChanged="treeview_SelectedNodeChanged">
</asp:TreeView>
</asp:Panel>
<asp:Panel ID="qvObjektMenu" Width="75%" Height="500" runat="server" HorizontalAlign="Right">
<asp:Table runat="server" HorizontalAlign="Right">
<asp:TableRow>
<asp:TableCell>
<asp:Label runat="server">
QVObjekt Id:
</asp:Label>
</asp:TableCell>
<asp:TableCell>
<asp:Label ID="qvObjektId" runat="server"></asp:Label>
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</asp:Panel>
I have used a table outside this two elements, another Panel around them, nothing works.
How can I resolve this?
The answer here is CSS. There are a few options for how to do it in CSS.
Option 1: display:inline-block;
One option for that css is to use display: inline-block;:
<style type="text/css">
.inlineBlock { display: inline-block; }
</style>
Coupled with setting it in the <asp:Panel ...> tags:
<asp:Panel ID="treeviewMenu" ... CssClass="inlineBlock">
...
</asp:Panel>
<asp:Panel ID="qvObjektMenu" ... CssClass="inlineBlock">
...
</asp:Panel>
Option 2a: float:left;
Another option, as mentioned in Wim's answer is to use floats. But I do not think you want to combine both panels to have floats -- I suspect you only want one or the other. Either:
<style type="text/css">
.floatLeft { float: left; }
</style>
And
<asp:Panel ID="treeviewMenu" ... CssClass="floatLeft">
<asp:TreeView ID="treeview" runat="server" ShowLines="True" ImageSet="XPFileExplorer" >
</asp:TreeView>
</asp:Panel>
(with the other panel as it currently is in your markup)
OR
Option 2b: float:right;
<style type="text/css">
.floatRight { float: right; }
</style>
And
<asp:Panel ID="qvObjektMenu" ... CssClass="floatRight">
...
</asp:Panel>
Panels will be rendered as DIV elements so using css float:left, float:right and margin should work.
I've got an updatePanel and a button which triggered in it.
However, the button causes full postback instead of partial one.
Here's my Code:
<asp:Button ID="cEvent" runat="server" Text="צור יום" Width="80px"
Height="40px" Font-Size="Medium" onclick="cEvent_Click" CausesValidation="false"/>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel id = "updatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="cEvent" EventName="Click"/>
</Triggers>
<ContentTemplate>
<div id="yesEve" runat="server" visible="false" style="width:95%; float:right; margin-left:5%; padding-top:20px; margin-bottom:20px;">
<table id="mytable" cellspacing="0" runat="server">
</table>
</div>
<div id="errorMsg" runat="server" visible="false" style="width:100%; text-align:center; float:right;">
<asp:label visible="true" ID="msg1" Font-Size="Medium" runat="server" Font-Bold="true" Text = "היום נמחק בהצלחה"></asp:label>
</div>
<div id="noEve" style="width:100%; padding-top:20px; float:right; text-align:center; margin-bottom:20px;" runat="server" visible="false">
<asp:label visible="true" ID="stamLabel" Font-Size="Medium" runat="server" Font-Bold="true" Text = "לא קיימים ימים פתוחים"></asp:label>
</div>
<asp:LinkButton ID ="remove" runat="server"></asp:LinkButton>
</ContentTemplate>
</asp:UpdatePanel>
I really need some help with that... i'm searching for hours all over the web to find an answer.
Thanks, Matan
In the code behind, you can try adding this line:
ScriptManager.GetCurrent(Page).RegisterPostBackControl(Button1);
There is nothing wrong with your code, you have a conflict somewhere with code(ClientIDs) you haven't show us or a JavaScript error breaking the page.
Here's a template for how to do this from a microsoft tutorial page:
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<fieldset>
<legend>UpdatePanel</legend>
<asp:Label ID="Label1" runat="server" Text="Panel created."></asp:Label><br />
</fieldset>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
More information here:
microsoft tutorial
I am currently developing an ASP.net c# application. I have a grid view which has bound link buttons inside. When the link button is pressed I want to display the modal popup using a fade in animation and a fade out animation when a button inside the modal popup is clicked.
I have added the animation extender into the code and set the TargetControlID to the ID of the link button, however, when I try to run the website it displays the error System.InvalidOperationException the TargetControID of ModalPopupExtender is not valid. A control with ID 'sofLink' could not be found. sofLink is the ID of the LinkButton.
Below is the code for the grid view
<asp:GridView ID="tblSoftware" runat="server" Width="100%"
EnableModelValidation="True" AutoGenerateColumns="False"
onselectedindexchanged="tblSoftware_SelectedIndexChanged"
CellPadding="2">
<Columns>
<asp:TemplateField HeaderText="Software Name">
<ItemTemplate>
<asp:LinkButton ID="sofLink" Text='<%# Bind("sof_softwareName") %>'
CommandName="sofID" OnCommand="GetSoftwareModal" CommandArgument='<%# Eval("sof_id") %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="sof_platform" HeaderText="Platform" ReadOnly="True" SortExpression="sof_platform" />
</Columns>
<HeaderStyle CssClass="gridHeader" />
<PagerSettings Position="Bottom" />
<PagerStyle HorizontalAlign="Right" VerticalAlign="Middle" CssClass="gridPage" />
<AlternatingRowStyle BackColor="White"></AlternatingRowStyle>
</asp:GridView>
And below is the code for the ModalPopupExtender
<ajaxToolkit:ModalPopupExtender ID="mpe" runat="server" TargetControlID="sofLink"
PopupControlID="ModalPanel" DropShadow="true" Drag="true" OkControlID="OKButton" />
<asp:Panel ID="ModalPanel" runat="server" Width="500px" style="width: auto; height: auto;" CssClass="modalPopup">
<asp:Label ID="softwareTitle" Font-Bold="true" Font-Size="Medium" runat="server" Width="100%" style="text-align: center;" /><br /><br />
<asp:Literal ID="litSoftware" runat="server"></asp:Literal>
<asp:Button id="OKButton" runat="server" Text="Close" style="position: relative; right: 0px; width: 100px;" />
</asp:Panel>
<asp:ScriptManager ID="asm" runat="server" />
And below is the code for the animation
<ajaxToolkit:AnimationExtender ID="popupAnimation" runat="server"
TargetControlID="sofLink">
<Animations>
<OnClick>
<Parallel AnimationTarget="ModalPanel"
Duration="0.3" Fps="25">
<FadeIn />
</Parallel>
</OnClick>
</Animations>
</ajaxToolkit:AnimationExtender>
Thanks for any help you can provide.
The TargetControlID (as far as I am aware) should be a control in the popup panel itself, not in the grid control. When I use the ModalPopupExtender I usually use an asp:Button with 'display:none' as the TargetControlID. Eg,
<ajaxToolkit:ModalPopupExtender ID="mpe" runat="server" TargetControlID="btnPopup"
PopupControlID="ModalPanel" DropShadow="true" Drag="true" OkControlID="OKButton" />
<asp:Panel ID="ModalPanel" runat="server" Width="500px" style="width: auto; height: auto;" CssClass="modalPopup">
<asp:Button id="btnPopup" runat="server" style="display:none" />
In the code-behind you have to control the showing and hiding of the control base on an event, eg, GetSoftwareModal. You will also also to bind what you need if applicable.
Hope that helps.
You could use a hidden button and use it's ID as TargetControlID of the ModalPopupExtender.
<asp:Button id="btnShowPopup" runat="server" style="display:none" />
Then you can call the button's click clientside if you want to show the popup immediately without postback in the follwoing way:
<asp:LinkButton ID="sofLink" runat="server" OnClientClick="javascript:document.getElementById('btnShowPopup').click();return false;">LinkButton</asp:LinkButton>
I tried however my animation doesn't display.
I add databind into LinkButton:
<asp:LinkButton ID="sofLink" runat="server" OnClientClick="javascript:document.getElementById('DetailView1').databind();document.getElementById('btnShowPopup').click();return false;">LinkButton</asp:LinkButton>
I think because of databind of DetailView1, it need get data from database. If DetailView1 doesn't bind, the animation display normal.