Click here to Skip to main content
15,886,919 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: webconfig Pin
arkiboys18-Feb-10 11:08
arkiboys18-Feb-10 11:08 
GeneralRe: webconfig Pin
The Man from U.N.C.L.E.18-Feb-10 8:30
The Man from U.N.C.L.E.18-Feb-10 8:30 
GeneralRe: webconfig Pin
arkiboys18-Feb-10 11:09
arkiboys18-Feb-10 11:09 
GeneralRe: webconfig Pin
The Man from U.N.C.L.E.19-Feb-10 6:24
The Man from U.N.C.L.E.19-Feb-10 6:24 
GeneralRe: webconfig Pin
Not Active18-Feb-10 8:44
mentorNot Active18-Feb-10 8:44 
GeneralRe: webconfig Pin
arkiboys18-Feb-10 19:50
arkiboys18-Feb-10 19:50 
GeneralRe: webconfig Pin
Not Active19-Feb-10 0:30
mentorNot Active19-Feb-10 0:30 
QuestionMultiple Dynamic Control Postback Issue [modified] Pin
smilingeyes7618-Feb-10 4:26
smilingeyes7618-Feb-10 4:26 
Good morning,

I've searched the web for a week to find a solution to a problem, but I can't figure it out, so now I'll try to post directly what the problem is and hope that someone could explain me how to go ahead. I'm new to Asp.Net, and some years have passed since I used to programme in C/C++.

I have an aspx page with two "Controller" textboxes.
If you insert a number X in TB1, on the OnTextChanged event, a Placeholder is populated with X TextBoxes (the number you entered).
If you insert a number H in TB2, on the OnTextChanged event, a Placeholder2 is populated with H TextBoxes (the number you entered).

The problem is that each time you enter a number you have a postback, hence after the first time, you loose all the data and the TextBox Controls in the PlaceHolder already populated. I cannot use Ajax UPdatePanel, so I know I should save the user data with the viewstate or Session, but i don't have idea of how to recall them to repopulate the PlaceHolder after Postback.

Here is my code C++C#(I tried to leave just the interesting parts).
<table>
    <tr><td valign="middle"></td>
             <td><asp:TextBox ID="cldtb" runat="server" OnTextChanged="cldtb_OnTextChanged" AutoPostBack="true"></asp:TextBox></td>
        <td valign="middle"><asp:Panel id="pnlEnterNumbers" runat="server">
           <asp:PlaceHolder id="myPlaceHolder" runat="server" /></asp:Panel> </td> </tr>

</table>


  protected void cldtb_OnTextChanged(object sender, System.EventArgs e)
  {
      int I, intNumberCount;

          // Get number of items to be entered.
          intNumberCount = System.Convert.ToInt16(cldtb.Text);

          if (intNumberCount > 0)
          {
              //Add one textbox to enter each item.
              System.Web.UI.WebControls.TextBox txtNumber;
              for (I = 1; I <= intNumberCount; I++)
              {
                  txtNumber = new System.Web.UI.WebControls.TextBox();
                  txtNumber.ID = "birthdate" + I;
                  txtNumber.MaxLength = 8;
                  myPlaceHolder.Controls.Add(txtNumber);

              }

              // Add number of items to viewstate
              ViewState["NumberCount"] = (I - 1);
              //Session["holdMe"] = myPlaceHolder;
          }
}
modified on Monday, February 22, 2010 5:52 AM

AnswerRe: Multiple Dynamic Control Postback Issue Pin
Not Active18-Feb-10 7:07
mentorNot Active18-Feb-10 7:07 
GeneralRe: Multiple Dynamic Control Postback Issue Pin
smilingeyes7620-Feb-10 7:13
smilingeyes7620-Feb-10 7:13 
QuestionUsing textbox with AJAX toolkit autocomplete control Pin
Danpeking18-Feb-10 3:31
Danpeking18-Feb-10 3:31 
Questioncheckboxs problem Pin
test-0918-Feb-10 1:36
test-0918-Feb-10 1:36 
AnswerRe: checkboxs problem Pin
Anurag Gandhi18-Feb-10 2:29
professionalAnurag Gandhi18-Feb-10 2:29 
GeneralRe: checkboxs problem Pin
test-0918-Feb-10 17:29
test-0918-Feb-10 17:29 
Questionneed date format in "dd/mm/yyyy hh:mm" [modified] Pin
Karan_TN18-Feb-10 1:16
Karan_TN18-Feb-10 1:16 
AnswerRe: need date format in "dd/mm/yyyy hh:mm" Pin
sashidhar18-Feb-10 1:31
sashidhar18-Feb-10 1:31 
GeneralRe: need date format in "dd/mm/yyyy hh:mm" Pin
Karan_TN18-Feb-10 1:35
Karan_TN18-Feb-10 1:35 
AnswerRe: need date format in "dd/mm/yyyy hh:mm" Pin
farogh haider18-Feb-10 1:49
farogh haider18-Feb-10 1:49 
GeneralRe: need date format in "dd/mm/yyyy hh:mm" Pin
Karan_TN18-Feb-10 2:37
Karan_TN18-Feb-10 2:37 
GeneralRe: need date format in "dd/mm/yyyy hh:mm" Pin
The Man from U.N.C.L.E.18-Feb-10 8:33
The Man from U.N.C.L.E.18-Feb-10 8:33 
QuestionView Word Document Problem While Publishing IIS Pin
JC.KaNNaN18-Feb-10 1:14
JC.KaNNaN18-Feb-10 1:14 
AnswerRe: View Word Document Problem While Publishing IIS Pin
Ashfield18-Feb-10 3:18
Ashfield18-Feb-10 3:18 
QuestionMessage Removed Pin
18-Feb-10 0:52
FEMDEV18-Feb-10 0:52 
AnswerRe: WCF Pin
sashidhar18-Feb-10 0:53
sashidhar18-Feb-10 0:53 
GeneralRe: WCF Pin
FEMDEV18-Feb-10 1:51
FEMDEV18-Feb-10 1:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.