0

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.

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by __avd
0
<asp:LinkButton ID="lkbName" runat="server"
            PostBackUrl='<%# Eval("pId","Product.aspx?pid={0}") %>'
            Text='<%# Eval("name") %>'>
</asp:LinkButton>
0
<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.

0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.