dtburdick
asked on
RegisterHiddenField doesn't create hidden field
One one page I have the RegisterHiddenField call in the Page_Load and it works just fine. In the very next page I issue the same command in Page_Load and it won't create any of them.
Is there a setting on the page somewhere that I'm missing?
Is there a setting on the page somewhere that I'm missing?
ASKER
I put a postback check and got nothing.
Thanks for help.
Pardon the code's a bit ugly, still developing:
private void Page_Load(object sender, System.EventArgs e)
{
if ( ! Page.IsPostBack )
{
string s="foobar";
}
// Hidden fields needed for posting to VeriSign
Page.RegisterHiddenField(" ORDERFORM" ,"False");
Page.RegisterHiddenField(" ECHODATA", "True");
Page.RegisterHiddenField(" SHOWCONFIR M","False" );
Page.RegisterHiddenField(" PARTNER"," VeriSign") ;
Page.RegisterHiddenField(" LOGIN","do dsbconfere nce");
Page.RegisterHiddenField(" TYPE","S") ;
Page.RegisterHiddenField(" METHOD","C C");
Page.RegisterHiddenField(" USER1","12 345"); //ConfirmNumber
Page.RegisterHiddenField(" AMOUNT","1 00");
Page.RegisterHiddenField(" COMMENT1", "");
Page.RegisterHiddenField(" COMMENT2", "");
Page.RegisterHiddenField(" USER5",Req uest.Form[ "USER5"]);
this.lblUSER5.Text=Request .Form["USE R5"];
Page.RegisterHiddenField(" PONUM",Req uest.Param s.Get("PON UM"));
this.lblPONUM.Text=Request .Params.Ge t("PONUM") ;
Page.RegisterHiddenField(" NAME",Requ est.Form[" NAME"]);
this.lblNAME.Text=Request. Form["NAME "];
Page.RegisterHiddenField(" ADDRESS",R equest.For m["ADDRESS "]);
this.lblADDRESS.Text=Reque st.Form["A DDRESS"];
Page.RegisterHiddenField(" NAME",Requ est.Form[" NAME"]);
this.lblNAME.Text=Request. Form["NAME "];
Page.RegisterHiddenField(" CITY",Requ est.Form[" CITY"]);
this.lblCITY.Text=Request. Form["CITY "];
Page.RegisterHiddenField(" STATE",Req uest.Form[ "STATE"]);
this.lblSTATE.Text=Request .Form["STA TE"];
Page.RegisterHiddenField(" ZIP",Reque st.Form["Z IP"]);
this.lblZIP.Text=Request.F orm["ZIP"] ;
Page.RegisterHiddenField(" COUNTRY",R equest.For m["COUNTRY "]);
this.lblCOUNTRY.Text=Reque st.Form["C OUNTRY"];
Page.RegisterHiddenField(" PHONE",Req uest.Form[ "PHONE"]);
this.lblPHONE.Text=Request .Form["PHO NE"];
Page.RegisterHiddenField(" EMAIL",Req uest.Form[ "EMAIL"]);
this.lblEMAIL.Text=Request .Form["EMA IL"];
Page.RegisterHiddenField(" USER2",Req uest.Form[ "USER2"]);
this.lblUSER2.Text=Request .Form["USE R2"];
Page.RegisterHiddenField(" USER3",Req uest.Form[ "USER3"]);
this.lblUSER3.Text=Request .Form["USE R3"];
Page.RegisterHiddenField(" AMOUNT",Re quest.Form ["AMOUNT"] );
this.lblAMOUNT.Text=Reques t.Form["AM OUNT"];
Page.RegisterHiddenField(" USER4",Req uest.Form[ "USER4"]);
this.lblUSER4.Text=Request .Form["USE R4"];
Page.RegisterHiddenField(" CARDNUM",R equest.For m["CARDNUM "]);
this.lblCARDNUM.Text=Reque st.Form["C ARDNUM"];
this.lblExpMonth.Text=Requ est.Form[" ddlExpMont h"];
switch (Request.Form["ddlExpMonth "])
{
case "01":
this.lblExpMonth.Text="Jan uary";
break;
case "02":
this.lblExpMonth.Text="Feb ruary";
break;
case "03":
this.lblExpMonth.Text="Mar ch";
break;
case "04":
this.lblExpMonth.Text="Apr il";
break;
case "05":
this.lblExpMonth.Text="May ";
break;
case "06":
this.lblExpMonth.Text="Jun e";
break;
case "07":
this.lblExpMonth.Text="Jul y";
break;
case "08":
this.lblExpMonth.Text="Aug ust";
break;
case "09":
this.lblExpMonth.Text="Sep tember";
break;
case "10":
this.lblExpMonth.Text="Oct ober";
break;
case "11":
this.lblExpMonth.Text="Nov ember";
break;
case "12":
this.lblExpMonth.Text="Dec ember";
break;
}
this.lblExpYear.Text="20" + Request.Form["ddlExpYear"] ;
Page.RegisterHiddenField(" EXPDATE",R equest.For m["EXPDATE "]);
}
Thanks for help.
Pardon the code's a bit ugly, still developing:
private void Page_Load(object sender, System.EventArgs e)
{
if ( ! Page.IsPostBack )
{
string s="foobar";
}
// Hidden fields needed for posting to VeriSign
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
Page.RegisterHiddenField("
this.lblUSER5.Text=Request
Page.RegisterHiddenField("
this.lblPONUM.Text=Request
Page.RegisterHiddenField("
this.lblNAME.Text=Request.
Page.RegisterHiddenField("
this.lblADDRESS.Text=Reque
Page.RegisterHiddenField("
this.lblNAME.Text=Request.
Page.RegisterHiddenField("
this.lblCITY.Text=Request.
Page.RegisterHiddenField("
this.lblSTATE.Text=Request
Page.RegisterHiddenField("
this.lblZIP.Text=Request.F
Page.RegisterHiddenField("
this.lblCOUNTRY.Text=Reque
Page.RegisterHiddenField("
this.lblPHONE.Text=Request
Page.RegisterHiddenField("
this.lblEMAIL.Text=Request
Page.RegisterHiddenField("
this.lblUSER2.Text=Request
Page.RegisterHiddenField("
this.lblUSER3.Text=Request
Page.RegisterHiddenField("
this.lblAMOUNT.Text=Reques
Page.RegisterHiddenField("
this.lblUSER4.Text=Request
Page.RegisterHiddenField("
this.lblCARDNUM.Text=Reque
this.lblExpMonth.Text=Requ
switch (Request.Form["ddlExpMonth
{
case "01":
this.lblExpMonth.Text="Jan
break;
case "02":
this.lblExpMonth.Text="Feb
break;
case "03":
this.lblExpMonth.Text="Mar
break;
case "04":
this.lblExpMonth.Text="Apr
break;
case "05":
this.lblExpMonth.Text="May
break;
case "06":
this.lblExpMonth.Text="Jun
break;
case "07":
this.lblExpMonth.Text="Jul
break;
case "08":
this.lblExpMonth.Text="Aug
break;
case "09":
this.lblExpMonth.Text="Sep
break;
case "10":
this.lblExpMonth.Text="Oct
break;
case "11":
this.lblExpMonth.Text="Nov
break;
case "12":
this.lblExpMonth.Text="Dec
break;
}
this.lblExpYear.Text="20" + Request.Form["ddlExpYear"]
Page.RegisterHiddenField("
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Grrrrr. Are you doing it using Page.RegisterHiddenField?
Is there anything that needs to be in place for Page.RegisterHiddenField to work?
Is there anything that needs to be in place for Page.RegisterHiddenField to work?
ASKER
I hate it when I get so caught up in figuring out why something doesn't work that I don't just start over.
I'm rebuilding the page from scratch and it is working fine. Who knows what the problem is, who cares.
Thanks for the help. I'll give you the points.
I'm rebuilding the page from scratch and it is working fine. Who knows what the problem is, who cares.
Thanks for the help. I'll give you the points.
worked with the exact code eh?
can you post the code for the pages with more explanation so we can see what maybe causing this behaviour?