Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

string.concat doubts

Posted on 2008-10-01
2
Medium Priority
?
555 Views
Last Modified: 2012-05-05
In the following code i need join another parameter in the details.aspx like:

details.aspx?id=xxx&ref=zzz

How can i do, with string.concat or another way (join 3 stings).

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/info.jpg" 
onclick="ImageButton1_Click" PostBackUrl='<%# string.concat("~/details.aspx?id=", DataBinder.Eval(Container.DataItem, "id").tostring()) %>' />

Open in new window

0
Comment
Question by:rflorencio
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 1000 total points
ID: 22613144
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/info.jpg"
onclick="ImageButton1_Click" PostBackUrl='<%# "~/details.aspx?id=" &  DataBinder.Eval(Container.DataItem, "id").tostring() &"&ref=" & DataBinder.Eval(Container.DataItem, "ref").tostring() %>' />
0
 
LVL 43

Assisted Solution

by:TimCottee
TimCottee earned 1000 total points
ID: 22613197
Hello rflorencio,

String.Concat is better than & as it is more efficient though with small strings this performance gain may not be noticeable. Another alternative is string.format:

 

Which effectively places the arguments (as many as you want) into the string in the appropriate places.


Regards,

TimCottee
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question