Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Urgent... datagrid problem

Reply
Thread Tools

Urgent... datagrid problem

 
 
Brock
Guest
Posts: n/a
 
      07-02-2008
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.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>

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
 
Reply With Quote
 
 
 
 
Munna
Guest
Posts: n/a
 
      07-02-2008
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/blog
www.munna.shatkotha.com
www.shatkotha.com
 
Reply With Quote
 
 
 
 
Brock
Guest
Posts: n/a
 
      07-02-2008
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 <(E-Mail Removed)> 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
>
> http://www.munna.shatkotha.com/blogw....shatkotha.com


 
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
problem in nesting datagrid in to a nested datagrid sajvargs ASP .Net 0 02-20-2005 12:17 AM
problema ultima pagina datagrid asp.net/problem last page datagrid roberto ASP .Net Datagrid Control 1 02-17-2005 07:50 AM
DataGrid edited values problem and autogenerated columns in DataGrid problem John Walsch ASP .Net Web Controls 0 07-09-2004 03:03 PM
Call Datagrid Command column outside datagrid Dave ASP .Net 0 11-20-2003 11:11 AM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments