My problem - really annoying!!!:
UserControls. In 1.x you could create a usercontrol and give it properties. Nothing too flash yet! You could also do something like:
Nifty! And really useful
Here comes .NET 2, all singing and all dancing - yeehah!
Can't seem to do that anymore.
The only way you can reference the UserControl is by having it in the App_Code folder. Then it can be called from somewhere else and have it's properties set. Well, sort of. When you compile you get an error saying can't use App_Code for this action. Something to do with it compiling code in App_Code differently (not that I care to be honest...).
Anyway....
Found this article discussing it: And then came across this as well:
So, I created an Interface:
Created my usercontrol:
So now when I compile I get: The modifier 'public' is not valid for this item. Relating to the UserControl.
I know nothing about interfaces - any ideas? Any experience on having done this already...
Please tell me there's a dead easy way to do this, cos at the moment I'm thinking turning back to VS2003/1.1!
UserControls. In 1.x you could create a usercontrol and give it properties. Nothing too flash yet! You could also do something like:
Code:
MyControl uc = (MyControl)this.LoadControl("VIRTUAL_PATH_OR_NAMESPACE");
uc.MyProperty = "Hello, I'm a dick :)";
MySpan.Controls.Add(uc);
Nifty! And really useful

Here comes .NET 2, all singing and all dancing - yeehah!
Can't seem to do that anymore.
The only way you can reference the UserControl is by having it in the App_Code folder. Then it can be called from somewhere else and have it's properties set. Well, sort of. When you compile you get an error saying can't use App_Code for this action. Something to do with it compiling code in App_Code differently (not that I care to be honest...).
Anyway....
Found this article discussing it: And then came across this as well:
So, I created an Interface:
Code:
namespace x.x
{
public interface IUserLogin
{
string setMe
{
get;
set;
}
}
}
Created my usercontrol:
Code:
public partial class _UserLogin : System.Web.UI.UserControl, x.x.IUserLogin
{
protected void Page_Load.....
{
}
public void IUserLogin.setMe()
{
}
}
So now when I compile I get: The modifier 'public' is not valid for this item. Relating to the UserControl.
I know nothing about interfaces - any ideas? Any experience on having done this already...
Please tell me there's a dead easy way to do this, cos at the moment I'm thinking turning back to VS2003/1.1!