Solved

RegisterHiddenField doesn't create hidden field

Posted on 2006-06-20
6
548 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

687 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