Need help - I am thankful in advance for any advice

Discussion in 'ASP.NET / ASP.NET Core' started by Mahdi837, Aug 15, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi All,


    I am building a small asp.netweb application which involves inserting and selecting data from the database.
    In the web application I am using an HTML Component "TextArea1" which is a text area. The problem is that whenever I run the web I get the following exception "Name 'TextArea1' is not declared."

    How can I declare this HTML Component in the code that I can take the value which the user enters in it...

    This is from the .vb page



    Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click


    uatSupportSource4x.InsertCommandType = SqlDataSourceCommandType.Text


    uatSupportSource4x.InsertCommand = "INSERT INTO SUPPORT(TESTER_NAME, ACTIVITY, PROBLEM, SOLUTION, RELATED_EXCEPTION, PROB_DATE) VALUES ('" + TextBox1.Text + "', '" + DropDownList1.SelectedItem.Value.ToString + "', '" + TextArea1.Text + "' , 'Good', 'Good1', TO_DATE('05/08/2007 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'))"


    uatSupportSource4x.Insert()


    And this is how it is declared in the aspx page:





    <textarea id="TextArea1" style="width: 250px; height: 100px"></textarea>


    &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;<strong>Solution/Information:&amp;nbsp;</strong>


    <textarea id="Textarea2" style="width: 250px; height: 100px"></textarea>








    End Sub


    By the way - is there is any text area component in aspx???


    Many Thanks in Advance,


    Mahdi Haskia
     
  2. The following should work:

    aspx page:
    <textarea runat="server" id="textarea"></textarea>

    code:

    uatSupportSource4x.InsertCommand = "INSERT INTO SUPPORT(TESTER_NAME, ACTIVITY, PROBLEM, SOLUTION, RELATED_EXCEPTION, PROB_DATE) VALUES ('" + textarea.Value.ToString + "', '" + DropDownList1.SelectedItem.Value.ToString + "', '" + textarea.Value.ToString + "' , 'Good', 'Good1', TO_DATE('05/08/2007 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'))"

    Or as i specified in my other post set the standard TextBox control mode to multiline
    i.e. <asp:TextBox TextMode="MultiLine" .....




    Vikram

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Vikram...





    As usual - you are number 1





    Thanks [​IMG]
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page