Okay... I know having nested tags is not officially supported. But stay with me on this one..
I have an ASP.NET web page with the standard <form runat=server> tag at the top. I am pulling in a Form (and associated fields) from a 3rd party source via HttpWebRequest on the server side (code behind). I can verify the data I get contains a <form> tag -- via a Trace statement. Then I assign the data to my literal like this:
Dim objRequest As System.Net.HttpWebRequest = System.Net.WebRequest.Create(url) Dim objResponse As System.Net.WebResponse objRequest.Method = "POST" Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData.ToString) objRequest.ContentType = "application/x-www-form-urlencoded" objRequest.ContentLength = byteArray.Length Dim dataStream As Stream = objRequest.GetRequestStream() dataStream.Write(byteArray, 0, byteArray.Length) dataStream.Close() objResponse = objRequest.GetResponse() Dim streamRead As New StreamReader(objResponse.GetResponseStream()) Dim strResponse As String = streamRead.ReadToEnd() me.litCMSForm.Text = strResponse
When the page is rendered, somehow .NET removed the <form> tag that was within the literal.
I also tried assigning the variable "strResponse" to a public variable to be displayed and it too had the tag stripped out. And I tried assigning the variable to an asp:Label as well with no luck. And I tried assigning the value to the literal on the "PreRender" function with no success.
Any thoughts on this and why .NET is stripping out the <form> tag?
Thanks!