0

I have a C# string that contains the answer to the question "May we contact?" How do I transfer that to our aspx webpage? The c# string is in the code behind page.

1
  • 2
    What do you mean by "transfer that to our aspx webpage" Commented Jun 24, 2013 at 18:02

2 Answers 2

3

If the string is a protected (at least) property on the page then it can be accessed in the page's markup. So the string would be something like this at the class level:

protected string MyString { get; set; }

And in the page markup you can access its value:

<%= MyString %>
Sign up to request clarification or add additional context in comments.

Comments

0

If you want to send the string to another page besides the code-behind it lives in, then use a query string entry to pass it to the URL you are redirecting to. If you want the current page to access the C# string, then make the string a protected property so the page can use it an embedded code block.

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.