我正在尝试为网站提供语言选择。我正在Asp.net中使用GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.server_client_id))
.build();
signInClient = GoogleSignIn.getClient(this, gso);
Intent signInIntent = signInClient.getSignInIntent();
startActivityForResult(signInIntent, 8877);
标签。我必须使用JavaScript,因为<a>
事件未显示方法后面的代码。但是我不知道如何在脚本标签中调用方法后面的代码。有人知道吗?请指教。
我的方法背后的代码:
onclick
这些是protected void ConvertToEN(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["Lang"];
if (cookie == null) cookie = new HttpCookie("Lang");
cookie.Value = "en-US";
Response.SetCookie(cookie);
Response.Redirect("First_Page.aspx");
}
标签:
<a>
答案 0 :(得分:0)
您可以使用LinkButton。
<asp:LinkButton ID="MyLinkButton" runat="server" OnClick="ConvertToEN">EN</asp:LinkButton>
C#
protected void ConvertToEN(object sender, EventArgs e)
{
HttpCookie cookie = Request.Cookies["Lang"];
if (cookie == null) cookie = new HttpCookie("Lang");
cookie.Value = "en-US";
Response.SetCookie(cookie);
Response.Redirect("First_Page.aspx");
}