473,799 Members | 3,161 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calling Repeater DataItems

I have tried to call the Repeater´s item´s DataItem example from Page´s
functions. I have put to the Repeater ID and Name got from the database.

I have tried following:
CType(Repeater( index).DataItem , DataRowView)("I D")

DataBinder.Eval (Repeater(index ).DataItem, "ID")

First get me "NullReferenceE xception" and second zero length string.
Nov 18 '05 #1
5 4304
qwerty wrote:
I have tried to call the Repeater´s item´s DataItem example from Page´s
functions. I have put to the Repeater ID and Name got from the database.

I have tried following:
CType(Repeater( index).DataItem , DataRowView)("I D")

DataBinder.Eval (Repeater(index ).DataItem, "ID")

First get me "NullReferenceE xception" and second zero length string.

Any help?
Nov 18 '05 #2
Hi qwerty:

Does this happen after you've set a DataSource and called DataBind?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Oct 2004 21:07:51 +0300, qwerty <x@y.zzz> wrote:
qwerty wrote:
I have tried to call the Repeater´s item´s DataItem example from Page´s
functions. I have put to the Repeater ID and Name got from the database.

I have tried following:
CType(Repeater( index).DataItem , DataRowView)("I D")

DataBinder.Eval (Repeater(index ).DataItem, "ID")

First get me "NullReferenceE xception" and second zero length string.

Any help?


Nov 18 '05 #3
Scott Allen wrote:
Hi qwerty:

Does this happen after you've set a DataSource and called DataBind? Yes. Repeater.Count gets me the number of items so they exist there.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Oct 2004 21:07:51 +0300, qwerty <x@y.zzz> wrote:

qwerty wrote:
I have tried to call the Repeater´s item´s DataItem example from Page´s
functions. I have put to the Repeater ID and Name got from the database.

I have tried following:
CType(Repeat er(index).DataI tem, DataRowView)("I D")

DataBinder.E val(Repeater(in dex).DataItem, "ID")

First get me "NullReferenceE xception" and second zero length string.


Any help?


Nov 18 '05 #4
In doing some testing it appears to me the DataItem property is only
valid during the act of data binding. If you add an event handler for
the ItemDataBound event you can dig out the DataRowView, otherwise I
think you'll have to dig into the control hierarchy of the
RepeaterItem to find the string put in place during binding.

Make any sense? Does that help your solution?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Fri, 22 Oct 2004 17:09:56 +0300, qwerty <x@y.zzz> wrote:
Scott Allen wrote:
Hi qwerty:

Does this happen after you've set a DataSource and called DataBind?

Yes. Repeater.Count gets me the number of items so they exist there.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Thu, 21 Oct 2004 21:07:51 +0300, qwerty <x@y.zzz> wrote:

qwerty wrote:

I have tried to call the Repeater´s item´s DataItem example from Page´s
functions . I have put to the Repeater ID and Name got from the database.

I have tried following:
CType(Repea ter(index).Data Item, DataRowView)("I D")

DataBinder. Eval(Repeater(i ndex).DataItem, "ID")

First get me "NullReferenceE xception" and second zero length string.

Any help?



Nov 18 '05 #5
Scott Allen wrote:
In doing some testing it appears to me the DataItem property is only
valid during the act of data binding. If you add an event handler for
the ItemDataBound event you can dig out the DataRowView, otherwise I
think you'll have to dig into the control hierarchy of the
RepeaterItem to find the string put in place during binding.

Make any sense? Does that help your solution?

Yes, thanks for testing. In my mind didn't came trying events.

I can do what i wanted with ItemDataBound-event using condition
statement to define what item I want to handle.

As a last alternative I would used html controls tag´s attributes.
Nov 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1684
by: Andrew Banks | last post by:
I've got the following code as part of a C# web form but am having problems calling a command. I create a dataset and put some data on the screen. This works fine. (relevant sample below) foreach (DataRow row in ds.Tables.Rows) { detailsbtn = new LinkButton(); //Assign a unique ID to the details control detailsbtn.ID = "details" + row.ToString().Replace("-", String.Empty);
0
5406
by: Ed Allan | last post by:
http://ejaconsulting.com/nestedrepeater/NestedRepeater.txt >-----Original Message----- >Doh! The HTML has all been rendered . . . > >Right click on this link and select 'Save target as ..' >to get the code in a text file. > >Thanks - Ed >
9
10156
by: Ric | last post by:
im new to asp.net. please help if u can. is it possible to refer to a control(ie lable, placeholder, textbox) that is inside a repeater object from a code behind file? when i place the control object outside of the repeater, i can refer to it from the code behind file. when i place the control object inside the repeater, i get a 'need to instanciate the control object' error. if i declare the control object inside the control behind file,...
0
1543
by: Kent P. Iler | last post by:
Hi, I have a data repeater that is returning a list of events. One of the things I want to do is give the user a way to edit or delete an event. My plan was to use an Imagebutton that would invoke a codebehind function that would either edit or delete the item. My problem is I need to pass the event_id as a parameter to each of these functions so I know what event to edit/delete. The error code is complaining about the way I'm trying...
8
2918
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server"> <HeaderTemplate><table> </HeaderTemplate> <ItemTemplate>
2
1915
by: mark | last post by:
(not sure if this is the correct group) My problem is I need to have a "nested" repeater. I have an array which I load into a hashtable - that part works great. I can setup the second repeater to work just fine, as long as it's not nested within the first repeater. If it is nested within the first repeater, I don't get any data. If I put the second repeater as a separate repeater, not nested, it works fine. Here's my actual code,...
1
2830
by: Bobstar | last post by:
Hello. Trying to bind data from a Repeater and ITemplate, but everytime I bind the senders dataitem is null. I've an: public void InstantiateIn(Control container) { Table t = new Table(); TableRow tr = new TableRow(); TableCell tc = new TableCell();
4
3481
by: sck10 | last post by:
Hello, I am trying to call a function (c#) from the repeater tool and I am not sure if I am calling the function correctly (since I am not getting the results that I want). Using <asp:Literal id="ltrNewLine" text='<%# vbBlankRowMenu("strMenuType") %>' runat="server" />
0
4097
by: uncensored | last post by:
Hello everyone, I'm fairly new at .Net and I have a repeater inside a repeater problem. I will attach my code to this message but basically what I am able to tell when I run my page it tells me that my second repeater has the following error, System.NullReferenceException: Object reference not set to an instance of an object. When I put a watch on I can see my second repeater is not being created because it is equal to "Nothing". I can...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9072
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.