Hi, I am a dot net beginner. I have learned programming in c# for website developing. Now I would like to learn vb.net . So I am trying to convert one of my previous work from c# to vb.
But now I am facing a problem while converting to vb.
Please help me.

Error message:
Conversion from string "Product.aspx?pid=" to type 'Double' is not valid.

<asp:LinkButton ID="lkbName" runat="server" PostBackUrl='<%# "Product.aspx?pid="+ Eval("pId") %>' Font-Size="Small"><%# Eval("name") %></asp:LinkButton><br/>

The datatype of pId in database is int.

Recommended Answers

<asp:LinkButton ID="lkbName" runat="server"
            PostBackUrl='<%# Eval("pId","Product.aspx?pid={0}") %>'
            Text='<%# Eval("name") %>'>
</asp:LinkButton>
Jump to Post

All 3 Replies

<asp:LinkButton ID="lkbName" runat="server"
            PostBackUrl='<%# Eval("pId","Product.aspx?pid={0}") %>'
            Text='<%# Eval("name") %>'>
</asp:LinkButton>
<asp:LinkButton ID="lkbName" runat="server"
            PostBackUrl='<%# Eval("pId","Product.aspx?pid={0}") %>'
            Text='<%# Eval("name") %>'>
</asp:LinkButton>

Thanks yaar, thank you very much for your valueable suggesion.

Actually I got another solution for the problem.
I have used '&' instead of '+'
In VB '&' is used for string concatination. At first I used + for that purpose. After replacing that sign, gets the proper output.

Thanks. Please mark this thread as solved if you have found an answer to your question and good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.