Hi everybody,
I have a UserControl which uses SQLDataSource with SelectParameter being Profile parameter. Now I want to use the same UserControl in other situation where I do not have Profile, but I'm passing my parameter as a QueryString.
I was duplicating the same UserControl in two places with different syntax, but it turned out to be a problem in Deploy.
Here is what I have in ASCX for these two cases:
<SelectParameters>
<asp:ProfileParameter Name="SiteID" PropertyName="SiteID" Type="Int32" />
and
<SelectParameters>
<asp:QueryStringParameter DefaultValue="0" Name="SiteID"
QueryStringField="sid" Type="Int32" />
Is there some possibility to combine them and do somehow conditionally depending on have I passed QueryString or not? Preferably directly in ASCX?
Thanks a lot in advance.
If it's not broken, fix it until it is.
My Blog