Solved

RegisterHiddenField doesn't create hidden field

Posted on 2006-06-20
6
538 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:dtburdick
Comment Utility
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
Comment Utility
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
Comment Utility
worked with the exact code eh?

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now