Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
I've created a dropdown list in a macro using @Html.DropDownList
I want to append the selected value to the querystring, is there an easy way of accessing this?
Hi Djscorch.
What are you exactly trying to do?
What should happen after change the dropdown?
Nothing should happen after the dropdown changes, but there is a button under the ddl, when they hit this i want to send them to another page with the selected value added to the querystring.
Hi Djsorch.
The razor / macro using to render the page when page load.
Try reading more basic stuff like this : http://www.w3schools.com/html/html_forms.asp
after sending the value you can get it in macro with :
@{
string fromRequst = Request["key"];
}
Hi djscorch,
You could wrap your drop down list in a form and set the forms action to 'get' in order for it to be passed via query string.
@using (Html.BeginForm("Action", "Controller", null, FormMethod.Get)){@Html.DropDownList() <input type="submit" />}
Dan.
Took it back to the old school and used a POST method.
Don't know why I thought I could simply just get at the selected value! (I was thinking webforms postback)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting a dropdownlist selected value
Hi,
I've created a dropdown list in a macro using @Html.DropDownList
I want to append the selected value to the querystring, is there an easy way of accessing this?
Hi Djscorch.
What are you exactly trying to do?
What should happen after change the dropdown?
Nothing should happen after the dropdown changes, but there is a button under the ddl, when they hit this i want to send them to another page with the selected value added to the querystring.
Hi Djsorch.
The razor / macro using to render the page when page load.
Try reading more basic stuff like this : http://www.w3schools.com/html/html_forms.asp
after sending the value you can get it in macro with :
@{
string fromRequst = Request["key"];
}
Hi djscorch,
You could wrap your drop down list in a form and set the forms action to 'get' in order for it to be passed via query string.
Dan.
Took it back to the old school and used a POST method.
Don't know why I thought I could simply just get at the selected value! (I was thinking webforms postback)
is working on a reply...