473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

problem accessing row in repeater!

Hey

asp.net 2.0

I have a Repeater control consisting of linkbuttons on my webpage. when a
linkbutton is clicked I need to get the info about the linkbutton clicked
and put that info in a session variable so it can be accessed from another
webpage in the same application (the webpage opened by the linkbutton)

I tryed using this script, but it gives me compile error: wrong parameter
protected void rptOnline_OnItemCommand(RepeaterCommandEventArgs e)
{
}

<asp:Repeater ID="rptOnline" runat="server"
OnItemCommand="rptOnline_ItemDataBound" >

But I get error telling that this
"rptOnline_OnItemCommand(RepeaterCommandEventA rgs e)" method don't contain
the correct parameters, but I copied it from the documentation....

Maybe there is a better way to do this? I've used a PostBackValue on another
project. But I don't know how to use PostBackValue to this one, because I
haven't found the PostBackValue property in the LinkButton class...

Any suggestions?

Best Regards!

Jeff
Oct 13 '06 #1
2 1526
dont use that!

<asp:repeater ...

<content>
<asp:linkButton id="myLnkButton" Text='<%# Eval("myName") %>'
CommandName='<%# Eval("myName") %>' onCommand="submitLink()" />
</content>

</asp:repeater>
Protected Sub submitLink(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs)
Dim linkName as STring = e.CommandName.ToString
' do whatever you want with the link name now :-)
End Sub
--

Bruno Alexandre
København, Danmark

"a Portuguese in Denmark"

Blog. http://balexandre.blogspot.com/
Photos. http://www.flickr.com/photos/balexandre/
"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hey

asp.net 2.0

I have a Repeater control consisting of linkbuttons on my webpage. when a
linkbutton is clicked I need to get the info about the linkbutton clicked
and put that info in a session variable so it can be accessed from another
webpage in the same application (the webpage opened by the linkbutton)

I tryed using this script, but it gives me compile error: wrong parameter
protected void rptOnline_OnItemCommand(RepeaterCommandEventArgs e)
{
}

<asp:Repeater ID="rptOnline" runat="server"
OnItemCommand="rptOnline_ItemDataBound" >

But I get error telling that this
"rptOnline_OnItemCommand(RepeaterCommandEventA rgs e)" method don't contain
the correct parameters, but I copied it from the documentation....

Maybe there is a better way to do this? I've used a PostBackValue on
another project. But I don't know how to use PostBackValue to this one,
because I haven't found the PostBackValue property in the LinkButton
class...

Any suggestions?

Best Regards!

Jeff

Oct 13 '06 #2
you are confusing the OnItemComand event delegate with the OnItemCommand
method. you want to use the delegate (event handler) version. the method
signature you used is when your code inherit from the repeater and want to
change the behavior.

to catch the event use::

protected void rptOnline_OnItemCommand(Object sender,
RepeaterCommandEventArgs e)
{
}

-- bruce (sqlwork.com)

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
Hey

asp.net 2.0

I have a Repeater control consisting of linkbuttons on my webpage. when a
linkbutton is clicked I need to get the info about the linkbutton clicked
and put that info in a session variable so it can be accessed from another
webpage in the same application (the webpage opened by the linkbutton)

I tryed using this script, but it gives me compile error: wrong parameter
protected void rptOnline_OnItemCommand(RepeaterCommandEventArgs e)
{
}

<asp:Repeater ID="rptOnline" runat="server"
OnItemCommand="rptOnline_ItemDataBound" >

But I get error telling that this
"rptOnline_OnItemCommand(RepeaterCommandEventA rgs e)" method don't contain
the correct parameters, but I copied it from the documentation....

Maybe there is a better way to do this? I've used a PostBackValue on
another project. But I don't know how to use PostBackValue to this one,
because I haven't found the PostBackValue property in the LinkButton
class...

Any suggestions?

Best Regards!

Jeff

Oct 13 '06 #3

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

Similar topics

0
by: Jeff | last post by:
After I bind the repeater control in the form_load event, it builds multiple lines based on the number of rows in the dataset. In the repeater control, I have a textbox and a dropdown list box. ...
9
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...
1
by: jeremystein | last post by:
With nested repeaters, how can I access the outer repeater's DataItem from the inner repeater? Here's a snippet from my aspx: <asp:repeater id="OuterRepeater" runat="server"...
4
by: Nitinkcv | last post by:
Hi all, Currently im using 1.1 framework. Here i have a textbox which is inside a repeater. Now the functionality of this textbox is to take the input from the usr regarding the available time...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.