asprepeater

How to access specific controls in a ASP.Net Repeater

孤人 提交于 2021-01-27 12:59:54
问题 Introduction I am working on a college project where I need to build a shopping website. I am currently building a "Manage Shopping Cart" page with the following structure: What is important for my question is the "products". The "products" is a ASP.Net Repeater that only uses the ItemTemplate control. The repeater is then populated with a list of products in a user's cart. What is my problem? The particular area I am having trouble with is the "Save" Button. The user can change the quantity

How to access specific controls in a ASP.Net Repeater

大城市里の小女人 提交于 2021-01-27 12:43:27
问题 Introduction I am working on a college project where I need to build a shopping website. I am currently building a "Manage Shopping Cart" page with the following structure: What is important for my question is the "products". The "products" is a ASP.Net Repeater that only uses the ItemTemplate control. The repeater is then populated with a list of products in a user's cart. What is my problem? The particular area I am having trouble with is the "Save" Button. The user can change the quantity

Maintaining viewstate of a repeater

隐身守侯 提交于 2019-12-22 05:07:25
问题 I have a problem whereby the viewstate of a repeater i.e. the controls within the repeater are not maintaing their viewstate. I have the following: Repeater 1: <asp:Repeater ID="rptImages" runat="server"> <ItemTemplate> <asp:LinkButton Text="Add" CommandName="Add" CommandArgument=<%# Eval("ID") %> runat="server" /> </ItemTemplate> </asp:Repeater> When the link button is clicked the value of the CommandArgument is stored in a hidden field on the page. Upon postback I can't get the value of the

Respond to Button Events inside Repeater ItemTemplate

倖福魔咒の 提交于 2019-12-14 02:13:03
问题 so i have removed the datasouce and just have DataBind() then my page is still blowing and refreshing the page and not in a EDIT mode. what i am trying to do is when the user click on Edit button then make it inline editing the repeater row. END UPDATE onItemCommand i have added DataBind() rpt.DataSource = mydatasource; rpt.DataBind(); after i do that my page is not in edit mode and it blow away and everyting is refreshed i have on page_load if (!IsPostBack) { rpt.DataSource = mydatasource;

Why the SQL command is not executing

北城余情 提交于 2019-12-13 09:05:34
问题 I have the following code in my C# code-behind page to execute on button press: String cString; SqlConnection Conn; protected void Page_Load(object sender, EventArgs e) { cString = "Data Source=server;Initial Catalog=database;User Id=user12;Password=pass12;"; } protected void btnGo_Click(object sender, EventArgs e) { Conn = new SqlConnection(cString); Conn.Open(); string sqlCode = "DECLARE @strLocation varchar(200) SET @strLocation = 'Ridge Hill' SELECT [content_title] AS [Physician Name],

ASP.Net Repeater With Bootstrap 3 Modal Confirmation On Delete

China☆狼群 提交于 2019-12-11 16:09:13
问题 I have spent all day trying to achieve this but have failed spectacularly. I have an ASP.Net repeater on my page and have added a LinkButton which pops open a beautiful Bootstrap 3 confirmation modal window (for deletion of a record). I have tried to cobble together solutions but my Java knowledge is failing me. This is my Repeater: <asp:Repeater OnItemCommand="rptImages_ItemCommand" ID="rptImages" OnItemCreated="rptImages_ItemCreated" OnItemDataBound="rptImages_ItemDataBound" runat="server">

Show images in Repeater control

微笑、不失礼 提交于 2019-12-11 10:08:28
问题 I have the following List : private List<System.Web.UI.WebControls.Image> _searchResultList = new List<System.Web.UI.WebControls.Image>(); This List may contain several Images with different URLs. I have the following Repeater : <asp:Panel ID="SearchPanel" runat="server" ScrollBars="Vertical"> <asp:Repeater ID="Repeater" runat="server"> <ItemTemplate> <asp:Image height="32" width="32" runat="server"/> </ItemTemplate> </asp:Repeater> </asp:Panel> Using DataSource to display the images doesn't

Sort Inner Repeater with LINQ query

强颜欢笑 提交于 2019-12-10 15:54:14
问题 I am attempting to list a group of Associations, within each association is a 'widget' that is assigned to the association. The list will include the Association name and any widget assigned to it. The catch is that the inner widget list needs to be sorted by DisplaySequence. EDMX Model Below: Simplified Repeater Mark-Up <asp:Repeater ID="rptAssociations" runat="server"> <ItemTemplate> <div data-type="assn" id="<%# ((Association)Container.DataItem).AssociationID %>"> <h3 style="margin-top

How to use data bound value to form unique identifier for item control?

纵然是瞬间 提交于 2019-12-08 02:15:03
问题 I know that we can bind the data to each control within ItemTemplate as follow: <ItemTemplate> <asp:TextBox runat="server" Text='<%# Eval("LabelText") %>' /> </ItemTemplate> However, I found no way to concatenate a string prefix with the data value to form a unique string identifier. The following code shows my idea, but it doesn't work. <ItemTemplate> <asp:TextBox runat="server" ID='TextBox_<%# Eval("LabelID") %>' ValidationGroup = 'VVG_<%# Eval("LabelGroup") %>' Text='<%# Eval("LabelText")

How to use data bound value to form unique identifier for item control?

纵饮孤独 提交于 2019-12-06 05:30:51
I know that we can bind the data to each control within ItemTemplate as follow: <ItemTemplate> <asp:TextBox runat="server" Text='<%# Eval("LabelText") %>' /> </ItemTemplate> However, I found no way to concatenate a string prefix with the data value to form a unique string identifier. The following code shows my idea, but it doesn't work. <ItemTemplate> <asp:TextBox runat="server" ID='TextBox_<%# Eval("LabelID") %>' ValidationGroup = 'VVG_<%# Eval("LabelGroup") %>' Text='<%# Eval("LabelText") %>' /> </ItemTemplate> Try this ID = '<%# "Text_" + Eval("LabelID") %>' ValidationGroup = '<%# "VVG_" +