tags:

views:

213

answers:

0

hi

i'm kind of newbe to a asp.net development. here is my problem:

my object data source Get method, returns some business object + boolean output parameter, which defines extra state. in the object data source, i try to bind value of that parameter to a hidden form field. then, based on that value, i'd like to display or hide hyper link, which provides some extra functionality.

here is code sample:

<asp:HiddenField ID="isCurrentUserRegisterd" runat="server" />

<asp:FormView ID="eventView" runat="server" DataSourceID="eventSource">
    <ItemTemplate>
        <h2 class="title">
            <asp:Literal Text='<%# Bind("EventHeader") %>' 
                 runat="server" ID="eventHeader"/>
        </h2>

        <!-- this one here should be displayed optionally -->
        <asp:HyperLink ID="registerLink" Visible="true"
            NavigateUrl='<%# "~/Author..cut cut...ion.aspx?Action=Add&Id="+ 
                Eval("Id") %>' 
            Text="Zarejstruj się" CssClass="rejestracja" runat="server"/>
    </ItemTemplate>
</asp:FormView>


<asp:ObjectDataSource ID="eventSource" runat="server" SelectMethod="GetEvent" 
    TypeName="EventManagementProxy">
    <SelectParameters>
        <asp:QueryStringParameter DefaultValue="0" Name="id"
            QueryStringField="id" Type="Int32" />
        <asp:ControlParameter ControlID="isCurrentUserRegisterd" 
            Direction="Output" Name="isCurrentUserRegistered" 
            PropertyName="Value" Type="Object" />
    </SelectParameters>
</asp:ObjectDataSource>

any hints how could i do it nice?

thanks in advance!