views:

321

answers:

3

I can already send something in the querrystring:

<a href='Exibe.aspx?var='lalala''>

but i'd like to send a string instead of lalala, and when i try to concatenate normally in the response.write with "+" signs, it just doesn't. it creates the url only with the part before the "+".

facts: the string has a value i can concatenate it with other string and it works i can use the querrystring with something i write

thank you

UPDATE: code that doesn't work:

responde.write("<a href='Exibe.aspx?nome='" + nome(0) + "''> click here </a>");

code that works but doesn't do what i want (sends "VALUE" not my string)

responde.write("<a href='Exibe.aspx?nome='VALUE''> click here </a>");

i'm really new at this.. sorry

+1  A: 

Are you looking for HttpUtility.UrlEncode or are you looking for something to build the Uri like UriBuilder ? Either way you should be able to google up some examples.

Ruben Bartelink
Thank you! used HttpUtility.UrlEncode !i'm really new at this, and i'd like to make it clear that i'm not asking anything i haven't googled about.. thanks again =)
MarceloRamires
+2  A: 

Why not simply use a hyperlink server control? That way you have full control over the link element from you're code:

<asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink>

HyperLink1.NavigateUrl = "http://whereever.com/Default.aspx?Blah=whatever";
Mick Walker
i'm creating this link at runtime.. if i do that it won't render as a link
MarceloRamires
+1 @Marcelo: You sure this wont work for you?
Ruben Bartelink
I would personally think this method would be more valid for creating a link at runtime.
Mick Walker
A: 

Also, with query strings you dont need to use quotation marks around each parameter.

This:

response.write("<a href='Exibe.aspx?nome=VALUE'> click here </a>");

Will pass the string "VALUE" through.

Leigh Shayler
thanks.. i didn't know that, it's gonna be handy
MarceloRamires