|
Hi,
i'm currently working in a .net web project.
i want to display the date in server side date format.
i'm getting the server side date as a string from a hidden control.
i want to convert that date string into javascript date object to get the date, month, and year.
var scheduleDate = new Date(hdnDate.value);
The above line of javascript code is working well for 'yyyy/MM/dd' date format;
That is returning 'NaN' for 'yyyy-MM-dd' and 'yyyy.MM.dd' date formats.
Can anybody help me in this.
Thanks in advance.
Regards,
Alagumani Boju.
|
|
|
|
|
If you represent the date as the number of millisenconds since 1970-01-01, you can safely create a Date object from that.
You can use (DateTime.Today - new DateTime(1970,1,1)).TotalMilliseconds to get the current date in milliseconds since 1970-01-01.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa's solution is the best. You should use it.
But, if for some reason you must have the dates in yyy-MM-dd format, just do new Date(hdnDate.value.replace(/-/g, '/')) . This uses a regex to match all - chars and then replaces them with the forward slash.
But yeah. If you control the format, please go with Guffa's solution. You'll have far fewer headaches.
every night, i kneel at the foot of my bed and thank the Great Overseeing Politicians for protecting my freedoms by reducing their number, as if they were deer in a state park. -- C hris L osinger, Online Poker Players?
|
|
|
|
|
hi all
can any budy tell me Using ASP
How to find how many SQL server running in network
and list them
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
hi, i am writing php scripts that have the following format:
/// logic in "plain" php
......... some calculations etc.
// html output (html mixed with php) using the php variables defined in logic , as an example
<br />
<?php<br><br />
if($emsg)<br><br />
echo $emsg;<br><br />
else<br><br />
{<br><br />
?><br><br />
<table width="100%" ><br><br />
<tr class="sunBlockHead"><br><br />
<td class="Stil1Head" align="center"><span><?php echo $th1;?></span></td><br><br />
<td class="Stil1Head" align="center"><span><?php echo $th2;?></span></td><br><br />
<td class="Stil1Head" align="center"><span><?php echo $th3;?></span></td><br><br />
</tr><br><br />
<?php foreach ($result as $item) if($item["eStatus"]=="ok")<br><br />
{?> <br><br />
<tr><br><br />
<td class="Stil1" style="text-align:right;" width="10%" ><?php echo $map_currency[$item["sCurrency"]].$item["decUsableValue"];?></td><br><br />
<td class="Stil1" width="30%"><br><br />
<span style="float:left"><?php echo $map_type[$item["eTypeOfExpiry"]]?></span><br><br />
<span style="float:right"><?php echo cleanDate($item["dDateOfExpiry"])?></span><br><br />
</td><br><br />
<td class="Stil1" style="text-align:left;"><?php echo !empty($item["sDisplayText"])?$item["sDisplayText"]:"Gutschein";?></td><br><br />
</tr><br><br />
<?php }?><br />
i am using dreamwaver, and i am asking if there is any visualization help that can hide the php code embedded in <?php ?> or hide the html code, so i can concentrate on one of both when i need to change smthg. thanks
-- modified at 5:10 Thursday 20th September, 2007
|
|
|
|
|
Hi All,
In my application I want to send mail onto the gmail through my ASP Page. If its posible plz help me.
thanx & Regards:
SMK
|
|
|
|
|
ASP.NET has mail classes, but they rely on a pop3 server. ASP has nothing of value. So, if you're using ASP.NET, you can send mail, but not through gmail. If you meant just ASP, then no.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: ASP.NET has mail classes, but they rely on a pop3 server. ASP has nothing of value. So, if you're using ASP.NET, you can send mail, but not through gmail. If you meant just ASP, then no.
If it's only for sending email, ASP.NET can use System.Net.Mail classes including SmtpClient class.
For classic ASP and hosted on Windows 2000 servers, you can use Microsoft Windows CDO (Collaborative Data Object) to send email.
For more information on CDO, visit this link:
http://msdn2.microsoft.com/en-us/library/ms527525.aspx[^]
regards,
Eriawan
|
|
|
|
|
Hi,
I've to use the Enterprise library3.0 for my application.Can anyone tell me how to use the library and implement C# code for that.
Thanks in advance
Babu
|
|
|
|
|
When you install Enterprise library on your machine, there will be numerous code samples installed along with it. Install the library and take a look at those.
|
|
|
|
|
I need code in C# to populate checkbox in gridview to delete records.
Please help.
Thank you
Saranya
|
|
|
|
|
Hi!
I am asuming that you have placed check box in your grid. You have a delete button in your page. When you click on that button, it will delete all records for which the check boxes were checked.
If you have a different scenario then plz let me know.
You can use the following code in the onclick event of that button.
protected void btnDelete_Click(object sender, ImageClickEventArgs e)
{
string strUserId = "";
foreach (GridViewRow gv in gvUsersToDelete.Rows) //traverse thru each row of the grid
{
//chkDelete is the name of the checkbox you placed in the grid. We first find that checkbox from the current gridview row and get it in a local checkbox type object, cb.
CheckBox cb = (CheckBox)gv.FindControl("chkDelete");
if (cb.Checked == true) // now check if the check box in this row is checked or not
{
// our grid had User ID in its column 0. So we are getting the userid from the 0th column in the //current row.
strUserId = gv.Cells[0].Text;
DeleteThisUser(strUserId); // passing userid to DeleteThisUser function.
}
}
}
private void DeleteThisUser(String strUserId)
{
// code to delete the matching strUserId.
}
“The woods are lovely, dark and deep. But I have promises to keep, and miles to go before I sleep.”
|
|
|
|
|
Hi all
In VS2005 how can i display a msg to save before leaving the current page ONLY if the user has made changes in this page else i dont want to display the msg.
Is this possible? I have seen this senario working in CRM.
thanks
|
|
|
|
|
Oh dear. Cross posting and reposting. Naughty naughty.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
ok ill check this out thanks alot
|
|
|
|
|
Hi,
I have a window from which I can open mutiple child windows. This child window in turn can open another window.Now I need to close all the child windows automatically when parent window is closed. How can i achieve this.
Thanks in Advance
Phanindra...
|
|
|
|
|
Keep a record in every page of the windows that has been opened, and in the onunload event close all those windows. When you close a child window, the onunload event will be triggered in that window, and it will close all it's child windows.
---
single minded; short sighted; long gone;
|
|
|
|
|
I'm not exactly an expert on PHP, but I am reasonably fluent. I've got some PHP code (that I didn't write) that does something like this:
$tmp = split(":", $subject, 2);
$cmd = str_replace("$tmp[0]:", "", $subject);
My question is about the first parameter of the str_replace function call. I would think this should be like so:
$cmd = str_replace(<code>$tmp[0].":"</code>, "", $subject);
Is this just some bizarre php construct?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Is this just some bizarre php construct?
Yes. In that specific example it certainly looks cleaner the second way (and is more effecient), but basically using double quotes in a string means that PHP will interpret the contents as potentially containing variables. For simple variables this is easy enough:
echo "hello $world";
However, there's nothing stopping you including more complex variables. It's generally a lot nicer (and in some cases, essential) to separate them with curly brackets:
echo "hello {$world->data[0]}";
|
|
|
|
|
That's just stupid, and makes the code harder to read besides.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Then it really *is* PHP code....
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi there,
is "<asp:calender>" and "<ajaxtoolkit:calender>" the same thing????
i saw in the asp.net/ajax official website about the sample calender control.
and in the calender properties it stated <ajaxtoolkit:calender>. but all i can find
in my toolbox in ajaxtookit is the calender extender control. there is a calender control
in the toolbox/standard though...
|
|
|
|
|
Hi,
the controls present with ajax tool kits are mostly control extenders means, it will extend the functionality present in existing asp.net server controls.
please check http://asp.net/AJAX/Control-Toolkit/Live/Calendar/Calendar.aspx for more information
|
|
|
|
|
yeah, that's the website that i'm talking abt.
are you saying that the sample in that site are merely extender??
there's 1 functionality in the calender sample(in that website)...that when i click the "month" name at the title bar of the calender..it will list all the months.
but i'm not able to achieve that functionality..
is it because i'm not using the extender that causes the problem.
thanx for the reply..
|
|
|
|
|
I have 10 aspx pages which all are to be converted to the PDF formate :
Please post if anyone has done it before or anyone has tool or dll like something.
i have convert some datatable to PDF but that is not enough : i have to convert whole page.
|
|
|
|