Can't send parameters to .NET user control... Options
henning
Posted: Sunday, March 16, 2008 3:10:26 AM
Rank: Newbie

Joined: 9/23/2006
Posts: 5
I have created a simple user control to include in my web pages. The control is working perfect except for the ability to send parameters from Umbraco to the user control. I have created a method in the control for receiving the parameter data.
Code:

    private string _strDownloadFile;
    public string strDownloadFile
    {
        set
        {
            _strDownloadFile = strDownloadFile;
        }
        get
        {
            return _strDownloadFile;
        }
    }


Then for the test of the parameter data I just write the string content in a label:
Code:

            lblResult.Text = "Debug: " + _strDownloadFile;


I have also configured the parameters in Macro parameters in Umbraco.
Quote:

Alias: strDownloadFile
Name: File to download
Type: text


When I include the Macro in the page I am requested to fill in the parameter, but it doesn't matter what I write. The parameter data still isn't available to the user control.

Anybody have a clue what I might be doing wrong?

Thanks in advance...

/H.
neehouse
Posted: Sunday, March 16, 2008 4:39:23 AM

Rank: Umbracoholic

Joined: 7/20/2006
Posts: 1,038
Location: Charleston, West Virginia, United States

Code:

    private string _strDownloadFile;
    public string strDownloadFile
    {
        set
        {
            _strDownloadFile = [b]value[/b];
        }
        get
        {
            return _strDownloadFile;
        }
    }



• 2007/2008 MVP • 2008/2009 MVP • Core Developer • Certified Professional Level I & II •
neehouse
Posted: Sunday, March 16, 2008 4:40:02 AM

Rank: Umbracoholic

Joined: 7/20/2006
Posts: 1,038
Location: Charleston, West Virginia, United States
I was hoping that would highlight, but, I think you should be using the keyword 'value'.

• 2007/2008 MVP • 2008/2009 MVP • Core Developer • Certified Professional Level I & II •
henning
Posted: Sunday, March 16, 2008 7:06:03 PM
Rank: Newbie

Joined: 9/23/2006
Posts: 5
Ahhh, you are right! That managed it!
Thank you for your help!!!

/H.
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.