Tracking Forums, Newsgroups, Maling Lists
Home Submit Tracker Forums
  Advanced Search
  HOME    TRACKER    ASP.NET


Advertisements:










Forms Data Controls :: Change Literal In A Repeater After A Postback?


I want to change the value of a literal within a repeater ItemTemplate after postback, based on a value detected at postback.I can't render the whole repeater again though I think because it's actually a radio button in the control that inititates the postback and so I need that control / value to be persisted.


View 1 Replies (Posted: Jul 09, 2010 01:29 PM)

Sponsored Links:

Related Forum Messages For ASP.NET category:
Forms Data Controls :: LinkButton Inside Repeater - Get Value From Literal
I have Repeater, which consists of LinkButon and Literal.LinkButon and Literal are whole thing by implication. I want get value from Literal, when user click oncorresponding LinkButton.

Posted: Aug 21, 2010 03:12 PM

View 3 Replies!   View Related
Forms Data Controls :: Getting Repeater's Field Value Without Postback?
i use div and repeater to show categories for searching part. there is a div. when iclick it, repeater opens and if i select a category its name shows on div. this part is ok.Now i do searcing. so i have to take the span's value(or repeater's value).

Posted: Nov 28, 2010 08:42 PM

View 2 Replies!   View Related
Forms Data Controls :: Firing Postback From Repeater Row Click?
I have arepeater which contains a hiddenlink button that fires when I clicka row in my repeater.

Here is the markup for my repeater:

<div id="divResults" style="height: 290px; overflow-y: auto;">
<asp:Label ID="lblNote" runat="server" Text="Note: select a row to edit."></asp:Label> [code]...

Here is the javascript thats added to each row in therptLocations_ItemDataBound:

Row.Attributes.Add("onclick",
"javascript:__doPostBack('ctl00$mainContent$rptLocations$ctl0" + (e.Item.ItemIndex + 1).ToString() +
"$lbtn_SelectRow','')");

When I click the repeater row it fires the SetLocationControlsmethod. As you can see my repeater is wrapped in a DIV of height 290px. When the are more than 9 rows in my repeater you have to scroll the div down to view this row. When I click this row it does the postback but doesn't fire the SetLocationControls method. I've had a look in the source it's created the click event to the repeater row like all the other rows. why this method isn't firing on the rows that aren't initially visible in my DIV?

Posted: Jul 19, 2010 01:47 PM

View 21 Replies!   View Related
Forms Data Controls :: Change Row Color For Repeater?
I have a repeater control in which according to the value from dbase i need to chnage the row color,how to do it...

Posted: Sep 19, 2009 03:31 PM

View 2 Replies!   View Related
Forms Data Controls :: Repeater - Change Value Of DataBinder?
I have a repeater bound to an object data source. I'm trying to change the value of one item, but I'm not binding the values in my datasource to any server controls. I can get the value that's being assigned to PORT, but I don't know how to change it. For Example

[Code]....

[Code]....

Posted: Sep 17, 2009 12:38 AM

View 5 Replies!   View Related
Forms Data Controls :: Property Of Custom Control In Repeater Is Null On Postback?
A common problem in repeater controls where you want to display data for update (like a list of user phone numbers that can be updated and submitted back to the database) is where to store the database unique row identifier. So, I created a custom Textbox control that I've added a Data property to. I populate this data property with the unique row id. The problem is that when I post back the list and go through the repeater items the control's data property is null. The custom control looks like this:

[Code]....

The tag in the repeater looks like this:

[Code]....

I have a custom checkbox with the same data property and it works fine. I actually put in the same repeater with the textbox control and the checkbox control have the row id on postback but the textbox did not. Is there some limitation on the textbox control that might be causing this.

Posted: Jan 12, 2011 09:27 PM

View 1 Replies!   View Related
Forms Data Controls :: Change Row Background Color On Repeater?
I have repeater and I am using foreach to go through each row, checking for specific value and assigned the label accordingly. However, when there is a value that is not expected, I would like to highlight the whole row on yellow color.

How can I set only for specific row in repeater with different background color?

Posted: Jun 29, 2010 06:50 AM

View 3 Replies!   View Related
Forms Data Controls :: Change Repeater's Itemtemplate From Codebehind
I have a requirement where repeater code would be like:-

<asp:Repeater ID="test" runat="server">
<ItemTemplate>
<Description></Description>
<Itemno></Itemno>
<ListPrice></ListPrice>
</ItemTemplate>
</asp:Repeater>

This has to be rendered as:-

<asp:Repeater ID="test" runat="server">
<ItemTemplate>
<%# Eval("Description") %>
<%# Eval("Itemno") %>
<%# Eval("ListPrice") %>
</ItemTemplate>
</asp:Repeater>

I am planning to change the repeaters itemtemplate from codebehind.

Kindly let me know if there is a possible way of doing this. If not then what can be the alternate starategy to make it work.

Posted: Oct 12, 2009 02:23 PM

View 3 Replies!   View Related
Forms Data Controls :: Change From A Gridview To Datalist And Use Of Repeater?
I am building an ASP.NET page which include a shopping cart, and currently I have a menu page which include a gridview and a dropdown list.

customers can choose a particualr shop from the list of shops that appear and then see the menu for the selected shop, from the menu page, at first for any shop category 1 will be displayed, and customers can then choose category 2, 3, etc and by choosing other categories products related to the selcted category will be displayed.

However now I have found out that I should have used a Datalist with Repeater for the menu page, however what I wondering is that if I do change from gridview to Datalist with repeater, could I still keep the category dropdown list and would the dropdown list still work as it is with the gridview.

Posted: Sep 10, 2009 06:31 PM

View 5 Replies!   View Related
Forms Data Controls :: DropDown Index Change In A Repeater?
i have a dropdownlist and a textbox in a repeater i need to enable/disable the textbox depending on what was selected in the repeater.

this is the code i have now:

Protected Sub ddlContact_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)

Posted: Mar 22, 2010 09:03 PM

View 4 Replies!   View Related
Forms Data Controls :: Change Value Of Int Inside Repeater (with Button)?
i have a repeater that displays data from a SQL Server Database. I also want to display an int from the database for the specific item and allow the user to add 1 to the value of that int by clicking a button (almost like a pole). It would work similiar to a 'like' button on Facebook.e.g.

Name: Bruce Springsteen

Click to like (0 likes)
Name: AC/DC

Clickto like (5 likes) [code]....

Posted: Feb 16, 2011 02:14 PM

View 7 Replies!   View Related
Forms Data Controls :: Change Text Of A Linkbutton In A Repeater?
I can't change the text of a linkbutton that is placed in a repeater. I want the text to change when I click the button.

[Code]....

</FooterTemplate>

Posted: Mar 17, 2010 11:05 AM

View 4 Replies!   View Related
Forms Data Controls :: Change Row Color In Mouse Over In Repeater?
i have a repeater and i want to have chang color row in mouse over.

Posted: Feb 18, 2011 11:04 AM

View 4 Replies!   View Related
Forms Data Controls :: How To Change A Data Item Before Binding To A Repeater
[Code]....

How to change a data item before binding to a repeater?

Posted: Oct 23, 2009 08:25 AM

View 2 Replies!   View Related
Forms Data Controls :: Find A DIV In A Repeater - Change The Class Attributes?
I need to do this in the Itemdatabound event. I need to change the class attributes of the div.

Posted: Nov 24, 2009 04:51 PM

View 1 Replies!   View Related
Forms Data Controls :: Find Html Anchor Inside Repeater With Dynamic Data And Then Change ID
I have a master page that uses a repeater to create html anchors forthe main navigation menu. I also have some css that controls the display. The anchors are databound from a web.sitemap file.

I also have exposed a property on the master page that specifies which anchor is supposed to be highlighted in the navigation menu. Content forms assign value to this property.

Here are the relevant snippets:

[Code]....

[Code]....

What happens is I successfully match the ActiveMenuSelection property to the item_databound argument, but from there I am a little fuzzy on finding the specific control I want to modify.

Has anyone ever tried something like this?

I know that I could probably use an <asp:Menu /> control, but if there is a solution to the above, that would be better for my purposes.

Posted: Nov 05, 2009 08:25 PM

View 2 Replies!   View Related
Forms Data Controls :: How To Change A Repeater Hyperlink Text Depending On The ID Of The Item
I have a repeater control that loads my data ok. I have a hyper link field in my repeater control. It looks like this:

[Code]....

Posted: Feb 25, 2010 10:34 PM

View 3 Replies!   View Related
Forms Data Controls :: GridViewRow Change After Postback?
I add gridview row dynamically like that; After page postback some gridrow change and not visible.

