|
i'm sorry to repeat the question
the first question is :
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 .. Internet status bar message " Error on page " .
the thing that make that the same code on a solution is work as good and another one doesn't work ..
remark ,, i copy the code as it from the source one to another.
if any one from our friends can aid my i will give him
jooooo
|
|
|
|
|
Yeah, you did ask this before. Did you respond to the answers you got ? Did you check the details of the error in the manner that I explained to you ? Did you try firefox/firebug to help you work out the problem ? Or did you just find nothing you could cut and paste to solve the issue, and so just posted it again ?
We can't help. We don't know what the error is. We've explained to you how to work that out, once you do, and can post with more info, then we can help more.
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 )
|
|
|
|
|
my friend ,,
take me easy
i swear i spent a day to try to solve it ,,
i download firebug ,,
the code is working with me on a project ,,
i copy it for another ,, without any result ,,,
the error is only that the status bar told me that error on page..
and what making me confused that the code is correct , and is working with another project ,,,,
i copy it and the java.js file and every thing is ok ,,
I know that this problem is obscure ,,
thanks for you my friend and also it's for you
jooooo
|
|
|
|
|
kindman_nb wrote: i download firebug ,,
But, did you use it ?
kindman_nb wrote: the error is only that the status bar told me that error on page..
If you click on the status bar, you should get a popup with more details. If you set your browser to how all errors, it will give you a popup right away. Any web dev should have this set.
But, if you actually USED firebug and set a breakpoint, you could check if your function was there, if it's being called, what line the error occurs on, etc.
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 )
|
|
|
|
|
How did you reference the javascript file??
Maybe you could post your code
Please dont paste too much code, just make a little example of a page with your hyperlink calling the js function
I had a problem similar, and the problem was the way i referenced the javascriptfile
Is the directories herarchy the same?? (Relative to the javascript file)
Alexei Rodriguez
|
|
|
|
|
really thanks my friend for your reply ..
I'm new on aps ,,,
AlexeiXX3 wrote: the problem was the way i referenced the javascriptfile
how can i do that ..
jooooo
|
|
|
|
|
|
You might run into problems again when you reference to masterpage from subdirectories
To avoid that, reference the js file in your masterpage as follows:
(Inside Body Tags)
<script src="<%= Me.ResolveURL("filename.js") %>" type="text/javascript"></script>
Alexei Rodriguez
|
|
|
|
|
ASP.Net seems to keep an eye out for some client side changes such as checkboxes, while completely ignoring other stuff. Losing Style.visibity information during postbacks really hurts for example.
Is there a way to make asp remember such changes, or to check them during postback, and set them myself?
|
|
|
|
|
If viewstate is turned on for a control, then changes are remembered. Any non server controls, are not remembered at all.
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 )
|
|
|
|
|
Viewstate only seems to remember specific changes. Look at the following code, for example.
if (!Page.IsPostBack)<br />
{<br />
string str = "<script type='text/javascript'>";<br />
str += "document.getElementById('CheckBox3').style.visibility='hidden';";<br />
str += "document.getElementById('CheckBox2').checked=true;"; <br />
str += "</script>"; <br />
Response.Write(str);<br />
}
It will add javascript to check checkbox2, and hide checkbox3 on the clicent side if it's not a postback. Now do a postback. Checkbox2 will stay checked, but checkbox3 will turn visible after a postback. Viewstate is enabled for both checkboxes.
|
|
|
|
|
Well, I am surprised it remembers the check, and you're lucky it works at all. This is silly code. Set the Visible and Checked properties on the .NET class instances, and both will be remembered.
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 )
|
|
|
|
|
It remembers the check, because that's how any html form remembers the check or textfield data during postback.
Of course this can be done on the server side and be remembered, and probably most examples are silly. This was not the question
Then think of this, as it's more like a real life example: The user can show or hide a div with a button (client side code). This div should not magically appear after a postback if it's hidden or vice versa.
Postback is slow. You don't want to postback and wait just to hide something, to change the backcolor or to sort a table when it can be done instantly on the client side.
|
|
|
|
|
derm2 wrote: Postback is slow. You don't want to postback and wait just to hide something, to change the backcolor or to sort a table when it can be done instantly on the client side.
I agree. But, when I do client side stuff, I don't expect viewstate to find it all, I would tend to use a server hidden control to store values telling me what I had done on the client side in script.
I get what you're saying, viewstate would be cooler if it worked better. I guess I'm just saying I'm glad when stuff works at all :P
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 )
|
|
|
|
|
Thanks for the input, the hidden field should do the job.
And we shall see what they make for us in the next version of ASP.net 
|
|
|
|
|
Hey
Well i have like 300 computers on my network and most of them are running on windows 98 .
my friend build a web application that asks the user for a catalog
number and in javasciprt it display the "catalognum.jpg"
the problem is that after the user load something like 20 pictures
the page is not showing more pictures,it's look like that there is no memory ....
here is most of the code
function myfunction(filpath)
{
if (filpath !== "")
{
imgtasrit.src = "DocLib/"+filpath+".jpg";
}
else
{
imgtasrit.src = "image003.gif";
}
}
/script>
.....
input type = button value="??? ?????" onclick="myfunction(form1.tb1dk.value)" align="right" id="Button1" >
i just wondering if there is way to clean the memory on client side ?
|
|
|
|
|
This is using ASP.NET ? I'd still ask in the web dev forum, as it's a generic client side question.
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 )
|
|
|
|
|
Hi.
I am creating a website that will have timed exams, I want to setup the timer in my asp.net application and I want the timer to be updated (using javascript) in th UI. when the time ends I want an automatic submission of the page.. any idea how to do this using asp.net + javascript? I also need to know the value of the timer each time the page is submitted..
Many Thanks
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
AJAX.............Will be helpful...
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Any details, plz?
I need the simplest way for implementing this thing . Thanks
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
You don't need AJAX at all, although you could use it. Just set a timer using one of the many javascript timer code examples that exist on the web. Set the users starting time on the server, and always use that to reset the timer on postback ( it's so easy to change client side script, you should never rely on it being correct ).
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 am writing a WebPart for SharePoint and am having trouble re-painting a control (not ASP control) when I want to reflect some scripting action.
My class inherits from "Microsoft.SharePoint.WebPartPages.WebPart".
I found the ASP listbox control lacking because I wanted to include a checkbox, graphics as well as text for each item.
An array of checkboxes contained within a div (for scrolling) contained in a feldset (for a border to contain the entire set) made for a good display of the data with the ability to access each item individuality.
The array is rendering the way I want it with a checkbox, icon and text for each item and the scrolling is working properly.
I am able to check and un-check each individual item in the array of checkboxes but the CheckAll() and ClearAll() functions are not checking or clearing all the items in the array.
Can anyone tell me what I need to do to make the CheckAll() and ClearAll() functions work?
In "protected override void RenderContents(HtmlTextWriter writer)"
<br />
writer.Write("<fieldset style='width: 760px;'>");<br />
writer.Write("<legend><strong>" + lblDocInfo.Text + "</strong></legend>");<br />
<br />
writer.Write("<div style='overflow: auto; height: 145px;'>");<br />
<br />
foreach (string folder_key in current_folders)<br />
{<br />
writer.Write("<input type=checkbox name='" + folder_key + "' id='" + folder_key + "'><img src='http://sharepointservername/projectname/websitename/icons/folder.ico' align='middle'> " + folder_key.Substring(folder_key.LastIndexOf("/") + 1) + "</input><br />");<br />
}
<br />
foreach (string doc_key in current_docs)<br />
{<br />
writer.Write("<input type=checkbox name='" + doc_key + "' id='" + doc_key + "'><img src='http://sharepointservername/projectname/websitename/icons/doc.ico' align='middle'> " + doc_key.Substring(doc_key.LastIndexOf("/") + 1) + "</input><br />");<br />
}
<br />
writer.Write("</div>");
<br />
writer.Write("</fieldset>");<br />
<br />
writer.Write("<br /><br />");<br />
writer.Write("<input id='btnCheckAll' type='button' value='Check All Documents' onclick='CheckAll();' style='width: 380px;' />");<br />
writer.Write("<input id='btnClearAll'type='button' value='Clear All Checked Documents' onclick='ClearAll();' style='width: 380px;' />");<br />
writer.Write("<br />");<br />
btnProcess.RenderControl(writer);<br />
writer.Write("<br /><br />");<br />
and further down in the code
<br />
writer.Write("<script type='text/javascript'>");<br />
<br />
writer.Write("function CheckAll(){");<br />
foreach (string doc_key in current_docs)<br />
{<br />
writer.Write("document.getElementById(doc_key).checked = true;");<br />
}
writer.Write("document.getElementById('btnClearAll').disabled = false;");<br />
writer.Write("}");
<br />
writer.Write("function ClearAll(){");<br />
foreach (string doc_key in current_docs)<br />
{<br />
writer.Write("document.getElementById(doc_key).checked = false;");<br />
}
writer.Write("document.getElementById('btnClearAll').disabled = true;");<br />
writer.Write("}");
<br />
writer.Write("</script>");<br />
|
|
|
|
|
What does it mean ?
How does it occur ?
and what should I do ?
It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Tnx
|
|
|
|
|
razi_Seyyedi wrote: This error can be caused by a virtual directory not being configured as an application in IIS.
There you go. I suggest you read the article I link to in my sig, especially the bit on researching error messages.
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 )
|
|
|
|
|
It means that you have an application level section in a web.config file that is not in the root folder of your web.
Either you have put an illegal section in a web.config file in a folder in your application, or what you think is the root folder of your application is just a folder in another application.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|