Results 1 to 2 of 2

Thread: Name of form is not declared

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    27

    Name of form is not declared

    Hello,

    I'm having a problem with some of my code. I've named the form and in the code it is not recognizing it.

    Here is the code:

    VB Code:
    1. Dim SB As New StringBuilder
    2.         Dim SW As New StringWriter(SB)
    3.         Dim htmlTW As New HtmlTextWriter(SW)
    4.  
    5.         formname.RenderControl(htmlTW)  ' Here is where Im getting the error
    6.  
    7.         Dim test As String = SB.ToString()
    8.         Dim i As String = test

    Here is part of the tags:
    Code:
    	</HEAD>
    	<body topmargin="0">
    		<form id="formname" runat="server">

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704

    Re: Name of form is not declared

    Did you declare it at the top of your page class?

    VB Code:
    1. Protected WithEvents formname As System.Web.UI.HtmlControls.HtmlGenericControl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width