|
Using the JavaScriptSerializer class[^]. Add a reference to System.Web.Extensions if you don't already have one, and import the System.Web.Script.Serialization namespace. Then use:
new JavaScriptSerializer().Serialize(yourDateValue)
Alternatively, you could use JSON.NET[^] and specify MicrosoftDateFormat for the DateFormatHandling setting[^]:
JsonConvert.SerializeObject(yourDateValue, new JsonSerializerSettings { DateFormatHandling = DateFormatHandling.MicrosoftDateFormat })
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
great, it works!
thanks
|
|
|
|
|
( month and year )searching are date-time query in sql-server Plz Help
|
|
|
|
|
Please use correct forum and your question is Not clear. please describe bit more
If you wants to get records in sql by month and year wise then split the datetime value into month & year in front end and pass it to sql
Try this
create procedure [dbo].[sp_test]
@date datetime =null,
@month datetime =null,
@year datetime =null,
@type int
as
begin
if(@type =1)
select * from tablename where month(getdate) =@month and YEAR(getdate)=@year
end
To learn all there is to know. I know I'll be disappointed one day, but I've made a good start, and the eventual disappointment is likely to be brief.
-Roger Wright
|
|
|
|
|
What? This is not clear.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
how to convert value date-time ?
|
|
|
|
|
How can we help with this?your question doesn't make any sense at all. Improve your question with more info
To learn all there is to know. I know I'll be disappointed one day, but I've made a good start, and the eventual disappointment is likely to be brief.
-Roger Wright
modified 17-Feb-14 8:30am.
|
|
|
|
|
As with your other question, this one does not make any sense. Please clarify.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Do you want to convert a SQL DateTime to a C# DateTime ?
Light or darkness, we must choose ...
|
|
|
|
|
plz give the free sms gateway for asp.net , Gateway like http://ubaid.tk
The above mentioned gateway is not currently working so i am asking u sir.
Sir, I Hope u will give the correct solution for my Question.
|
|
|
|
|
|
Quote: Sorry, only 297,000 results found SELECT TOP 10 * FROM google_results
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Quick question..
I have WebAPI - like /api/SomeName
Called directly in my browser, it works - it returns JSON results.
I want to call WebAPI asynchronously.
using (HttpClient httpClient = new HttpClient())
{
string response = await httpClient.GetStringAsync("/api/SomeName");
return response;
}
But the GetStringAsync NEVER returns! Aaaarrrg
Is this the correct way to call it - of should I do something else?
Any tips? Advice? Hints?
maker of .Net thingys
|
|
|
|
|
Doesn't GetStingAsync returns Task<string>?
You may got an error that does not show up?
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
perhaps.
I'm closing the question and continuing down a different path.
Thanks though..
maker of .Net thingys
|
|
|
|
|
You could use jQuery's .ajax() method to call asynchronously from the client side, if you are using a browser. http://api.jquery.com/jQuery.ajax/[^]
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I have a Menu Control in my ASP.Net page. The click event is not firing. Can anyone help me why the event is not firing.
|
|
|
|
|
Need more details. Please don't think anyone can help you with a question like that.
It's as bad as "My car doesn't start".
What's the technology stack you're using for asp.net? What version?
Are you trying to do this from javascript, or by code behind, or event routing? What version of VS? Are you even using VS?
Any code to share???
GaltSalt
maker of .Net thingys
|
|
|
|
|
ems>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home" />
<asp:MenuItem NavigateUrl="~/Research.aspx" Text="Research" />
<asp:MenuItem NavigateUrl="~/Team.aspx" Text="Team" />
<asp:MenuItem NavigateUrl="~/Methods.aspx" Text="Methods" />
<asp:MenuItem NavigateUrl="~/Excel Report.aspx" Text="Case Studies" />
<asp:MenuItem NavigateUrl="~/RehabAnalytics.aspx" Text="RehabAnalytics" />
<asp:MenuItem NavigateUrl="~/InputTestResults.aspx" Text="InputTestResults" />
protected void NavigationMenu_MenuItemClick(object sender, MenuEventArgs e)
{
e.Item.Selected = true;
}
|
|
|
|
|
Hi Rahesh,
Try like this.
<asp:Menu ID="NavigationMenu" OnMenuItemClick="NavigationMenu_MenuItemClick" runat="server">
<items>
<asp:MenuItem Text="menuItem1" NavigateUrl="Default.aspx" />
<asp:MenuItem Text="menuItem2" NavigateUrl="otherWeb.aspx" />
</items>
Internet Explorer have some issues with this , try in different browsers
|
|
|
|
|
Kandepu - was this solved?
maker of .Net thingys
|
|
|
|
|
Quote: "My car doesn't start". It's one of your spark plugs, duh.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Don't laugh! Many moons ago, I saw a 1972 Mercedes 220 in beautiful condition in a mechanic's yard. I asked how much he wanted for it. He said "Never mind, it don't work". But how much, I insisted.. "Oh, $500 I guess..." Paid it on the spot. Tried to get it to turn over; no joy - the mechanic sneered. Opened the hood - and noted that for that year, the spark plug cables were out of order from the distributor. Rearranged the cables, started it up and drove of... lol His wife came barreling out of the office yelling at the mechanic to get the car back.... I smiled as I passed by, saying Thank you!
maker of .Net thingys
|
|
|
|
|
That's great.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hi Rajesh,
Try like this,
<asp:Menu ID="NavigationMenu" OnMenuItemClick="NavigationMenu_MenuItemClick" runat="server">
<items>
<asp:MenuItem Text="menuItem1" NavigateUrl="Default.aspx" />
<asp:MenuItem Text="menuItem2" NavigateUrl="otherWeb.aspx" />
</items>
IE have some problems, so try in diff. browsers
|
|
|
|