Solved

RegisterHiddenField doesn't create hidden field

Posted on 2006-06-20
6
545 Views
Last Modified: 2007-12-19
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?
0
Comment
Question by:dtburdick
  • 3
  • 3
6 Comments
 
LVL 27

Expert Comment

by:Sammy
ID: 16943244
check for postback conditions in your code.
can you post the code for the pages with more explanation so we can see what maybe causing this behaviour?

0
 

Author Comment

by:dtburdick
ID: 16943379
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("SHOWCONFIRM","False");
                  Page.RegisterHiddenField("PARTNER","VeriSign");
                  Page.RegisterHiddenField("LOGIN","dodsbconference");
                  Page.RegisterHiddenField("TYPE","S");
                  Page.RegisterHiddenField("METHOD","CC");
                  Page.RegisterHiddenField("USER1","12345"); //ConfirmNumber
                  Page.RegisterHiddenField("AMOUNT","100");
                  Page.RegisterHiddenField("COMMENT1","");
                  Page.RegisterHiddenField("COMMENT2","");

                  Page.RegisterHiddenField("USER5",Request.Form["USER5"]);
                  this.lblUSER5.Text=Request.Form["USER5"];
                  Page.RegisterHiddenField("PONUM",Request.Params.Get("PONUM"));
                  this.lblPONUM.Text=Request.Params.Get("PONUM");
                  Page.RegisterHiddenField("NAME",Request.Form["NAME"]);
                  this.lblNAME.Text=Request.Form["NAME"];
                  Page.RegisterHiddenField("ADDRESS",Request.Form["ADDRESS"]);
                  this.lblADDRESS.Text=Request.Form["ADDRESS"];
                  Page.RegisterHiddenField("NAME",Request.Form["NAME"]);
                  this.lblNAME.Text=Request.Form["NAME"];
                  Page.RegisterHiddenField("CITY",Request.Form["CITY"]);
                  this.lblCITY.Text=Request.Form["CITY"];
                  Page.RegisterHiddenField("STATE",Request.Form["STATE"]);
                  this.lblSTATE.Text=Request.Form["STATE"];
                  Page.RegisterHiddenField("ZIP",Request.Form["ZIP"]);
                  this.lblZIP.Text=Request.Form["ZIP"];
                  Page.RegisterHiddenField("COUNTRY",Request.Form["COUNTRY"]);
                  this.lblCOUNTRY.Text=Request.Form["COUNTRY"];
                  Page.RegisterHiddenField("PHONE",Request.Form["PHONE"]);
                  this.lblPHONE.Text=Request.Form["PHONE"];
                  Page.RegisterHiddenField("EMAIL",Request.Form["EMAIL"]);
                  this.lblEMAIL.Text=Request.Form["EMAIL"];
                  Page.RegisterHiddenField("USER2",Request.Form["USER2"]);
                  this.lblUSER2.Text=Request.Form["USER2"];
                  Page.RegisterHiddenField("USER3",Request.Form["USER3"]);
                  this.lblUSER3.Text=Request.Form["USER3"];
                  Page.RegisterHiddenField("AMOUNT",Request.Form["AMOUNT"]);
                  this.lblAMOUNT.Text=Request.Form["AMOUNT"];
                  Page.RegisterHiddenField("USER4",Request.Form["USER4"]);
                  this.lblUSER4.Text=Request.Form["USER4"];
                  Page.RegisterHiddenField("CARDNUM",Request.Form["CARDNUM"]);
                  this.lblCARDNUM.Text=Request.Form["CARDNUM"];

                  this.lblExpMonth.Text=Request.Form["ddlExpMonth"];
                  switch (Request.Form["ddlExpMonth"])
                  {
                        case "01":
                              this.lblExpMonth.Text="January";
                              break;
                        case "02":
                              this.lblExpMonth.Text="February";
                              break;
                        case "03":
                              this.lblExpMonth.Text="March";
                              break;
                        case "04":
                              this.lblExpMonth.Text="April";
                              break;
                        case "05":
                              this.lblExpMonth.Text="May";
                              break;
                        case "06":
                              this.lblExpMonth.Text="June";
                              break;
                        case "07":
                              this.lblExpMonth.Text="July";
                              break;
                        case "08":
                              this.lblExpMonth.Text="August";
                              break;
                        case "09":
                              this.lblExpMonth.Text="September";
                              break;
                        case "10":
                              this.lblExpMonth.Text="October";
                              break;
                        case "11":
                              this.lblExpMonth.Text="November";
                              break;
                        case "12":
                              this.lblExpMonth.Text="December";
                              break;
                  }
 
                  this.lblExpYear.Text="20" + Request.Form["ddlExpYear"];

                  Page.RegisterHiddenField("EXPDATE",Request.Form["EXPDATE"]);

            }
0
 
LVL 27

Accepted Solution

by:
Sammy earned 125 total points
ID: 16943588
I just used the first 4 hidden fields and they all showed fine

<div>
<input type="hidden" name="ORDERFORM" id="ORDERFORM" value="False" />
<input type="hidden" name="ECHODATA" id="ECHODATA" value="True" />
<input type="hidden" name="SHOWCONFIRM" id="SHOWCONFIRM" value="False" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE3MDM2Nzk3MDEPZBYCAgMPZBYCAgEPEA9kFgIeCG9uY2hhbmdlBRZqYXZzY3JpcHQ6Q2hlY2tWYWx1ZSgpZGRkZBYfqo3dmQtCdXzyuAr/lvbuUI2f" />
</div>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dtburdick
ID: 16943946
Grrrrr.  Are you doing it using Page.RegisterHiddenField?

Is there anything that needs to be in place for Page.RegisterHiddenField to work?
0
 

Author Comment

by:dtburdick
ID: 16945232
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.
0
 
LVL 27

Expert Comment

by:Sammy
ID: 16945250
worked with the exact code eh?

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question