|
i have a bug and i dont know where it is... it is like i click on the button den the javascript is not responding to the button... And i am not sure is my code working a not... all i want to do is to count the different between 2 time; like end time is 03:00 start time is 02:00 so the different is 1hr... And thats what i wanna achieve... so can any kind souls help me debug pls...
var aryTimeAs = new Array();
var aryTimeAE = new Array();
var strTimeAS = new String("");
var strTimeAE = new String("");
var intASHours = new Number(0);
var intASMinutes = new Number(0);
var intASSeconds = new Number(0);
var intAEHours = new Number(0);
var intAEMinutes = new Number(0);
var intAESeconds = new Number(0);
var i = new Number(0);
var dtmAE;
var dtmAS;
var intNumOfSeconds = new Number(0);
var intNumberOfHours = new Number(0);
var intSeconds = new Number(0);
strTimeAS = ChangeManagement.txtActStartTime.value;
strTimeAE = ChangeManagement.txtActEndTime.value;
aryTimeAS = strTimeAS.split(":");
aryTimeAE = strTimeAE.split(":");
intASHours = aryTimeAS[0];
intASHours = aryTimeAS[1];
intAEHours = aryTimeAE[0];
intAEHours = aryTimeAE[1];
dtmAS = new Date();
dtmAS.setHours(intASHours);
dtmAS.setMinutes(intASMinutes);
dtmAS.setSeconds(intASSeconds);
dtmAE = new Date();
dtmAE.setHours(intAEHours);
dtmAE.setMinutes(intAEMinutes);
dtmAE.setSeconds(intAESeconds);
intNumSeconds = dtmAE.getTime() - dtmAS.getTime();
intSeconds = 60 * 60 * 1000;
i=Math.floor((intNumSeconds / intSeconds)*100);
intNumOfHours = i/100;
windows.alert(intNumOfHours);
ChangeManagement.txtActHr.value = intNumOfHours;
windows.event.returnValue = false;
Thanks for helping and viewing
i@@
|
|
|
|
|
Have you enabled Javascript error messages in the browser?
i@@ wrote: var aryTimeAs = new Array();
Typo. Change aryTimeAs to aryTimeAS.
intASHours = aryTimeAS[0];
intASHours = aryTimeAS[1];
Here you put the first value in the variable, then replaces it with the second value, making the first line useless. Also, the value you put in the variable is a string, not a number.
intAEHours = aryTimeAE[0];
intAEHours = aryTimeAE[1];
Same.
dtmAE = new Date();
dtmAE.setHours(intAEHours);
dtmAE.setMinutes(intAEMinutes);
dtmAE.setSeconds(intAESeconds);
You are not setting the date of the date object, so the current date is used. In the unlikely event that the date objects were created on each sides of midnight, you would get an additional 24 hours. Very nasty bug, as the error is nearly impossible to recreate.
windows.alert(intNumOfHours);
Typo. Change windows to window.
windows.event.returnValue = false;
Typo. Change windows to window.
---
b { font-weight: normal; }
|
|
|
|
|
var aryTimeAS = new Array();
var aryTimeAE = new Array();
var strTimeAS = new String("");
var strTimeAE = new String("");
var intASHours = new Number(0);
var intASMinutes = new Number(0);
var intAEHours = new Number(0);
var intAEMinutes = new Number(0);
var i = new Number(0);
var dtmAE;
var dtmAS;
var intNumOfSeconds = new Number(0);
var intNumberOfHours = new Number(0);
var intSeconds = new Number(0);
strTimeAS = ChangeManagement.txtActStartTime.value;
strTimeAE = ChangeManagement.txtActEndTime.value;
aryTimeAS = strTimeAS.split(":");
aryTimeAE = strTimeAE.split(":");
intASHours = aryTimeAS[0];
intASMinutes = aryTimeAS[1];
intAEHours = aryTimeAE[0];
intAEMinutes = aryTimeAE[1];
dtmAS = new Date();
dtmAS.setHours(intASHours);
dtmAS.setMinutes(intASMinutes);
dtmAE = new Date();
dtmAE.setHours(intAEHours);
dtmAE.setMinutes(intAEMinutes);
intNumSeconds = dtmAE.getTime() - dtmAS.getTime();
intSeconds = 60 * 60 * 1000;
i=Math.floor((intNumSeconds / intSeconds)*100);
intNumOfHours = i/100;
window.alert(intNumOfHours);
ChangeManagement.txtActHr.value = intNumOfHours;
window.event.returnValue = false;
dude i have recoded but it still wont works... do u have any other way of achieving the same thing... thanks for your time...
i@@
|
|
|
|
|
Repeating myself:
Have you enabled Javascript error messages in the browser?
---
b { font-weight: normal; }
|
|
|
|
|
I am using ASP.Net(VB).I want to display small images in datagrid along with button in same grid column and i want to inlarge the image on click of the button.
so pls help me and give code if it is possible.
|
|
|
|
|
hw can i post my asp website onto the net... i diuj have any idea
i@@
|
|
|
|
|
You may need to look for a hosting service provider.
|
|
|
|
|
Can I upload n download files into database using asp?
can anyone post the smaple code here...
thanks alot...
i@@
|
|
|
|
|
|
I'm using a master page on my asp.net site. Being that i'm using master pages and my content page part is only inside the body tag I can only put custom content inside each page's body.
However, to use google maps I have to edit the body tag by adding an attribute on-load="load()" . I only want it on one page, otherwise i'd just hard code that on the masterpage.
How can I, on one content page, add an attribute to the body tag?
/\ |_ E X E GG
-- modified at 22:19 Wednesday 28th June, 2006
|
|
|
|
|
If you're not worried about compliance issues, then just add a new tag inside the content area of the page you want to use Google Maps. Otherwise, I'm not sure if it's possible without adding it to the tag of the MasterPage.
|
|
|
|
|
Thanks it works. good hack!
/\ |_ E X E GG
|
|
|
|
|
No problem
Just keep in mind this will keep your page from meeting compliance standards, if you're worried it.
|
|
|
|
|
Alex,
Another option is that you can mark the body element in the Master with runat="server" and provide it with an id value. You may then define a public property to expose the body element so that the content page can access the body . You can also try to get reference to the body element from the content page with the FindControl method.
|
|
|
|
|
Hello all,
I'm in the middle of setting up a windows 2003 server for asp.net (with vb.net 2003) remote development/deployment.
The problem is that as soon as I install service pack 1 on windows 2003 I can no longer remotely develop asp.net apps with vs.net 2003. I have set-up servers with all the patches except service pack 1 and they work fine but as soon as I install service pack 1 it breaks the remote development of asp.net.
The error I get is that vs.net is "unable to add" files such as the project file (.vbproj) to the remote project.
I have made a screenshot of this error , it is at
http://www.matcmp.ncc.edu/error-after-sp1.jpg
I'm trying to upload via frontpage extensions.
I have double checked the IIS settings and front page extensions are enabled and so is asp and asp.net.
I have also tried installing all the other updates after sp1 and running security config. wizard and making sure all the ports and iis extensions are enabled but still same error. I have also tried turning off firewall.
Some files do get uploaded and a subdirectory does get created on the server but the error occurs and can't develop after that.
I know that one recommended way is to develop on local instance of IIS and then upload the project but this won't work in my case because this server is for a college class and students have to be able to work from home.
Thanks in advance for any help.
-Steve
|
|
|
|
|
Hmm. I just learned something interesting today. Apparently you can put custom headers into emails sent through .NET code from the link below.
http://www.systemnetmail.com/faq/3.3.4.aspx
Now, the next question is: Could you do the following:
1) Take one of the prebuilt forum systems and have it send out emails with a special header in them when someone posts to a message board
2) The user responds via email.
3) An application retrieves the response and automagically turns it into a forum post.
Basically, I was thinking sort of along the lines of Yahoo! groups. I may need to do this in a few months, so I thought I'd go ahead and ask.
|
|
|
|
|
http://www.codeproject.com/script/comments/forums.asp?forumid=12076&fr=151&select=1553164&msg=1553164
How to highlight today's date row in datagrid when page loaded?
I am really stuck in this issue.
Thanks,
NIKI
|
|
|
|
|
Done.
---
b { font-weight: normal; }
|
|
|
|
|
HI Niki,
what I wrote in the last thread was to change backcolor of one row only.
I got a new and easy Idea.
DO one thing, on the page load event, get the max date from the database, then in ItemDataBound compare that date with all the rows, which ever matches, change the backcolor of that row.
I think this is really easy
Thanks
Sushant Duggal.
Sushant Duggal.
|
|
|
|
|
Hi Sushant,
Thanks for the help.
Well, my data is coming from the xml file th' web service. I am retreiving it in the dataset. So, I don't think, I can get the Max value for date from that. second, your idea is only good if there is no today's or future dates.But you never know about that.
And one more thing, Is there any mechanism such that, i can pass the value from the datagrid to clientside javascript function which is displaying data without onclick, onmouseover event? I mean to say, when page load, The first row of the datagrid should be selected and the value of that row should pass to the javascript function which is displaying those data on page load.
I tried this:
e.attributes.add("onload","javascript:showdetails("'+parameter+'");");
but thats not working.
Can you have idea about that?
Thanks,
NIKI
|
|
|
|
|
Hi Niki,
You can still get the max date from the dataset generated from XML file.
And regarding today or future dates, you can put check for them too.
And regarding your second query, i am not sure when you want the values of the grid??? I mean where you want to use them? I haven't ever done this, I think you can take hidden variables and set them at the time of ItemDataBound of the grid, and then get the vaules of the hidden variables with getElementById.
Give it a try
Thanks,
Sushant Duggal.
|
|
|
|
|
Using asp.net to provide excel features of showing data in excel file in one work sheet and charts on another worksheet which is interactive . ie When you change the data , the graph in another sheet changes accordingly.
-- modified at 13:44 Wednesday 28th June, 2006
|
|
|
|
|
how to use popupmenu for the databound which is as hypherlink. i faced a problem plz hlp me
manjunath
|
|
|
|
|
I have a site where every web form is based off a MasterPage. In the master page I have a style sheet set. I'm also using urlMapping so I can stick all web forms in one folder but have them appear to be in different places to the users. For example, I have ~/Pages/News.aspx and ~/Pages/Profile.aspx, but they are accessed from the urls: ~/News/Default.aspx and ~/Profile/Default.aspx. Well that works fine and the only real point is so that I can keep the project better organized.
Now the MasterPage engine is having trouble with the style sheet, normally if you have a page based on a master page it adjusts the path to the stylesheet so that the styles load properly in the browser. I don't think it likes the urlMapping becuase its not adjusting the path. The stylesheet is in ~/Style/Default.css and if I load a web form in the root directory "Style/Default.css" appears in the html when I got view source. Now if I access ~/Pages/News.aspx by directly typing that into the address bar the stylesheet says "../Style/Default.css" in the rendered html. However, if I go through the url mapping by going to ~/News/ it has "Style/Default.css" in the rendered page which is obviously not going to load the page.
Is this a known issue (and if so, is there a fix or workaroud) or am I doing something wrong?
|
|
|
|
|
Don't know if it will make a difference but have you tried using themes instead of css?
Are you setting the SytleSheetTheme in the page or in the web.config?
|
|
|
|