C# 跨域post,请求为空
正在尝试将下面的值发布到其他页面 本页C# 跨域post,请求为空,c#,post,dns,C#,Post,Dns,正在尝试将下面的值发布到其他页面 本页 将runat server添加到两个输入字段。像这样: <input runat="server" type="text" name="eml" id="eml" value="username"/> <input runat="server" type="text" name="pwd" id="pwd" value="password"/> <asp:Button ID="Button1" runat="server" T
将runat server添加到两个输入字段。像这样:
<input runat="server" type="text" name="eml" id="eml" value="username"/>
<input runat="server" type="text" name="pwd" id="pwd" value="password"/>
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="http://to.com/Default.aspx" />
var eml = eml.Value;
var pwd = pwd.Value;
它们不在同一应用程序中。不同的应用程序和域。在这种情况下,您需要在to.com/Default.aspx.cs中使用HttpWebRequest。我认为您目前尝试的方式不可能做到这一点。
<input runat="server" type="text" name="eml" id="eml" value="username"/>
<input runat="server" type="text" name="pwd" id="pwd" value="password"/>
<asp:Button ID="Button1" runat="server" Text="Button" PostBackUrl="http://to.com/Default.aspx" />
var eml = eml.Value;
var pwd = pwd.Value;