Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Help! asp.net need js for HyperLink variable

Reply
Thread Tools

Help! asp.net need js for HyperLink variable

 
 
Brock
Guest
Posts: n/a
 
      07-02-2008
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.MainDepartme nt" %>
<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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Variable variable name" or "variable lvalue" mfglinux Python 11 09-12-2007 03:08 AM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink davetichenor ASP .Net 1 10-30-2006 02:57 PM
How to add a hyperlink column to asp.net datagrid - where only one value is a hyperlink Dave ASP .Net Datagrid Control 0 10-21-2006 07:48 PM
How do I scope a variable if the variable name contains a variable? David Filmer Perl Misc 19 05-21-2004 03:55 PM
Dynamically Hyperlink and Event Handler for the Hyperlink ? Ken ASP .Net Datagrid Control 1 08-15-2003 11:38 PM



Advertisments