Help! asp.net need js for HyperLink variable

B

Brock

I didn't know a better way to label my subject! Sorry guys... I have
an ASP.net Datagrid. What I'll be using this for is for a user to
choose an employee record on the datagrid then hit the detail button
or link and launch a new window showing the details for that specific
employee. The new window will have to pick up the Employee ID and
populate the new ASP.net window. Unfortunately I'm using .net
Framework 1.1 so my user tools are limited. So I'm thinking why not
just use Javascript like other people have told me.

I've tried two ASP ideas of which I couldn't get rid of the errors:

1):
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink ID="ViewDetails" Runat="server" NavigateUrl='<%#
Eval("id","Details.aspx?id={0}") %>'>Details</asp:HyperLink>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>

2):

<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="MainDepartment.aspx.vb"
Inherits="Forsyth.HR_ReportingTool.UI.MainDepartment" %>
<FORM id="Form1" method="post" runat="server">
<asp:datagrid id="dgEmployees" >
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:LinkButton ID="ViewDetails" CommandArgument='%# Eval("id") %'
Runat="server" OnCommand="ViewDetails">Details</asp:LinkButton>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:datagrid></FORM>
</BODY>
</HTML>

Note that in this solution I'm using a "code-behind" file containing:

Protected Sub ViewDetails(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.CommandEventArgs)
Response.Redirect("Details.aspx?id=" & e.CommandArgument.ToString())
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Urgent... datagrid problem 2
DataGrid problem - help! 1
Hyperlink on a datagrid 1
repeater 0
Prob w/ Datagrid 9
ASP.NET Datagrid 1
Problem with Data Grid 0
DataGrid having ListBox and Hyperlink 5

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top