views:

37

answers:

1

hi my dear friends :

the below ASPX code is ok :

 <asp:Label ID="lblShowInRPV1" runat="server"  
       Text="<%# Method() %>"></asp:Label>

is it possible to pass some parameters (from aspx code) to Method()?

in the other hand can u fix Below databinding for me ? (That Is Incorrect)

 <asp:Label ID="lblShowInRPV1" runat="server" 
      Text="<%# Method(Eval("ID")) %>"></asp:Label>

the method in code behind is like this :

    protected string Method(int ID)
    {
string s= string.Empty;
//STUFF
return s;
    }

the ID Will Be Shown In My Grid And I want To Pass It To Method()...

how can i do that?

thanks in future advance

best regards

+1  A: 

Assuming you wanted to pass a reference to the Label object itself, this should work:

    <%# Method( lblShowInRPV1 ) %>

Otherwise, please clarify what you mean.

Fyodor Soikin
i edit My Question / Thanks For Attention
LostLord
Ok, in that case, I need more context. Where do you expect that ID to come from? What is the meaning of it? What code surrounds your `Label`?
Fyodor Soikin
thank u my friend ... my problem solved ... if u see my question so u can see the extra double qoute in my code ...(wrong sysntax) and another problem of me was being object of parameters , so by your example i know it.
LostLord