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
How to access radio button list selected value in PartialViewMacroPage ?
Hi Mukund and welcome to our :-),
Try to see this documentation on how to get data from a radio button list.
https://our.umbraco.org/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/RadioButton-List
Hope this helps,
/Dennis
Hello Dennis, i have tried same but every time i get 'true' value for my radio button list , i want selected options value . hear is my code
@inherits Umbraco.Web.Macros.PartialViewMacroPage @{ var home = @Umbraco.TypedContentAtRoot(); string mediaIds = ""; var GalID = CurrentPage.TopBannerID; var Seektime=0;var Isautoplay=false;var IsActive = true; var strIsautoplay = "";} @foreach (var childPage in home) { if (childPage.DocumentTypeAlias == "gallerys") { foreach (var childsubPage in childPage.Children) { if (childsubPage.DocumentTypeAlias == "gallery") { if (childsubPage.Id == GalID) { if (childsubPage.GetPropertyValue<Boolean>("active")) { mediaIds = childsubPage.GetPropertyValue<string>("selectimages"); Seektime = childsubPage.GetPropertyValue<Int32>("Seektime"); Isautoplay = childsubPage.GetPropertyValue<Boolean>("AutoPlay"); break; } else { IsActive = false; } } } } } }
Hi Mukund,
Try to change:
if (childsubPage.GetPropertyValue<Boolean>("active")) { mediaIds = childsubPage.GetPropertyValue<string>("selectimages"); Seektime = childsubPage.GetPropertyValue<Int32>("Seektime"); Isautoplay = childsubPage.GetPropertyValue<Boolean>("AutoPlay"); break; }
To something like this.
if (childsubPage.HasValue("active")) { var preValue = Umbraco.GetPreValueAsString(childsubPage.GetPropertyValue<int>("active")); @preValue mediaIds = childsubPage.GetPropertyValue<string>("selectimages"); Seektime = childsubPage.GetPropertyValue<Int32>("Seektime"); Isautoplay = childsubPage.GetPropertyValue<Boolean>("AutoPlay"); break; }
So the @preValue should give you the value that, you have secreted.
Thanks Dennis , it works fine. it solved my problem. :-)
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
radio butoon list , selected value in partial view
How to access radio button list selected value in PartialViewMacroPage ?
Hi Mukund and welcome to our :-),
Try to see this documentation on how to get data from a radio button list.
https://our.umbraco.org/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/RadioButton-List
Hope this helps,
/Dennis
Hello Dennis, i have tried same but every time i get 'true' value for my radio button list , i want selected options value . hear is my code
Hi Mukund,
Try to change:
To something like this.
So the @preValue should give you the value that, you have secreted.
Hope this helps,
/Dennis
Thanks Dennis , it works fine. it solved my problem. :-)
is working on a reply...