Hi...
you can do this in the code behind too... and I choose that option always...
something like that:
1. Declare de EventHandler for the Repeater or Grid or wathever in the
OnInit Method:
rptSomething.It emDataBound += new
RepeaterItemEve ntHandler(OnRpt SomethingDataBo und);
// must work also with datagrids, just find the right EventHandler.
2. Make the method that handles this event and search for the control, the
data item, and put the properties that you want.
protected void OnRptSomethingD ataBound (object sender,
RepeaterItemEve ntArgs e)
{
if (args.Item.Item Type == ListItemType.It em || args.Item.ItemT ype ==
ListItemType.Al ternatingItem)
{
//Find the DataItem
SomeObject object = e.Item.DataItem as SomeObject;
//Validate
if (object != null)
{
//Search for the hyperlink control
HyperLink link = (HyperLink)e.It em.FindControl( "HyperLink2 ");
//Validate
if (link != null)
{
link.Text = object.TeamOper ation.ToString( );
link.NavigateUr l =
string.Format(" ../Dash_Board/DashBoard.aspx? Name={0}",objec t.TeamOperation );
}
}
}
}
I hope this helps to you
Javier Romero A, MCAD
http://javier-romero.com
Temperamental .NET Developer
"rcoco" <nc******@yahoo .cawrote in message
news:11******** *************@y 80g2000hsf.goog legroups.com...
Hi all,
I have this big problem with hyperlinks I would appriciate any help
please.
My web site has two datagrids on the same page. And one has a list of
names of the users which are in form of hyperlinks. The second
datagrid is for inserting data, and when a user inserts data I used
'Windows Authentication' for names in one column called Name.
Now this is how it's supposed to work: When any user want to see data
about a particular user it's a matter of selecting his name and the
data about the selected individual should be the only ones to be
shown.
I got some examples on Google but they all seem not to be working.
Tha's why I'm here for help please!
Here is where I've reached:
<ItemTemplate<a sp:HyperLink id="HyperLink2 " runat="server"
Text='<%#DataBi nder.Eval(Conta iner.DataItem," TeamOperation") %>'
NavigateUrl='<% #"../Dash_Board/DashBoard.aspx?
Name="+DataBind er.Eval(Contain er.DataItem,"Te amOperation")%> '>H
yperLink
</asp:HyperLink>
</ItemTemplate>
I really appriciate all the help.
Thanks.