In a follow up to my previous question, I want to get the value of the hidden input field from the child page codebehind.
I tried HtmlInputHidden hdnID = (H
So change it FROM
HtmlInputHidden hdnID = (HtmlInputHidden)Page.Master.FindControl("ctl00_hdnField");
TO
HiddenField hdnID = (HiddenField)Page.Master.FindControl("hdnField");
It's just a casting thing - notice HtmlInputHidden
changed to HiddenField
. You also don't need the ct100_
part - this is just so the HTML rendered element has a unique ID.
The control on your page is an asp.net control, not a generic HTML control.
You would use HtmlInputHidden
if you put a generic in your HTML.