473,394 Members | 1,722 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,394 software developers and data experts.

Problem with hyperlinks

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<asp:HyperLink id="HyperLink2" runat="server"
Text='<%#DataBinder.Eval(Container.DataItem,"TeamO peration")%>'
NavigateUrl='<%#"../Dash_Board/DashBoard.aspx?
Name="+DataBinder.Eval(Container.DataItem,"TeamOpe ration")%>'>H
yperLink
</asp:HyperLink>
</ItemTemplate>
I really appriciate all the help.
Thanks.

May 4 '07 #1
1 1346
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.ItemDataBound += new
RepeaterItemEventHandler(OnRptSomethingDataBound);
// 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 OnRptSomethingDataBound (object sender,
RepeaterItemEventArgs e)
{
if (args.Item.ItemType == ListItemType.Item || args.Item.ItemType ==
ListItemType.AlternatingItem)
{
//Find the DataItem
SomeObject object = e.Item.DataItem as SomeObject;
//Validate
if (object != null)
{
//Search for the hyperlink control
HyperLink link = (HyperLink)e.Item.FindControl("HyperLink2");
//Validate
if (link != null)
{
link.Text = object.TeamOperation.ToString();
link.NavigateUrl =
string.Format("../Dash_Board/DashBoard.aspx?Name={0}",object.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*********************@y80g2000hsf.googlegro ups.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<asp:HyperLink id="HyperLink2" runat="server"
Text='<%#DataBinder.Eval(Container.DataItem,"TeamO peration")%>'
NavigateUrl='<%#"../Dash_Board/DashBoard.aspx?
Name="+DataBinder.Eval(Container.DataItem,"TeamOpe ration")%>'>H
yperLink
</asp:HyperLink>
</ItemTemplate>
I really appriciate all the help.
Thanks.
May 4 '07 #2

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

Similar topics

1
by: Arpan | last post by:
I am working on Windows 2000 Professional. Due to some reasons, I had to re-install it. There is one particular ASP application named Track. The problem is I am able to visit only some of the pages...
3
by: JV | last post by:
I have an ASP.NET web page where IE keyboard navigation does not appear to work as it should. Normally you can tab through hyperlinks on a web page, and press <ENTER> to activate the current...
4
by: Seefor | last post by:
Hi, I want my text hyperlinks to have a dotted border underneath, so I did this which works fine: a, a:link, a:visited, a:hover, a:active { color: #000; text-decoration: none;
1
by: Robin | last post by:
Hello! I'm having trouble with links and hyperlinks in MS Access 2003 - any help would be great! Question 1! The "insert hyperlink" icon opens a browser window, allows the user to browse...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...

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.