Urgent... datagrid problem

Discussion in 'ASP .Net' started by Brock, Jul 2, 2008.

  1. Brock

    Brock Guest

    Thanks in advance...I have what seems like it should be a simple thing
    for a 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. So
    my query string needs to pickup the employee's ID and take it to a
    details window.Unfortunately I'm using 1.1 and the number of fields I
    may need to display is about 40. So I may need to do a repeater
    control on the detail form (?) so I can control all the html
    positioning. Any clues on a 1.1 idea for that? Thanks!
    ________________________

    Here's what I tried first, a datagrid with a LinkButton that I can't
    get to work. My initial problem is the error:

    BC30456: 'ViewDetails' is not a member of 'ASP.MainDepartment_aspx'.


    Below is my html and my Code behind at the bottom:

    <%@ 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>

    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

    ________________________

    I've also tried using the below <asp:hyperlink> technique... with
    errors on the

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

    ________________________

    Would Javascript be easier for all this?


    I am using .net framework 1.1
     
    Brock, Jul 2, 2008
    #1
    1. Advertising

  2. Brock

    Munna Guest

    Munna, Jul 2, 2008
    #2
    1. Advertising

  3. Brock

    Brock Guest

    Sorry for a dumb question... I'm really new to this... is your
    recommendation to be used to modify my (?):

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

    Sorry... I'm just not following the suggested.... Thanks!


    On Jul 2, 12:28 pm, Munna <> wrote:
    > Hi,
    >
    > I would use itemdatabound event and modify hyper link to set
    > appropriate navigate url in that event,
    > i would also set the hyperlink's traget property to blank so that it
    > open in new window..
    >
    > Best of luck
    >
    > Munna
    >
    > www.munna.shatkotha.com/blogwww.munna.shatkotha.comwww.shatkotha.com
     
    Brock, Jul 2, 2008
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. gops
    Replies:
    0
    Views:
    339
  2. Sachin Jagtap

    URGENT !! QUEUE STL PROBLEM URGENT!!

    Sachin Jagtap, Apr 28, 2005, in forum: C++
    Replies:
    4
    Views:
    1,064
    Mark Stijnman
    Apr 29, 2005
  3. =?Utf-8?B?YW1qYWQ=?=

    DataGrid paging problem with asp.net urgent help

    =?Utf-8?B?YW1qYWQ=?=, Jul 28, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    400
    =?Utf-8?B?YW1qYWQ=?=
    Jul 28, 2006
  4. Rob
    Replies:
    3
    Views:
    457
  5. Replies:
    1
    Views:
    303
Loading...

Share This Page