Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to make a DetailsView with LinkButtons inside which link to another DetailsView?How to make a DetailsView with LinkButtons inside which link to another DetailsView?
Previous
 
Next
New Post
3/23/2009 11:42 PM
 

In brief (more detailled information below): A DetailView gets a dataset (employee data) from an SQLDataSource. Some of the columns (employee's boss, employee's department manager, etc.) I want to have a link which then link to other datasets (the boss's detailled data etc.) (to be displayed in a DetailsView, too).

Can anyone help how to realize that in ASP.Net?

 

Detailled description:

I am writing a small and actually very simple module for DotNetNuke which displays data from our HR database. The module consists of one ASCX file with a multiview and following views:

  • View 1 shows a GridView with an employee list which is set to selectable. If an employee row is selected View 2 is displayed:
  • View 2 shows a DetailsView with an employee's detailled data.
  • View 3 shows a GridView with an job list which is set to selectable. If a job is selected View 4 is displayed:
  • View 4 shows a DetailsView with the job details.

In the job details several employees occur: The employee who is doing that job, an employee who is assigned as his boss and maybe an employee who is the department manager (might be the same person). Therefore I would like to have a link from these employees back to the View 2 with the DetailsView and the employee details.

My approach so far was:

  1. Template field with an <asp:LinkButton runat="server" onclick="ShowEmployeeDetails" Text='<%# Eval("[Supervisor]") %>'></asp:LinkButton> 
  2. When LinkButton is clicked: Show View 2 and fille the DetailsView with that employees data

Now I have two issues:

  1. When the Text=... property of the LinkButton is databound (instead of some static text) then rendering the page throws an error: A critical error has occurred. Exception has been thrown by the target of an invocation.
  2. When the LinkButton is clicked, View 2 shows but only the Label on top shows the correct employees name. But the DetailsView itself does not show.

Code:
 

1        protected void ShowEmployeeDetails(object sender, System.EventArgs e)
2        {      
3            EmployeeListGrid.SelectedIndex = 3;   // GridView on View 1 with employee list, eid=3 is for testing
4            EmployeeDetailData.DataBind();        // the SQLDataSource for getting employee details
5            EmployeeProfile.DataBind();           // the DetailsView for displaying employee details
6            employeeSQLViews.ActiveViewIndex = 1; // show the view with the employee details
7        }
1        protected void EmployeeProfile_DataBound(object sender, System.EventArgs e)
2        {
3            if (EmployeeListGrid.SelectedRow != null) {
4                SelectedEmployeeLabel.Text = System.Convert.ToString(EmployeeListGrid.SelectedRow.Cells[1].Text);
5                EmployeeListGrid.SelectedIndex = -1;
6            }
7        }
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to make a DetailsView with LinkButtons inside which link to another DetailsView?How to make a DetailsView with LinkButtons inside which link to another DetailsView?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out