protected void grv_RowDataBound(object sender, GridViewRowEventArgs e)
{
GridViewRow gvr = e.Row;[code]....

Posted: Aug 25, 2010 07:38 PM

View 4 Replies!   View Related
Forms Data Controls :: Change Repeater Control Class Depends On Number Of Rows It Contain?
How can i change repeater control class depends on number of rows it contain?

Posted: Feb 10, 2011 08:45 AM

View 2 Replies!   View Related
Forms Data Controls :: Change Stored Procedure When Dropdown Item Is Selected And Show Repeater?
I have one repeater on page which has his own sql data source. I've placed 2 dropdown lists on the page. The repeater has jQuery DataTable plugin. With 2 dropdownlist I wish to change the sql stored procedures so when each will be selected the data in repeater will change. When user select the first there will be only data (users) according to selected item and in the second the same. I wrote 2 simple functions for changing stored procedure of repeater and rebiding it. Everything works but when I try the second one and then the first I always get warning about error "Procedure or function .... has too many arguments specified".

I think that when I select the first one the second function is still called although I don't call it.

[Code]....

Posted: Jul 09, 2010 02:59 PM

View 8 Replies!   View Related
Forms Data Controls :: Avoid Postback While Change Page No Of Datalist?
I am using datalist and used custom paging for that but on page index changed there is full postback..because i am sending the values through querystring just have a look to this link

[URL]

i want to remove this postback...

Posted: Mar 04, 2010 08:16 AM

View 9 Replies!   View Related
Forms Data Controls :: Gridview ItemTemplate Values Change On Postback?
I have agridview with a dropdownlist in one totheheaders. So on the onselect event of the dropdownlist I want to change the assigned values ofitemTemplate values inside one of the columns.

Posted: Jan 24, 2011 08:03 PM

View 1 Replies!   View Related
Forms Data Controls :: Change Dynamic Control Values On Postback (OnBlur)?
I am adding few textboxs on asp.net tablecontrol. I need to changetext box valueson post back event.

There is one text box on the form and onblur its calling post back event and adding new text boxes in table and setting their text values from array. But on post back event, table textboxs are not showing new values. They are showing just old values. It works fine ifpost back event is called on button click and text boxes show changed values.

[Code]....

Posted: Oct 06, 2009 12:51 PM

View 5 Replies!   View Related
Web Forms :: Repeater Losing Data On Postback
Private Sub UpdateOffensiveStats()

Repeater losing data on postback

Posted: Jul 03, 2010 03:37 AM

View 2 Replies!   View Related
Forms Data Controls :: Access A Control Inside A Repeater Control And Change Its Properties?
I need to access a control inside a repeater and change its properties. To enable it or not. I got an erorr message Object reference not set to an instance of an object. Here is my code inside a method. protected void

rptCAP_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
LinkButton lnDel = (LinkButton)rptCap.FindControl("lnkDelete");
lnkDel.Enabled = false; //<<<<< this is where the error occur
}

The name of the repeater control is id="rptCAP"

Posted: Nov 26, 2010 04:56 PM

View 3 Replies!   View Related
Populate Literal With Checkboxlist Value Without Postback?
I have a checkboxlist that I databind with values. Each time a user selects one of the values, I want to have that value added to a literal to show them what they have alreeady selected. If I use a postback, it works fine, but the checkboxlist returns to the top of the list every time, rather than staying where it was last checked.

Right now on the postback I populate the literal with the selections.

What do I need to do in order to get the checkboxlist to stay where it left off and still get the value into the literal? Is there something within the checkboxlist itself?

Posted: Sep 24th, 2009, 02:31 PM

View 10 Replies!   View Related
State Management :: Literal Losing Value On PostBack?
Never had this happenbefore. I just upgraded my site from 3.5 to 4.0. Here's the scenario:

1.) I have a literal ona webform, in anUpdatePanel.

2.) On PostBack, the Literal's "Text" property loses it's value. The ViewState is enabled throughout the page. Further, I changed the Literal to a label and it also has this problem. The TextBox's appear to keep their values.

3.) If I remove all of the Ajax controls(which currently is just the UpdatePanel and the ScriptManager) then the Literal control keeps it's value through PostBacks.

4.) There is no client side JavaScript where I'm manually changing the values of these controls. They are only editted in the server side events.

