开发者

jQuery not working on Popup Window

开发者 https://www.devze.com 2022-12-24 15:02 出处:网络
I am using ASP.Net and jQuery + jQuery UI. Ever开发者_StackOverflow中文版ything works fine with the jQuery on any other page, however when I create a popup window with window.open(...) jQuery seems to

I am using ASP.Net and jQuery + jQuery UI. Ever开发者_StackOverflow中文版ything works fine with the jQuery on any other page, however when I create a popup window with window.open(...) jQuery seems to no longer function.

I have all of the script files included on the Popup's Master page, so am not sure why it won't fire.

Any Thoughts?


I am not sure if you use window.open you are creating a page class that inherits from the master page.

So JQuery is probabaly not included in that pop up. In addition popups aren't nice. people download all kind of things so they don't open. but it can be done like this:

protected void Button1_Click(object sender, EventArgs e)


{


string queryString = 


    "http://localhost:39208/TreeView.aspx?param1=" 


    + TextBox1.Text.Trim();   


string newWin = 


    "window.open('" + queryString + "');";


ClientScript.RegisterStartupScript


    (this.GetType(), "pop", newWin, true);


}

ClientScript.RegisterStartupScript will bring your jquery in the pop up

0

精彩评论

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

关注公众号