Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: User Control Parameters Passed as Query String

$
0
0
Hi!

I guess you can use the standard ASP.NET's Request.QueryString["your_param_name"] to query parameters and then assign it to your parameter.

Something like this:
using System;
using Composite.Functions;

public partial class C1Function : Composite.AspNet.UserControlFunction
{
    public override string FunctionDescription
    {
        get 
        { 
            return "A demo function that outputs a hello message."; 
        }
    }

    [FunctionParameter(DefaultValue = "World")]
    public string Name { get; set; }

    protected void Page_Load(object sender, EventArgs e)
    {
        string Param1 = Request.QueryString["Param1"];

        if(!String.IsNullOrEmpty(Param1))
            Name = Param1;
    }
}
The DefaltValue here will serve as a fallback value.

Viewing all articles
Browse latest Browse all 2540

Trending Articles



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