I have read that setting the AutomaticDataBind property in the web.config could remedy this but I can't find any documentation on it and I don't know where to put it in the web.config to even try it.

Posted: Dec 13, 2010 05:51 PM

View 7 Replies!   View Related
Forms Data Controls :: Cannot Set A Literal Text
I have a literal on page. when user click on a button (OnClick), I set Literal1.Text ="someText"

the page refreshes but the literal not set.

I verify EnableViewstate is true.

Posted: Mar 12, 2011 05:03 PM

View 1 Replies!   View Related
Forms Data Controls :: Hiding Table/panel In A Repeater If No Data Repeater In A Nested Accordion?
Description of issue shown after code listing

Asp code:

[code]....

The above does not throw any compile errors but it does not work correctly.

accParent produces 6 headings, the first with 3 children, the second with 3 children, the other four each with one child.

The accordion hides the Times and Locations (showme panel) from the first accChild item in the first heading, which is incorrect as there are records to display, but does not hide the panel from the accChild of the last two headings, where there isn't any data to display.

Posted: Nov 10, 2009 12:57 PM

View 7 Replies!   View Related
Forms Data Controls :: Dropdownlist In Repeater And Datasource Doesn't Match To The Data Which Bind To The Repeater
i have dropdownlist in the repeater and the datasource does not match to the data which bind to the repeater... the error msg: "dropdownlist has a SelectedValue which is invalid because it does not exist in the list of items"

Posted: Nov 19, 2009 06:34 AM

View 9 Replies!   View Related
Forms Data Controls :: How To Print A Message In Child Repeater If No Data Corresponding To Parent Repeater
protected void Page_Load(object sender, EventArgs e)

[Code]....

Posted: May 12, 2010 09:51 AM

View 2 Replies!   View Related
Forms Data Controls :: Inner Repeater Is Not Getting The Proper Search Param From The Parent Repeater?
THE PROBLEM IS THAT THE DATES FOR THE FIRST EVENT IS THE SAME DATES AS FOR THE 2ND EVENT. IF YOU NOTICE THE SQL QUERY KEEPS SAYING e.WebCastID =2 instead of it being 1 and then 2.

[Code]....

[Code]....

Here is the output:
DB2
Oct 15 09 - 10:00 AM select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 2 ORDER BY e.EventDate ASC Register Now
Oct 15 09 - 11:00 AM select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 2 ORDER BY e.EventDate ASC Register Now
boo: select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 1 ORDER BY e.EventDate ASC
Real Time
Oct 15 09 - 10:00 AM select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 2 ORDER BY e.EventDate ASC Register Now
Oct 15 09 - 11:00 AM select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 2 ORDER BY e.EventDate ASC Register Now
boo: select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 2 ORDER BY e.EventDate ASC
THE PROBLEM IS THAT THE DATES FOR THE FIRST EVENT IS THE SAME DATES AS FOR THE 2ND EVENT. IF YOU NOTICE THE SQL QUERY
KEEPS SAYING e.WebCastID =2 instead of it being 1 and then 2.
select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 1 ORDER BY e.EventDate ASC
1 1 2009-09-30 10:00:00.000 CDT US 1
2 1 2009-10-01 11:00:00.000 CET EU 1
select * from tblWebcastEvents e WHERE e.Active=1 AND e.WebCastID = 2 ORDER BY e.EventDate ASC
3 2 2009-10-15 10:00:00.000 CDT US 1
4 2 2009-10-15 11:00:00.000 CET EU 1

Do you know why it is not giving it the proper WebCastID ?

Posted: Sep 29, 2009 07:37 AM

View 1 Replies!   View Related
Forms Data Controls :: Repeater Inside A Repeater (dataBound) Code Behind?
got an example of a repeater inside a repeater (dataBound) code behind?

Posted: Jan 31, 2010 07:36 AM

View 3 Replies!   View Related
Forms Data Controls :: ImageButton Inside A Repeater That Is In Another Repeater & Events?
I have a user control that displays a shopping cart in an ecommerce application.

