[英]query string in javascript function
i have written the below code now i want to check whether the below code is write bcoz when i run the program it gives me a error help needed am i doing something wrong in below code if yes plz rectify me 我已经写了下面的代码现在我想检查下面的代码是否是写bcoz当我运行程序它给我一个错误帮助需要我在下面的代码做错了如果是的话PLZ纠正我
im not sure how to pass query string throrugh javascript 我不知道如何传递查询字符串throrugh javascript
Page.ClientScript.RegisterClientScriptBlock
(this.GetType(), "OnClick", "<script language=javascript>window.opener.location.href='~/Home.aspx?Flag= + iFlag + &BetaFlag= + iFlagBeta + &iManuf= + iManuf';</script>"
);
thanks in advance 提前致谢
它似乎是在字符串创建中的问题。
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "OnClick", "<script language=javascript>window.opener.location.href='~/Home.aspx?Flag=" + iFlag + "&BetaFlag=" + iFlagBeta + "&iManuf=" + iManuf + "';</script>");
Try this: 尝试这个:
Page.ClientScript.RegisterClientScriptBlock
(this.GetType(), "OnClick",
@"<script language=javascript>
window.opener.location.href='~/Home.aspx?Flag=" + iFlag + "&BetaFlag=" + iFlagBeta + "&iManuf=" + iManuf + "';</script>"
);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.