I Used Repeater inside the Datalist now i want to get value of Repeater (textbox control)

I Used Repeater inside the Datalist now i want to get value of Repeater (textbox control) on button click.

Button is inside the datalist, Outside repeater.

 Depending on datalist "groupId" Repeater is loding and from the repeater i want the value of "Textqty".

This is my code

<asp:DataList ID="DataList1" runat="server" class="SubContentSearch" DataSourceID="ObjectDataSource1" Width="496px" DataKeyField="id">

<ItemTemplate>

<asp:Label ID="groupIdLabel" runat="server" Text='<%# Eval("groupId") %>' Visible="False"></asp:Label>&nbsp;<br />

<asp:HyperLink ID="HyperLink1" NavigateUrl='<%# "ProductGroup.aspx?ID=" & Eval("groupId") & "&n=View Product Group-"& Eval("Code") & "&lang=" & Session("Language") %>' Text='<%# Eval("GroupName") %>' runat="server"></asp:HyperLink><br />

<br />

<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl='<%# Eval("ThumbNailPath") %>' PostBackUrl='<%# "ProductGroup.aspx?ID=" & Eval("groupId") & "&n=View Product Group-"& Eval("Code") & "&lang=" & Session("Language") %>' />

<asp:Label ID="ShortDescriptionENLabel" runat="server" Text='<%# Eval("ShortDescription") %>'></asp:Label><br />

 

<br />

<asp:Repeater ID="Repeater1" runat="server" DataSourceID="ObjectDataSource12">

<HeaderTemplate>

<table>

</HeaderTemplate>

<ItemTemplate>

<tr>

<td>

<asp:ImageButton ID="ImageButton21" runat="server" ImageUrl='<%# Eval("ProductThumbNailPath") %>' PostBackUrl='<%# "ProductGroup.aspx?ID=" & eval("ID") & "&n=View Product Group-"& Eval("ProductCode") & "&lang=" & Session("Language") %>' />

</td>

<td>

&nbsp;&nbsp;<asp:HyperLink ID="HyperLink11" runat="server" NavigateUrl='<%# "ProductGroup.aspx?ID=" & eval("ID") & "&n=View Product Group-"& Eval("ProductCode") & "&lang=" & Session("Language") %>' Text='<%# Eval("ProductName") %>'></asp:HyperLink>

</td>

<td>

&nbsp;&nbsp;$<asp:Label ID="lbl1" runat="server" Text='<%# Eval("Price", "{0:##0.00}") %>'></asp:Label>

</td>

<td>

&nbsp;&nbsp;<asp:TextBox ID="Textqty" Width="20px" Text='<%# Eval("Quantity") %>' runat="server"></asp:TextBox>

</td>

</tr>

 

</ItemTemplate>

<FooterTemplate>

</table>

</FooterTemplate>

</asp:Repeater>

<asp:ObjectDataSource ID="ObjectDataSource12" runat="server" OldValuesParameterFormatString="original_{0}"

SelectMethod="GetData" TypeName="dcc_eStoreTableAdapters.dcc_GeteStoreProductImagelistTableAdapter">

<SelectParameters>

<asp:ControlParameter ControlID="groupIdLabel" DefaultValue="" Name="Id" PropertyName="Text"

Type="Int32" />

<asp:SessionParameter Name="SCustomer" SessionField="SCustomer" Type="String" />

<asp:SessionParameter Name="lang" SessionField="Language" Type="String" />

</SelectParameters>

</asp:ObjectDataSource>

 

<asp:Button id="btnAddtocart" runat="server" OnClick="btnAddToCart_Click" CssClass="stdButton" Text="Add To Cart"></asp:Button>

<br />

<br />

&nbsp;<br />

&nbsp;<br />

<br />

 

</ItemTemplate>

</asp:DataList><asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"

SelectMethod="GetData" TypeName="dcc_eStoreTableAdapters.dcc_GeteStoreProductGroupDisListTableAdapter">

<SelectParameters>

<asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />

<asp:QueryStringParameter DefaultValue="0" Name="PageIndex" QueryStringField="pageIndex"

Type="Int32" />

<asp:Parameter DefaultValue="5" Name="NumRows" Type="Int32" />

<asp:SessionParameter Name="lang" SessionField="Language" Type="String" />

<asp:Parameter Direction="InputOutput" Name="TotCount" Type="Object" DefaultValue="0" />

</SelectParameters>

</asp:ObjectDataSource>

 

AND

VB.code

 

Public Sub btnAddtocart_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim prodLabID As Integer

Dim prodLabIDLabel As Label

Dim rep As Repeater

Dim IDLabel As Label

Dim datalistItemProd As DataListItem

Dim RepeaterItemProd As DataListItemFor Each datalistItemProd In DataList1.Items

prodLabID = 0

