I have asp.net repeater(data control) and currently it looks on UI like this
The id of the repeaters are row wise , I want to bind it vertically with same look , My current code for repeater is follows
<table><tr><td>
<asp:Repeater ID="rptOptions" runat="server" OnItemDataBound="rptOptions_ItemDataBound">
<ItemTemplate>
<asp:TextBox ID="txtLetter" runat="server" MaxLength="40" BorderColor="Black" BorderStyle="Solid" onkeydown="navigate(event);" BorderWidth="1px" Height="25px" Style="margin-left: 110px; display: inline; margin-top: 16px;" Visible="true" Width="200px" Enabled="false" oncopy="return(false);" oncut="return(false);" onpaste="return(false);" autocomplete="off" AutoCompleteType="None" >
</asp:TextBox>
</ItemTemplate>
</asp:Repeater>
</td></tr></table>
<asp:Repeater ID="rptOptions" runat="server">
<HeaderTemplate>
<table style="width: 50%">
<tr>
<td>
</HeaderTemplate>
<ItemTemplate>
<asp:TextBox ID="txtLetter" runat="server" MaxLength="40" BorderColor="Black" BorderStyle="Solid"
onkeydown="navigate(event);" BorderWidth="1px" Height="25px" Style="margin-left: 110px;
display: inline; margin-top: 16px;" Visible="true" Width="200px" Enabled="false"
oncopy="return(false);" oncut="return(false);" onpaste="return(false);" autocomplete="off"
AutoCompleteType="None">
</asp:TextBox>
</ItemTemplate>
<FooterTemplate>
</td> </tr> </table>
</FooterTemplate>
</asp:Repeater>
Related
HoverMenuExtender only works after postback in gridview. Weird behavior.
<asp:TemplateField>
<HeaderStyle CssClass="CenterAligner" />
<ItemTemplate>
<asp:Image ID="imgNotes" runat="server" ImageUrl="Images/information.png" Style="position: relative" />
<asp:Panel ID="pnlNotes" runat="server" BackColor="GhostWhite" BorderColor="Black" BorderStyle="Solid" BorderWidth="1" Width="500px" Visible="true">
<div style="position: relative">
<div style="padding: 10px; margin: 10px; text-align: justify">
<asp:Label ID="lblCreditInfo" runat="server" Font-Size="9pt" ForeColor="Black"></asp:Label>
<asp:Label ID="lblCreditWebSite" runat="server" Font-Size="9pt" Text='<%# Bind("CreditWebSite") %>' Visible="false"></asp:Label>
<asp:Label ID="lblCreditUserName" runat="server" Font-Size="9pt" Text='<%# Bind("CreditUserName") %>' Visible="false"></asp:Label>
<asp:Label ID="lblCreditPassword" runat="server" Font-Size="9pt" Text='<%# Bind("CreditPassword") %>' Visible="false"></asp:Label>
</div>
<br />
</div>
</asp:Panel>
<ajaxToolkit:HoverMenuExtender ID="hmeNotes" runat="server" PopupControlID="pnlNotes" PopupPosition="left" TargetControlID="imgNotes">
</ajaxToolkit:HoverMenuExtender>
</ItemTemplate>
<ItemStyle HorizontalAlign="center" />
<HeaderStyle HorizontalAlign="Left" />
</asp:TemplateField>
Before Postback After Postback
I was missing the panel for the balloon extender that was also on the page.
I want to render Usercontrol in the same line as my other controls in . By default, it renders in new line for user control.
Here is my Markup
<tr>
<td>
<asp:ContentPlaceHolder ID="TitleContentPlaceHolder" runat="server">
<asp:Label ID="lblTitle" runat="server" EnableTheming="False" Font-Size="Small" ForeColor="Green"
Font-Bold="True" Style="margin-left: 18px"></asp:Label>
<asp:HyperLink ID="gotoHyperLink" Visible="false" EnableTheming="False" Font-Size="Small"
ForeColor="Green" Font-Bold="True" Style="margin-left: 2px" runat="server" NavigateUrl=""
Target="_blank">- To Wiki</asp:HyperLink>
<uc1:GoToRequestControl ID="GoToRequestControl1" runat="server" />
</asp:ContentPlaceHolder>
</td>
</tr>
I want to render the UC1 in the same line as previous two controls in Div if possible after some spacing to the right. Any fix on how to achieve this?
My User Control is designed using despite that I want it to be on same line. Here is my Usercontrol's HTML
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:Panel runat="server" DefaultButton="btnGo" BackColor="Transparent">
<table style="margin-left:18px">
<tr valign="top">
<td>
<b><asp:Literal ID="Label1" runat="server" Text="Coeus Request ID: " EnableTheming="False"></asp:Literal></b>
</td>
<td>
<asp:TextBox ID="tbRequestId" runat="server" EnableTheming="false" Width="260px"></asp:TextBox>
</td>
<td>
<asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btnGo_Click" OnClientClick="CheckLock();"
CausesValidation="False" UseSubmitBehavior="false" />
</td>
<td>
<asp:Label ID="lblStatus" runat="server" Text="" EnableTheming="False" ForeColor="Red"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
I have a UserControl which is a nested GridView (facebook like wall), i want to load posts on scrolling down. I am following this article..
CLICK ME
The problem is that this method is using the first column's last row to get the last productid
something like this
var lastProductId = $("#GridViewUserScraps tr:last").children("td:first").html();
But in my case i am not displaying any id in any of the columns of the UserControl's GridView though i have a ScrapId column(primary key) in database. How can i load Posts on scrolling down? how can i make it work?
My UserControl:
<div id="divProducts" style="height:700px;overflow:auto">
<asp:GridView ID="GridViewUserScraps" ItemStyle-VerticalAlign="Top" AutoGenerateColumns="False"
GridLines="None" Width="100%" ShowHeader="False" runat="server" AlternatingRowStyle-BackColor="#A5A5A5"
CellPadding="4" ForeColor="#333333" DataKeyNames="ScrapId" OnRowCommand="GridViewRowCommand">
<Columns>
<asp:TemplateField>
<FooterTemplate>
<asp:LinkButton ID="LinkButton1" runat="server">Load More</asp:LinkButton>
</FooterTemplate>
<ItemTemplate>
<table align="left" cellpadding="1" cellspacing="2">
<tr>
<td>
<a href='<%#getUserHREF(Container.DataItem)%>'>
<img align="middle" src='<%#getSRC(Container.DataItem)%>' border="0" width="50px" /></a>
</td>
<td>
</td>
</tr>
</table>
<div align="justify">
<b>
<%#DataBinder.Eval(Container.DataItem,"firstname")%>
<div>
<asp:HiddenField ID="hiddenLastProductID" runat="server" Value='<%# Eval("id") %>' />
</div>
</b>
<br />
<%#DataBinder.Eval(Container.DataItem, "Message")%>
<br />
<asp:Image ID="Image" runat="server" ImageUrl='<%# Eval("url") %>' style="max-width:500px;" />
</div>
<span class="SmallBlackText">Posted On: </span>
<asp:Label ID="lblSendDate" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"SendDate")%>'></asp:Label>
</span>
<br />
<%-- <asp:LinkButton ID="lnklike" runat="server"
CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"
CommandName="LikeCmd">Like</asp:LinkButton>
<asp:LinkButton ID="lnkunlike" runat="server">unlike</asp:LinkButton>--%>
<asp:ImageButton ID="lnklike" runat="server" ImageUrl="~/Images/thumbsup.png" Height="20px"
Width="20px" CommandName="like" CommandArgument='<%# Eval("ScrapId")%>' />
<asp:UpdatePanel runat="server" ID="UpdatePanel" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lnklike" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Controls_GetUserScraps.abc((int)Eval("ScrapId")) %>' />
</ContentTemplate>
</asp:UpdatePanel>
<%--<asp:Label ID="Label1" runat="server" Text='<%# WebPageName.StaticMethodName((int)Eval("ScrapId")) %>' />--%>
<asp:ImageButton ID="lnkunlike" runat="server" CommandArgument='<%# Eval("ScrapId")%>'
CommandName="unlike" Height="20px" ImageUrl="~/Images/thumbsdown.png" Width="20px" />
<asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lnkunlike" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label2" runat="server" Text='<%# Controls_GetUserScraps.xyz((int)Eval("ScrapId")) %>'></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:LinkButton ID="lnkcomment" runat="server">Comment</asp:LinkButton>
<asp:LinkButton ID="lnkviewall" runat="server" CommandName="viewall" CommandArgument='<%# Eval("ScrapId")%>'>View All</asp:LinkButton>
<br />
<asp:Panel ID="Pnlchildgrid" runat="server">
<asp:GridView ID="childgrid" runat="server" AutoGenerateColumns="False" OnRowCommand="childgrid_RowCommand"
Style="width: 450px; float: right;">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table align="left" cellpadding="1" cellspacing="2">
<tr>
<td>
<a href='<%#getUserHREF(Container.DataItem)%>'>
<img align="middle" src='<%#getSRC(Container.DataItem)%>' border="0" width="30px" /></a>
</td>
<td>
</td>
</tr>
</table>
<div align="justify">
<b>
<%#DataBinder.Eval(Container.DataItem, "firstname")%></b><br />
<%#DataBinder.Eval(Container.DataItem, "commentmsg")%>
<br />
</div>
<span class="SmallBlackText">Posted On: </span>
<asp:Label ID="lblSendDate" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"SendDate")%>'></asp:Label>
</span>
<br />
<asp:ImageButton ID="lnklike" runat="server" Height="20" Width="20" CommandName="childlike"
CommandArgument='<%# Eval("commentid")%>' ImageUrl="~/Images/thumbsup.png" />
<asp:Label ID="Label1" runat="server" Text='<%# Controls_GetUserScraps.abc1((int)Eval("commentid")) %>' />
<asp:ImageButton ID="lnkunlike" runat="server" CommandArgument='<%# Eval("commentid")%>'
CommandName="childunlike" Height="20" ImageUrl="~/Images/thumbsdown.png" Width="20" />
<asp:Label ID="Label2" runat="server" Text='<%# Controls_GetUserScraps.xyz1((int)Eval("commentid")) %>'></asp:Label>
<%-- <asp:LinkButton ID="lnkcomment" runat="server">Comment11111</asp:LinkButton>--%>
<br />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<asp:Panel ID="Panel1" runat="server">
<asp:TextBox ID="txtcomment" runat="server" Width="500px" ></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Comment" CommandName="comment" CommandArgument='<%# Eval("ScrapId")%>' />
</asp:Panel>
</asp:Panel>
<br />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<RowStyle BackColor="#EFF3FB" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
</div>
I've got a search page that has the criteria in a panel, when the page opens obviously there are no results and the page footer is appearing directly beneath the search panel. How do I set the results panel to be a set height, then stretch to be the height of the grid when search results are found.
Cheers
<%# Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="FrmSearch.aspx.cs" Inherits="web.FrmSearch" %>
<%# Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
<asp:UpdatePanel ID="pnlUpdate" runat="server" ChildrenAsTriggers="true">
<ContentTemplate>
<div id="divSearch">
<asp:Panel ID="pnlSearch" runat="server" DefaultButton="BtnSearch">
<table width="100%">
<tr>
<td>
<asp:Label ID="LblName" runat="server" Text="Name:" CssClass="head2"></asp:Label>
</td>
<td>
<asp:TextBox ID="TxtSurname" runat="server" Width="200" CssClass="norm"></asp:TextBox>
</td>
<tr>
<td>
<asp:Label ID="LblAddress" runat="server" Text="Address:" CssClass="head2"></asp:Label>
</td>
<td>
<asp:TextBox ID="TxtAddress" runat="server" Width="200" CssClass="norm"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="BtnSearch" runat="server" Text="Search" OnClick="BtnSearch_Click" />
</td>
<td colspan="2" align="center">
<asp:Button ID="BtnReset" runat="server" Text="Reset" OnClick="BtnReset_Click" />
</td>
</tr>
</table>
</asp:Panel>
</div>
<div>
<asp:Label ID="lblCount" runat="server" CssClass="head2"></asp:Label>
</div>
<hr />
<div id="divResults">
<asp:Panel ID="pnlResults" runat="server">
<asp:GridView ID="gvResults" runat="server" AutoGenerateColumns="false" Width="99%"
CssClass="grd" OnRowDataBound="gvResults_RowDataBound">
<Columns>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:HiddenField ID="hfGUID" runat="server" Value='<%# Bind("GUID")%>' />
<asp:Label ID="LblName" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Address">
<ItemTemplate>
<asp:Label ID="LblAddress" runat="server" Text='<%# Bind("Address") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Post Code">
<ItemTemplate>
<asp:Label ID="LblPostCode" runat="server" Text='<%# Bind("Post_Code") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Telephone">
<ItemStyle Width="150px" />
<ItemTemplate>
<asp:Label ID="LblTelephone" runat="server" Width="150px" Text='<%# Bind("Telephone") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</asp:Panel>
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnSearch" />
<asp:AsyncPostBackTrigger ControlID="btnReset" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
You can use min-height:200px to divSearch container.
#divSearch
{
min-height:200px //according to your requirement
}
I have a Modal Popup that launches from a LinkButton inside a GridView.
Inside the Modal Popup there are 3 TextBox and 3 GridView. Users select items from the GridView row which are then populated inside the text boxes.
When a users selects a GridView row, the modal popup closes. If you open the modal popup again the TextBox is populated but I need the modal popup to remain open.
Main Page Gridview
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"
OnSelectedIndexChanged="GridView1_SelectedIndexChanged"
OnRowDataBound="GridView1_RowDataBound" CssClass="mGrid"
AlternatingRowStyle-CssClass="alt">
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name"
HtmlEncode="true" />
<asp:BoundField DataField="Order" HeaderText="Order"
HtmlEncode="true" />
<asp:BoundField DataField="Drinks" HeaderText="Drinks"
HtmlEncode="true" />
<asp:BoundField DataField="Comments" HeaderText="Comments"
HtmlEncode="true" />
<asp:CommandField ShowSelectButton="true" ButtonType="Link"
Visible="false" SelectText="Enroll" />
<asp:TemplateField ItemStyle-Width="60px">
<ItemTemplate>
<asp:LinkButton ID="lnkEdit" runat="server"
Text="Add Lunch" OnClick="Edit"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
Main Page Modal Popup
<asp:Panel ID="Panel2" runat="server" class="modalPopup" Style="display: none">
<table>
<tr>
<td>
<asp:Label ID="Header" runat="server" Text=""></asp:Label>
</td>
</tr>
<tr>
<td valign="top">
<asp:Label ID="Label1" runat="server" Text="Order"></asp:Label>
</td>
<td valign="top">
<asp:Label ID="Label2" runat="server" Text="Drinks">
</asp:Label>
</td>
<td valign="top">
<asp:Label ID="Label3" runat="server" Text="Comments">
</asp:Label>
</td>
</tr>
<tr>
<td valign="top">
<asp:TextBox ID="txtOrder" runat="server" Rows="3"
TextMode="MultiLine" Width="100%"></asp:TextBox>
</td>
<td valign="top">
<asp:TextBox ID="txtDrinks" runat="server" Rows="3"
TextMode="MultiLine"></asp:TextBox>
</td>
<td valign="top">
<asp:TextBox ID="txtComments" runat="server" Rows="3"
TextMode="MultiLine"></asp:TextBox>
<asp:TextBox ID="txtName" runat="server" Visible="false">
</asp:TextBox>
<asp:TextBox ID="txtDate" runat="server" Visible="false">
</asp:TextBox>
</td>
</tr>
<tr>
<td>
Order History
</td>
</tr>
<tr>
<td valign="top">
<asp:GridView ID="gvOrder" runat="server" CssClass="mGrid"
AlternatingRowStyle-CssClass="alt"
AutoGenerateColumns="false"
OnSelectedIndexChanged="gvOrder_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Order" HeaderText="Order"
HtmlEncode="true" />
<asp:CommandField SelectText="Add To Order"
ShowSelectButton="True" />
</Columns>
</asp:GridView>
</td>
<td valign="top">
<asp:GridView ID="gvDrinks" runat="server" CssClass="mGrid"
AlternatingRowStyle-CssClass="alt"
AutoGenerateColumns="false"
OnSelectedIndexChanged="gvDrinks_SelectedIndexChanged">
<Columns>
<asp:BoundField DataField="Drinks" HeaderText="Drinks"
HtmlEncode="true" />
<asp:CommandField SelectText="Add To Order"
ShowSelectButton="True" />
</Columns>
</asp:GridView>
</td>
<td valign="top">
<asp:GridView ID="gvComments" runat="server" CssClass="mGrid"
AlternatingRowStyle-CssClass="alt"
AutoGenerateColumns="false">
<Columns>
<asp:BoundField DataField="Comments"
HeaderText="Comments"
HtmlEncode="true" />
<asp:CommandField SelectText="Add To Order"
ShowSelectButton="True" />
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td>
<div class="popup_Buttons">
<asp:Button ID="Okaybtn" runat="server" Text="Done"
OnClick="Save" />
<input id="Button1" type="button" value="Cancel" />
</div>
</td>
</tr>
</table>
</asp:Panel>
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<cc1:ModalPopupExtender ID="popup" runat="server" DropShadow="false"
PopupControlID="Panel2" TargetControlID="btnShowPopup"
BackgroundCssClass="modalBackground">
</cc1:ModalPopupExtender>
Can anyone shed some light on why this happens and what I can do to get around it?
Let me know if you need to see some of the codebehind.
Thanks in advance!
Little bit late, but you can call
modalPopupExpander.Show();
Possible way for this is to register to an event of your modal-content page.