Using javascript functions ?
-
hi,, on my project asp.net with c# I added a javascript item for eg,, name : JS.js and made the next function :
function PopUpQtyWindow(id) { window.open("productqty.aspx?id=" + id, "Cart", "status = 1, height = 150, width = 200, resizable = 0"); }
then on any page i tried to call this function as next :int prodID = 1 ; HyperTest.NavigateUrl = "javascript:PopUpQtyWindow(" + prodID + ");";
when running project and press the hyperTest .. status message " Error on page " . thanks for all .jooooo
-
hi,, on my project asp.net with c# I added a javascript item for eg,, name : JS.js and made the next function :
function PopUpQtyWindow(id) { window.open("productqty.aspx?id=" + id, "Cart", "status = 1, height = 150, width = 200, resizable = 0"); }
then on any page i tried to call this function as next :int prodID = 1 ; HyperTest.NavigateUrl = "javascript:PopUpQtyWindow(" + prodID + ");";
when running project and press the hyperTest .. status message " Error on page " . thanks for all .jooooo
-
hi,, on my project asp.net with c# I added a javascript item for eg,, name : JS.js and made the next function :
function PopUpQtyWindow(id) { window.open("productqty.aspx?id=" + id, "Cart", "status = 1, height = 150, width = 200, resizable = 0"); }
then on any page i tried to call this function as next :int prodID = 1 ; HyperTest.NavigateUrl = "javascript:PopUpQtyWindow(" + prodID + ");";
when running project and press the hyperTest .. status message " Error on page " . thanks for all .jooooo
You can click on that error message to show you details, so you can see what the error is. Either the function is not present, or it's got an error in it. I would recommend installing firefox and the firebug add on, then you can debug your javascript inside the browser.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
-
1. What error message you get? 2. Do you have configuration like down below?
. . . . . .
I Love T-SQL
thanks for your reply my friend the error message is appear on the status bar of the internet explorer : Error on page, that is the error message ,, no debug
jooooo
-
You can click on that error message to show you details, so you can see what the error is. Either the function is not present, or it's got an error in it. I would recommend installing firefox and the firebug add on, then you can debug your javascript inside the browser.
Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
I will install it and try ,, thanks my friend
jooooo
-
hi,, on my project asp.net with c# I added a javascript item for eg,, name : JS.js and made the next function :
function PopUpQtyWindow(id) { window.open("productqty.aspx?id=" + id, "Cart", "status = 1, height = 150, width = 200, resizable = 0"); }
then on any page i tried to call this function as next :int prodID = 1 ; HyperTest.NavigateUrl = "javascript:PopUpQtyWindow(" + prodID + ");";
when running project and press the hyperTest .. status message " Error on page " . thanks for all .jooooo
-
Hi, Test this way:
protected void HyperTest_OnClick(object sender, EventArgs e) { try { int prodID = 1 ; Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true); } catch (Exception ex) { throw; } }
Really thanks for your reply .. on my example the code as next :
HyperTest.NavigateUrl= ....
when i use the code :HyperTest.NavigateUrl= Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true);
then error message:Cannot implicitly convert type 'void' to 'string'
thanks for aiding mejooooo
-
Really thanks for your reply .. on my example the code as next :
HyperTest.NavigateUrl= ....
when i use the code :HyperTest.NavigateUrl= Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true);
then error message:Cannot implicitly convert type 'void' to 'string'
thanks for aiding mejooooo
No no, HyperTest.NavigateUrl is wrong. Say, I test your code in this way:
function PopUpQtyWindow(prodID) { alert(prodID); }
And in behind:protected void testClick(object sender, EventArgs e) { int prodID = 1; Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true); }
This code is working on both IE and firefox browsers. -
No no, HyperTest.NavigateUrl is wrong. Say, I test your code in this way:
function PopUpQtyWindow(prodID) { alert(prodID); }
And in behind:protected void testClick(object sender, EventArgs e) { int prodID = 1; Page.ClientScript.RegisterStartupScript(Page.GetType(), "mykey", "PopUpQtyWindow(" + prodID + ");", true); }
This code is working on both IE and firefox browsers.so thanks my friend :rose::rose::rose: now it's ok
jooooo