1

I can already send something in the querystring:

<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 querystring 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
  • You'll need to add a code sample of what you're trying to do in C#--it's imposible to tell what's going wrong otherwise. Commented Nov 30, 2009 at 12:43

3 Answers 3

2

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";
Sign up to request clarification or add additional context in comments.

2 Comments

i'm creating this link at runtime.. if i do that it won't render as a link
I would personally think this method would be more valid for creating a link at runtime.
1

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.

1 Comment

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 =)
0

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.

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.