3

I have this method in cs page:

public String getToolTip(Object productId, Object imgBtnId)
{
    return UtilsStatic.getWishListButtonToolTip(Int32.Parse(productId.ToString()), getCumparaturiCategoryID(imgBtnId.ToString()));
}

and i want to call it from asp.net page (aspx).

I tried like this but it fails:

 ToolTip="<%# getToolTip(getProductIdNoutatiFeatured(), 'imgBtnWishSubcategory2Featured')%>"/>

Please note that the second parameter is an hardcoded string...but it says:

CS1012: Too many characters in character literal

I think it is wrong to put the string between ' '. But how?

3 Answers 3

6

You can't use single quotes for a string, you have to reverse the usage of single- and double-quotes:

ToolTip='<%# getToolTip(getProductIdNoutatiFeatured(),
                        "imgBtnWishSubcategory2Featured")%>'/>
Sign up to request clarification or add additional context in comments.

Comments

0

It should be

ToolTip="<%# getToolTip(getProductIdNoutatiFeatured(), \"imgBtnWishSubcategory2Featured\")%>"/>

Comments

0

I think as well as the quotes issue you are trying to use the binding <%# %> instead of writing out the result with a starndard response.write

try

'<%=getToolTip(getProductIdNoutatiFeatured(), "imgBtnWishSubcategory2Featured")%>'

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.