sys.WebForms.PageRequestManagerServerErrorExceptio n: An unknown error occured while p

Joined
Dec 12, 2008
Messages
2
Reaction score
0
Code:
I am creating a dynamic form and i am having a aproblem attaching a submit BTN

when i do i get

sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned from the server was: 500

as if it was a javaScrip error and nothing happens

Code:
    private void basicRestaurantInfo(int Intid)
    {
        RestaurantDAL restaurantDb = new RestaurantDAL();
        //RestaurantDetailDataALL detail;
        List<RestaurantDetailDataALL> detail = null;
        detail = restaurantDb.GetRestaurantDetailALL();
        if (detail != null && detail.Count > 0)
        {

            int myCount = 1;
            foreach (RestaurantDetailDataALL data in detail)
            {
 /* CREATING DYNAMIC TABLE */

                    Table tbl_Dynamic = new Table(); 
                    tbl_Dynamic.BorderWidth = 1; 
                    tbl_Dynamic.CellSpacing = 10; 
                    tbl_Dynamic.CellPadding = 10;
                    tbl_Dynamic.Width = 760;
                    tbl_Dynamic.BorderColor = System.Drawing.Color.Black; 


                   
                    tbl_Dynamic.HorizontalAlign = HorizontalAlign.Center;
                   
                    /* CREATE TITLE ROW */
                    TableRow tbl_Dynamic_Row_1 = new TableRow(); //TR ROW
                    TableCell tbl_Dynamic_Row_1_Cell_1 = new TableCell(); //TD COLUMN

                    tbl_Dynamic_Row_1_Cell_1.ColumnSpan = 3;
                    
                    tbl_Dynamic_Row_1_Cell_1.Text = string.Format("<center><strong>{0}</strong></center>", data.RestaurantName);
                    tbl_Dynamic_Row_1.Controls.Add(tbl_Dynamic_Row_1_Cell_1);

                    /* CREATE DISPLAY TEXT ROW */
                    TableRow tbl_Dynamic_Row_2 = new TableRow(); //TR ROW
                    TableCell tbl_Dynamic_Row_2_Cell_1 = new TableCell(); //TD COLUMN
                    TableCell tbl_Dynamic_Row_2_Cell_2 = new TableCell(); //TD COLUMN

                    tbl_Dynamic_Row_2_Cell_1.Text = string.Format("<strong>Display Text</strong>");
                    tbl_Dynamic_Row_2_Cell_2.ColumnSpan = 2;
                    
                     //// CREATE TEXT BOX 
                    TextBox DisplayText = new TextBox();
                    DisplayText.Width = 600;
                    DisplayText.Height = 200;
                    DisplayText.TextMode = TextBoxMode.MultiLine;
                    DisplayText.ID = "DisplayText";
                    DisplayText.Text = data.DescriptionWritten;
                    
                    tbl_Dynamic_Row_2_Cell_2.Controls.Add(DisplayText);

                    tbl_Dynamic_Row_2.Controls.Add(tbl_Dynamic_Row_2_Cell_1);
                    tbl_Dynamic_Row_2.Controls.Add(tbl_Dynamic_Row_2_Cell_2);

                    /* CREATE READ TEXT ROW */
                    TableRow tbl_Dynamic_Row_3 = new TableRow(); //TR ROW
                    TableCell tbl_Dynamic_Row_3_Cell_1 = new TableCell(); //TD COLUMN
                    TableCell tbl_Dynamic_Row_3_Cell_2 = new TableCell(); //TD COLUMN
                    TableCell tbl_Dynamic_Row_3_Cell_3 = new TableCell(); //TD COLUMN

                    tbl_Dynamic_Row_3_Cell_1.Text = string.Format("<strong>Read Text</strong>");

                    tbl_Dynamic_Row_3_Cell_3.Text = string.Format("ORIGINAL TEXT<br><a onclick=\"playText('{3}')\"><img src={0} border={1} alt={2}/></a>", "images/ico/playAudioIcon.jpg", "0", "Play Intro Speech", data.LearnMoreSpeech);

                    //// CREATE TEXT BOX 
                    TextBox ReadText = new TextBox();
                    ReadText.Width = 600;
                    ReadText.Height = 100;
                    ReadText.TextMode = TextBoxMode.MultiLine;
                    ReadText.ID = "ReadText";
                    ReadText.Text = data.LearnMoreSpeech;

                    tbl_Dynamic_Row_3_Cell_2.Controls.Add(ReadText);

                    tbl_Dynamic_Row_3.Controls.Add(tbl_Dynamic_Row_3_Cell_1);
                    tbl_Dynamic_Row_3.Controls.Add(tbl_Dynamic_Row_3_Cell_2);
                    tbl_Dynamic_Row_3.Controls.Add(tbl_Dynamic_Row_3_Cell_3);

                    /* CREATE Intro Speech  TEXT ROW */
                    TableRow tbl_Dynamic_Row_4 = new TableRow(); //TR ROW
                    TableCell tbl_Dynamic_Row_4_Cell_1 = new TableCell(); //TD COLUMN
                    TableCell tbl_Dynamic_Row_4_Cell_2 = new TableCell(); //TD COLUMN
                    TableCell tbl_Dynamic_Row_4_Cell_3 = new TableCell(); //TD COLUMN

                    tbl_Dynamic_Row_4_Cell_1.Text = string.Format("<strong>Intro Speech </strong>");
                    tbl_Dynamic_Row_4_Cell_2.Text = string.Format("{0}<br>", data.DescriptionSpeech);
                    tbl_Dynamic_Row_4_Cell_3.Text = string.Format("ORIGINAL TEXT<br><a onclick=\"playText('{3}')\"><img src={0} border={1} alt={2}/></a>", "images/ico/playAudioIcon.jpg", "0", "Play Intro Speech", data.DescriptionSpeech);

                    //// CREATE TEXT BOX 
                    TextBox IntroSpeech  = new TextBox();
                    IntroSpeech.Width = 600;
                    IntroSpeech.Height = 100;
                    IntroSpeech.TextMode = TextBoxMode.MultiLine;
                    IntroSpeech.Text = data.DescriptionSpeech;
                    IntroSpeech.ID = "IntroSpeech";
                    tbl_Dynamic_Row_4_Cell_2.Controls.Add(IntroSpeech);


                    tbl_Dynamic_Row_4.Controls.Add(tbl_Dynamic_Row_4_Cell_1);
                    tbl_Dynamic_Row_4.Controls.Add(tbl_Dynamic_Row_4_Cell_2);
                    tbl_Dynamic_Row_4.Controls.Add(tbl_Dynamic_Row_4_Cell_3);


                    /* CREATE SUBMIT ROW */
                    TableRow tbl_Dynamic_Row_5 = new TableRow(); //TR ROW
                    TableCell tbl_Dynamic_Row_5_Cell_1 = new TableCell(); //TD COLUMN

                    tbl_Dynamic_Row_5_Cell_1.ColumnSpan = 3;
                    tbl_Dynamic_Row_5_Cell_1.Width = 300;

                    //System.Web.UI.WebControls.Button btnSubmit = new System.Web.UI.WebControls.Button();
                   // btnSubmit.Text = "Update";
                    //btnSubmit.Click += new EventHandler(btnSubmit_Click);


                    


                    tbl_Dynamic_Row_5_Cell_1.Controls.Add(btnSubmit);
                    
                    tbl_Dynamic_Row_5.Controls.Add(tbl_Dynamic_Row_5_Cell_1);



                    tbl_Dynamic.Controls.Add(tbl_Dynamic_Row_1);
                    tbl_Dynamic.Controls.Add(tbl_Dynamic_Row_2);
                    tbl_Dynamic.Controls.Add(tbl_Dynamic_Row_3);
                    tbl_Dynamic.Controls.Add(tbl_Dynamic_Row_4);
                    tbl_Dynamic.Controls.Add(tbl_Dynamic_Row_5);

                    UpdatePanel1.ContentTemplateContainer.Controls.Add(tbl_Dynamic); //test
                    

                }
                myCount++;

            }

           
        }


Code Front

Code:
    <form id="productform" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>

                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <asp:Button ID="btnSubmit" runat="server" Text="Update" onclick="btnSubmit_Click" name="btnSubmit" />
</form>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top