prodLabIDLabel = datalistItemProd.FindControl("groupIdLabel")

rep = datalistItemProd.FindControl("Repeater1")

Response.Write(rep.ID)

For Each RepeaterItemProd In rep.ItemsIDLabel = rep.FindControl("lbl1")

Response.Write(IDLabel)

Next

Next

End Sub

End Sub

 

i used this code but its not working.

 

Pl. guide me how to get data from the textbox.

 

Thanks

 

 

 

0
monalpat
3/10/2008 4:12:38 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

1 Replies
1072 Views

Similar Articles

[PageSpeed] 53

Grab the parent control cast it hen grab the dataItem from your casted object.


Matthew M. Osborn
http://blog.osbornm.com
http://weblogs.asp.net/asptest
"Change the world or go home."
0
osbornm
3/10/2008 4:51:34 PM
Reply:

Similar Artilces:

how to add numbers in a any data control (Datagrid,DataList,Repeater) having textbox controls using Javascript?
hi,       i have a data control either(DataList,Grid, Repeater) having 3 textboxes row wise and column wise. I need to add the numbers inside the textbox using javascript in onclient Change or blur event .Anybody know how to do this ? pls give sample code.  javascript:var mygrid = document.getElementById('<%= MyGrid.ClientID %>'); var arrinputs = mygrid.getElementsByTagName("input"); for(var i = 0; i < arrinputs.length; i++) { if(arrinputs[i].type == "text") { // you have a text box now enter in value ...

using javascript getting value from textbox when edit button is clicked and both controls are present in gridview control
Hi All using javascript I want to get value  from textbox when edit button is clicked and both controls that is texbox and button are present in gridview control .Alok Hi aloksinha83, Please see this post: http://forums.asp.net/t/1069245.aspx Thanks,Qin Dian TangMicrosoft Online Community SupportPlease remember to mark the replies as answers if they help and unmark them if they provide no help....

Using Repeater control within DataList control
I have two database tables categories and sub_categories. I'm using a DataList to display the categories in two columns, I want to be able to show two sub_categories under each category. I have the following code and I cannot work out how to do this. Please note, I've tried <asp:ControlParameter, this doesn't work as I'm using MySQL, so the solution has to be any way other than this. The code is below:<asp:DataList ID="dltCats" runat="server" DataSourceID="srcCats" RepeatColumns="2" Width=...

Repeater control in another repeater control
Hi, I want Repeater control in another repeater control but it is not working Code : <asp:Repeater ID=CourseMaster Runat=server > <ItemTemplate> <table border=0 cellpadding=0 cellspacing=0 style="font-family:tahoma;font-size:12"> <tr> <td >&nbsp;<b</b></td> </tr> <tr> <td> <asp:repeater ID="CourseDetails" Runat=server> <ItemTemplate> <tab...

Get control in repeater control
Dear all, I want to use HtmlControls.HtmlTableCell in repeater control but i cant not access it,  in my table in Repeater Control,  i have 2 "td" which on page_load, i want to show only 1 of them depend on condition given. But i cant do it. This is my code : <asp:repeater id="repeaterViewNew" runat="server">                   <HeaderTemplate>                      <table width="100%" cellpadding="1" cellspacing="1">   &...

reference control's value when I used a repeater to create controls???
Hi I am using a "repeater" to dynamicly create controls on my aspx page. I pull server names out of a table and display them on the web page as labels--virtically. And after each lable, I have a listbox and a textbox follow it. On the web form page, it looks like this---if for example i have 3 servers: serverName1(label) status(listbox) comments(textbox) serverName2(label) status(listbox) comments(textbox) serverName3(label) status(listbox) comments(textbox) What I want to do is that after user pick the status for each server name and add comments for it...

Can't get property from a User Control inside a Repeater control
I have a public property inside my usercontrol which I set inside the Repeater.ItemDataBound event as follows:<code>If blnFirstTime Then            Dim lblstrDate As Label = DirectCast(e.Item.FindControl("lblPressReleaseDate"), Label)            blnFirstTime = False            strDate = lblstrDate.Text        End If</code>After the user control finishes databinding, I want to take th...

How do I get get values of controls inside datalist?
How do I get values of controls inside datalist?   For example, if I have a label inside header template or item template or footer template? Is there anyway to change property of label or any other controls inside those template as well? I would really appreciate if anybody can just post a sample code or a helpful link about datalist? Would really like to know more about the events fired for datalist, itembound, itemcreating etc?   hey there,I used this page to work out how to use datalists http://www.eggheadcafe.com/tutorials/aspnet/d89d1d96-03f1-4784-bbb2-a3db1af...

How to access a control inside a Repeater control?
 <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate><ul></HeaderTemplate> <ItemTemplate><li><asp:Image id="Image1" runat="server" /> </li></ItemTemplate> <FooterTemplate></ul></FooterTemplate> </asp:Repeater>   Protected Sub Repeater1_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles Repeater1.ItemDataBound Dim Image1 As WebControls.Image Image1 = CType(e.Item.FindCo...

Custom Control Inside a Repeater Control
I have a repeater control on the main page and would like to load a custom user control inside the repeater control. The custom user control is basically a GridView. A few values will need to be passed to the custom user control to define the where clause for the GridView DataSet. Can anyone provide me with or point me to a simple example of this functionality?Allan Horwitz Nevermind, I just put a GridView inside the Repeater Control tags and used the OnItemDataBound event to get the variables.Allan Horwitz...

nesting a datalist control in a repeater control
Hi I need to display a report in the following format: Heading1 item one for heading1 item two for heading1 item three for heading1 ..... Heading2 item one for heading2 item two for heading2 item three for heading2 .... Heading3 item one for heading3 item two for heading3 item three for heading3 ..... I have tried use a repeater control for displaying the Headings and a datalist control to display the items for each heading. The problem is that I couldn't nest a datalist control between the repeater's ItemTemplate tag. Any help for nesting A...

Calendar Control inside Repeater, Handling Child control events in parent Data Control
Hi all,I've been researching a problem i have for a couple of days now and i'm still not sure how to even start to handle it.I'm essentially trying to build a page that will display custom form fields/controls for individual items/rows inside a repeater.I've got a fairly complex calendar i need to have working inside each individual row of the Repeater. The calendar is set up to fire the following events: OnDayRender="Calendar2_DayRender" OnSelectionChanged="Calendar2_SelectionChanged" OnVisibleMonthChanged="Calendar2_VisibleMonthChanged"My first question is how do i go about handling these...

Get the label value of a parent Repeatercontrol from inside the child Repeater Control OnItemDataBound
Hi everyone,   I have repeater inside a repeater control. I have a label inside the parent repeater control for which the datasource is different from the child repeater control. So, I am trying to access the label value of a paren repeater control from the child OnItemDatabound. Can any one please help me with this.  Thanks in advance.  Here is a quick example for you <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default2.aspx.cs" Inherits="WebApplication2.Default2" %><!DOCTYPE html PUBLIC "-//W3C//D...

Repeat a Repeater Control?
I have a stored procedure that returns one big table with Employee names, phone numbers, and their state.  I need to generate different tables (or GridViews, or Repeaters... not sure) for each state.  Here's an example: My table hasID     Employee_Name    Phone_Number     State I need my web form to look like this: CaliforniaID    Employee_Name   Phone_NumberID    Employee_Name   Phone_NumberID    Employee_Name   Phone_Num...

Web resources about - I Used Repeater inside the Datalist now i want to get value of Repeater (textbox control) - asp.net.presentation-controls

Repeaters - Wikipedia, the free encyclopedia
Kyle Halsted, Sonia Logan, and Michael Weeks are inmates at a rehabilitation facility. Bob Simpson, the administrator, tasks them with apologizing ...

Animal Repeater Memory Game HD Free Lite - for iPad for iPad on the iTunes App Store
Get Animal Repeater Memory Game HD Free Lite - for iPad on the App Store. See screenshots and ratings, and read customer reviews.

Consumers warned to beware of illegal mobile phone repeaters
Use of devices sold online as legitimate solution is in fact dangerous and can land you in jail, regulator warns.

Grim repeater: HIV on the rise
CANDLES flicker in the chilly night air as Jesse Hooper appears on the giant cinema screen overlooking Melbourne&#8217;s Federation Square. He&#8217;s ...

Telstra suspects underbelly of illegal repeaters
'Tens' busted each year. Telstra engineers suspect a "vast" undercurrent of illegal repeaters are causing issues for the carrier's Next G mobile ...

Hands on: Cel-Fi mobile repeater
If your home is a mobile blackspot then a Cel-Fi mobile repeater might help you stay connected.

Amped Wireless R20000G, SR20000G, and UA2000: Routers, Repeaters, and Adapters
... and throughput when pointed at your wireless router/access point. Rounding out the review, Amped sent a third product, their SR20000G repeater, ...

Photon heralds entanglement in new quantum repeater
... For ordinary electrical wires (such those used for ethernet), signals can travel long distances because they're boosted by means of repeaters ...

Celebrity Rehab Repeaters
Kate Middleton Bikini Photos 50 Shades of Grey Hollywood Couples Red Carpet The Kardashians Best Dressed Hot Bodies Celebrity Kids News Sightings ...

Computer networking: wireless networks (wifi), routers, repeaters & more - CNET Reviews
Computer networking reviews and ratings, video reviews, user opinions, most popular network hardware, wireless network buying guides, prices, ...

Resources last updated: 12/12/2015 1:45:30 AM