"gustav" <gu*****@webserver.com.arwrote in message
news:uW*************@TK2MSFTNGP03.phx.gbl...
I canīt believe thath with ASP.NET we loose the ability to make POST
requests to another webforms in another application...
I say this because of my last question "Redirect by POST method to another
applications" , which had two answers, but none of them so simple like in
the old ASP:
<form name="form2" method="post"
action="http://anotherServer/anotherApp/anotherForm.aspx">
<input name="user" type="text" id="user"/>
<input name="password" type="password" id="password" />
</form>
Any opinions?
One possible work around in some situations is you can use the override
render to change to action on the form as follows.
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
Dim _stringBuilder As StringBuilder = New StringBuilder()
Dim _stringWriter As StringWriter = New StringWriter(_stringBuilder)
Dim _htmlWriter As HtmlTextWriter = New HtmlTextWriter(_stringWriter)
MyBase.Render(_htmlWriter)
Dim html As String = _stringBuilder.ToString()
Dim start As Integer = html.IndexOf("action=")
if start <-1 then
html = html.Insert(start + 8, "someother place to post")
end if
writer.Write(html)
End Sub