Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Visual Webpart in Visual Studio adding another page

$
0
0

Hi

I've created a visual studio 2010 web project, I now have converted this to a Visual Webpart also in Visual Studio.

I have a branch that says VisualWebPart1. In here I have various files including VisualWebPart1UserControl.ascx with its code behind.

This all works.

I then altered the original VS project to include a details page. I then need to include these pages in the Visual Webpart So i added the details.aspx and details.aspx.cs  pages.

Upon execution, I get errors in the details.aspx.cs page:

Error 1 The name 'labDetails' does not exist in the current context 

None of the names work.

Here is a snippet of details.aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Datatier;
public partial class Details : System.Web.UI.Page
{
    string MsgId;
    protected void Page_Load(object sender, EventArgs e)
    {
        // Get the message id grom the query string
        MsgId = Request.QueryString["MsgId"];
        labDetails.Text = "Details for Message Id " + MsgId;
        // Populate the DataView
        ShowDetails();
    }

Any ideas pls


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>