The main cart display is a repeater that renders as a html table. In one of those table columns, there is another repeater to display people associated with the products int he cart (it's a repeater in case there is a line item >1 with multiple people).

I've added an ImageButton that I want to use to change the person associated with the item. At first, when I'd click on it I was getting this error:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

So as an experiment I disabled EventValidation on the page (not the control it's self) and now I do not get an error, but I also do not ever hit the breakpoint I set in the innermost repeater's ItemCommand event.

So I wonder how I might do this without disabling EventValidation, because this control will show up on multiple pages and we don't want to edit them all. Also, I'll need to know not only the repeater containing the control's row that the event came from but also the row index of the repeater containg this one. Is this possible?

Posted: Jan 18, 2010 10:22 PM

View 3 Replies!   View Related
Forms Data Controls :: Repeater Paging - Retrieve Hyperlink Variable Inside Repeater?
I have repeater in which I have 2 hyperlink in the footer of the repeater and I want that the hyperlink can navigate from the page_load

Posted: Jul 12, 2010 12:35 PM

View 2 Replies!   View Related
C# - Repeater Within Repeater (ajax Based Web App) - Cannot Use Any Postback Methods
For the solution, I cannot use any postback methods, because this is all working through ajax. The solution need to be implemented in the asp.net code. I have a List<WebPage> that contains a list of Links (List<Link>) and I need for all the links to bind repetitive information such as page title, id, url. Here is my current repeater.

<div id="result">
<asp:Repeater runat="server" id="results">
<Itemtemplate>
<asp:Repeater runat="server" datasource='<%# Eval("Links") %>'>
<Itemtemplate>
<tr class="gradeX odd">
<td><%# Eval("Id") %></td> //property of WebPage (part of results repeater)
<td><%# Eval("Title") %></td> //property of WebPage (part of results repeater)
<td><%# Eval("Url") %></td> //property of WebPage (part of results repeater)
<td><%# Eval("URL") %></td>//Property of Link
<td><%# Eval("URLType") %></td> //Property of Link
<td><%# Eval("URLState") %></td> //Property of Link
</tr>
</Itemtemplate>
</asp:Repeater>
</Itemtemplate>
</asp:Repeater>
</div>

of course this doesnt work, how can i do this?

Posted: Jun 23 10 at 15:17

View 2 Replies!   View Related
How To Persist The Data From A Repeater After Postback
I have a repeater that displays financial data and prices for various stocks.

On this page, I also have an "export" button that needs to take the data ~on the screen~ and convert it into a CSV for the user.

The problem is, after I databind my list of "Stock" entities:

List<Stock> stocks = GetStocks()
rptStockList.DataSource = stocks;
rptStockList.DataBind();

The data is not persisted on postback.

Also, the data on this page is constantly being updated via an UpdatePanel and a Timer control (being re-databound each time). Every 30 seconds the prices displayed for the various stocks in the repeater control change.

Now, I have a linkbutton that has a click event method in the code-behind that is supposed to export the ~data on the screen~ for the user. I need to grab the current values for the list of stocks last databound to the repeater. I can't simply go grab the latest values from the database because those will have been changed in the time between the last refresh.

protected void lbtnExportStocks_Click(object sender, EventArgs e)
{
// No longer have the stock data used in the repeater control
ExportStocksToExcel();
}

I know that ASP.NET doesn't persist the datasource for the repeater on post-back but I need to still be able to either re-construct this list of Stock entities so I can send them the CSV or I need persist it in some way.

I don't want to do anything that is too heavy handed in terms of performance because during certain days of the week this application can have some heavy usage.

What is the proper solution to this type of situation? Should I iterate through the Repeater's "Items" collection and reconstruct the Stock entities?

Posted: Jul 1 10 at 18:17

View 4 Replies!   View Related
Forms Data Controls :: Binding Parent Repeater Item Index In Child Repeater Control?
I want to bind parent repeater item index in child repeater control using inline code not code behind side.

For example

[Code]....

Posted: Jun 17, 2010 07:30 AM

View 2 Replies!   View Related
Forms Data Controls :: Hiding A Repeater Div Using A Link Outside The Repeater?
I'm so confused I wasn't even sure what to make the title so that it would make sense.

Here is what I have:

[code]...

I have links at the top of the page that are the letters A-Z. What I want to do is click on one of the letters, then show only the div IDs that start with that letter. I can't figure out how to do this since I'm dynamically creating the ID names. I had it set up nicely with Javascript and CSS, but the function call was inside the repeater. The layout is changed now, and I don't understand how to make the div ID available outside the repeater.

Posted: May 25, 2010 07:29 PM

View 2 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved