trouble using FindControl on TemplatedWizardStep

  • Thread starter Thread starter Anton
  • Start date Start date
A

Anton

asp.net 3.5

From within the Page_Load event of my webpage I'm trying to access the
hidden input below, I do it because i want to programmatically set the
PayPal url (the url is different on development box and on testing box, and
indeed different in production environment, so hope I could specify the URL
in web.config etc)....

I've tryed these without any luck (hidden is null)
HtmlInputHidden hidden =
(HtmlInputHidden)TempStep.ContentTemplateContainer..FindControl("return");
HtmlInputHidden hidden =
(HtmlInputHidden)cuwNewUser.WizardSteps[1].Controls[0].FindControl("return");

<asp:TemplatedWizardStep runat="server" ID="TempStep">
<CustomNavigationTemplate>
<div style="text-align:center; margin-bottom:50px;
margin-top:50px;">
<input type="hidden" runat="server" id="return"
name="return" value="PayPal URL" />

any ideas?
 
nevermind, I guess I cannot set the link from within the code. Because if
runat=server, then asp.net changes name of the control from "return" to
something totally different. The control need to be named "return" if it
shall have any chance of working with paypal
 
Back
Top