views:

14

answers:

1

I am starting to give up troubleshooting this issue I had... I had an .ascx page and had the following user control in it:

<td>
                <Club:DatePicker ID="dp1" runat="server" />
</td>

however in my code behind when I tried to write methods:

 public System.DateTime startDateTime
        {
            get
            {
                return dp1.SelectedDate.Add(tp1.SelectedTime.TimeOfDay);
            }
            set
            {
                dp1.SelectedDate = value;
                tp1.SelectedTime = value;
            }
        }

It can't reference dp1(dp1 is underlined in red) as well as tp1... why is this?? I've tried to convert the solution to a web application and yet it doesn't work. Tried adding:

protected global::ClubSite dp1; protected global::ClubSite tp1;

in the ascx.designer.cs

but then the global is highlighted in red

here's the link to my full solution:

http://cid-1bd707a1bb687294.skydrive.live.com/self.aspx/.Public/Permias.zip

A: 

Your DurationPicker.ascx.designer.cs should look like this, plus some comments:

namespace Permias {
    public partial class DurationPicker {
        protected global::ClubSite.DatePicker dp1;
        protected global::ClubSite.TimePicker tp1;
        protected global::ClubSite.DatePicker dp2;
        protected global::ClubSite.TimePicker tp2;
    }
}

I edited your .ascx markup and this appeared fine, seems to be something visual studio's hanging onto on your side that's not letting this happen. One thing you can do to trigger this manually:

  1. Delete DurationPicker.ascx.designer.cs
  2. Right click on DurationPicker.ascx
  3. Click Convert to Web Application

This should re-generate the DurationPicker.ascx.designer.cs file.

Nick Craver