1

What's the best way to pass values from a HTML tag/elements to code behind without using the runat="server". Example

<input id="tags" type="text" />

Now, I want to pass the value of tags to code behind.

string tagsvalue = this.Request.Form.Get( "tags" );

I'm trying to use the code above but is not working. Any help will be really appreciate it.

1 Answer 1

5

You use the name attribute to specify the name in the name/value pair not the id

<input name="tags" id="tags" type="text" />
Sign up to request clarification or add additional context in comments.

2 Comments

Name is passed to the server. Id is only on client side (jquery/javascript). Also, dont forget to mark the question as correct as it will motivate others to help you in the future.
Yes, I'm just waiting for the wait time, I have 17 seconds left so I can mark it as the answer. thank you guys

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.