POST method to aspx form and user controls
I have a web application (STS) with Login.aspx form with username/password TextBoxes. In the code behined I process the textbox controls to sign in the user. (It is custom security token service and other web applications use it for single sign on. Normaly it works through redirects.)
From another web app (MyApp) I would like to sign in passing in username/password values (collected on MyApp's page). So I wrote a POST method request trying to emulate sign in on STS/Login.aspx. The request looks well but the solution does not work. The text box controls values are not set. Fortunately I can modify STS application and read the data from Request.Form collection. However, I 开发者_JAVA技巧would like to know if this is correct behavior or if it could be configured so that the Login.aspx form could get the data transparently in text box controls.
I examined the postback request generated by submit button directly from Login.aspx and my own generted POST request and they differ only in request's Referer and __VIEWSTATE (but viewstate is disabled for the page). Therefore I guess that asp.net checks the Referer and decides if it considers the rquest as postback or not and only if it is postback then it loads the data into controls. But it's just guess and I would like to know.
精彩评论