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
i m not sure how to pass query string 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
The problem it seems to be in string creation.
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>"
);
精彩评论