开发者

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>"
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