TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
John Joe
NA
81
16.2k
getting info for hyperlink clicked
Jul 22 2013 11:49 AM
I am having troble displaying relevant information for a clicked hyperlink .
I have a table "Course" and "StudentInfo"
My Hyperlinks display list courses from DB* table(Course.table) and when I click one Hyperlink, the program has to get information for that link clicked from database
and display whether in a gridview or label (It has to check which hyperlink is clicked i guess)
this is how I display my hyperlinks from DB*
<asp:gridview id="mygv"
autogeneratecolumns="false"
runat="server">
<columns>
<asp:hyperlinkfield datatextfield="hyperlink"
datatextformatstring="{0:c}"
datanavigateurlfields="hyperlink"
datanavigateurlformatstring="~\WebForm1.aspx?hyperlink={0}"
headertext=""
/>
</columns>
</asp:gridview>
if (!IsPostBack)
{
BindGrid(mygv);
}
try
{
SqlCommand cmd = new SqlCommand(" SELECT [hyperlink] FROM Courses WHERE [Student ID] = '" + Session["StudentID"] + "'", con);
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
if (dr.HasRows)
{
mygv.DataSource = dr;
mygv.DataBind();
}
else
{
mygv.DataSource = null;
mygv.DataBind();
}
}
catch (Exception ex)
{
Response.Write("Error Occured: " + ex.ToString());
}
finally
{
con.Close();
}
how do I get the information for the link clicked??
Reply
Answers (
1
)
Create XML Serialization/Deserialization using memorystream?
Removing character from string