0

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

2 Answers 2

2

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

    <%# Method( lblShowInRPV1 ) %>

Otherwise, please clarify what you mean.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
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.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.