1

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

0

2 Answers 2

3

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>");
Sign up to request clarification or add additional context in comments.

Comments

1

Try this:

Page.ClientScript.RegisterClientScriptBlock
    (this.GetType(), "OnClick", 
    @"<script language=javascript>
        window.opener.location.href='~/Home.aspx?Flag=" + iFlag + "&BetaFlag=" + iFlagBeta + "&iManuf=" + iManuf + "';</script>"
);

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.