|
I want to enter Leave Date from(01:12:2006)to(01:01:2007)and see the duration of 1 month.Can any one send the code... It's Urgent.
Thanks in Advance...
|
|
|
|
|
Kasi Viswanathan wrote: It's Urgent.
Please don't say this. It's rude. This is a free site and people will provide assistance in their own time.
Do you want to add a month to a particular date? If so, did you check the documentation? The DateTime class has an AddMonths method.
Paul
|
|
|
|
|
I want to enter out time of(02:42:15) with in time of(02:43:20)and see the duration of (00:01:05).Can any one send the code... It's Urgent.
Thanks in advance
|
|
|
|
|
TimeSpan Diff = TimeSpan.Parse("02:43:15") - TimeSpan.Parse("02:42:20");
Best Regard
Pathan
---------------------------------------------------
|
|
|
|
|
Kasi Viswanathan wrote: out time of(02:42:15) with in time of(02:43:20)
Try this :
TimeSpan T1=new TimeSpan(System.DateTime.Now.Day,System.DateTime.Now.Hour,System.DateTime.Now.Minute,System.DateTime.Now.Second,System.DateTime.Now.Millisecond);<br />
<br />
TimeSpan T2=new TimeSpan(System.DateTime.Now.Day,System.DateTime.Now.Hour,System.DateTime.Now.Minute,System.DateTime.Now.Second,System.DateTime.Now.Millisecond);<br />
<br />
string ans = T2.Subtract(T1).ToString();<br />
Hope this will help you !!
Regards,
Abhi
|
|
|
|
|
hi friends,
I have a game file(.swf) stored in folder and its path is stored and retieved from database ......i have to click the path link and onclick i have to run the game file ..........pls help me in this regard........
thanks
note-am developing my site in asp.net.
sai krishna
|
|
|
|
|
I think that it should be depend on Flash object. For example, the video from youtube doesn't play automatically but it shows "Play" button on that video. If you wanna play that video, you just need to click "Play" button.
In fact, there should be something (eg: button) that can start the game in your flash object...
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Hi,
How to set a background image in a ListBox control. And when i take a printout of this, back ground image should be appeared in the printout. I am using VS 2003 and language is C#. I am new to .NET. Please suggest me the proper solution.
Thank u
|
|
|
|
|
This is a web application ?
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 )
|
|
|
|
|
Yes this is a web application
thanks
|
|
|
|
|
ya...its a web application
|
|
|
|
|
Our application needs to support multilanguage(UTF-8). Web.Config entries are encoded to UTF-8. We are using ajax and passing some special characters in querystring which are automatically removed when it comes to the aspx page. When we debug javascript the URL is showing the exact string when calling XMLHTTP send method. Javascript escape also didn't work. Any ideas on how to go about?
|
|
|
|
|
What about "encodeURIComponent() " link] ?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
im creating controls html ul and li on server side, but wen the aplication is running i want to show a friendly code html...
this is my code:
HtmlGenericControl ul = new HtmlGenericControl("ul");<br />
ul.Attributes.Add("class", "mylist");<br />
HtmlImage img = new HtmlImage();<br />
img.Src = "../Handler.ashx?id=" + (int)row["id"] + "&height=100&width=100";<br />
HtmlGenericControl li = new HtmlGenericControl("li");<br />
li.Attributes.Add("class", "imgProd");<br />
li.Controls.Add(img);<br />
ul.Controls.Add(li);
so when this code is running... on client side... i have something like this:
<'ul'><'li'>image blablabla<'/li'><'/ul'>
all this in one line!!
but i want to break line AFTER some close tags... to create a code like this:
<'ul'>
<'li'>image blablabla<'/li'>
<'/ul'>
this on server side! Can anyone help me whit this!?
obs: I put the ' ,here in message, cause on forum it was renderized as real tags ... =/
Gustavo Ushijima
|
|
|
|
|
I would then suggest you use a StringBuilder object and build the HTML code that way, so you can control the formatting.
StringBuilder sb = new StringBuilder();
sb.AppendLine("<ul class='mylist'>");
sb.AppendLine("<li class='imgProd'><img src='../Handler.ashx?id=" + (int)row["id"] + "&height=100&width=100;></li>");
sb.AppendLine("</ul>");
Response.Write(sb.ToString());
You might be able to use the HtmlTextWriter as well, but I haven't looked at it too much. It appears to have a method for WriteLine and an Indent property so that can help you format the output as well.
-- modified at 19:33 Friday 21st September, 2007
|
|
|
|
|
this works too, but whit the response.write i cannot especify where this codes will appear... and sometimes i´ll nedd to add a control inside the tags li...
using the estructure that i posted before... isnt a method to break line after LI´s tags??
in the code...
htmlgenericControls li = new htmlgenericControls("li");
something like this:
li.after_close_tags = "\r" or Eviromet.NewLine or anything else to format this output?
|
|
|
|
|
Dear all,
I have 3 buttons placed one above the other inside template of gridvew.
I want to the buttons one after the other on click on them like cards.
Can any one give the code or give me sollution?
sanjay kumar samantaray
|
|
|
|
|
I have no idea what you're asking.
Please consider rephrasing the question.
Paul
|
|
|
|
|
dear all ,
i want to change the color of gridview's cell dyanamically,
default color is green.
on click on green cell it should be yellow.
on click on yellow cell it sould be red.
clicking on red cell the color should get changed to green
sanjay kumar samantaray
|
|
|
|
|
Hello All,
Thank you for reading this post. Here is my issue. I have an ASP.NET 2.0 web application, that requires users to login and then they are shown the welcome page on successful login(Iam not using forms authentication, user's login credentials are validated against database and redirected to welcome page). The Welcome page has a logout button, on clicking which I clear all session variables, destroy all login based cookies and redirect to the login screen again. My problem is this. After I logout and reach the Login page if I hit the back button I go back to my welcome screen with all user information even though I have explicitly cleared session and cache. Please let me know how I can enforce the login page when back button is pressed. This is what i have on my logout page.
Protected Sub lkbLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lkbLogout.Click
Session(CustomerInformation) = Nothing
Session.Clear()
'Remove all cookies
If Not Request.Cookies(ConfigurationManager.AppSettings("Cookie")) Is Nothing Then
Response.Cookies(ConfigurationManager.AppSettings("Cookie")).Expires = DateTime.Now.AddYears(-30)
End If
If Not Request.Cookies(ConfigurationManager.AppSettings("Cookie2")) Is Nothing Then
Response.Cookies(ConfigurationManager.AppSettings("Cookie2")).Expires = DateTime.Now.AddYears(-30)
End If
If Session(CustomerInformation) Is Nothing Then
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.Cache.SetExpires(DateTime.Now - New TimeSpan(1, 0, 0))
Response.Cache.SetLastModified(DateTime.Now)
Response.Cache.SetAllowResponseInBrowserHistory(False)
Response.Redirect("login.aspx", True)
End If
'------------------
response.redirect("login.aspx",true)
|
|
|
|
|
Responce.Cookies is array method not function. You have to use [] not (). This stand also for Session
example:
Response.Cookies[ConfigurationManager.AppSettings("Cookie")].Expires = DateTime.Now.AddYears(-30)
|
|
|
|
|
Will the above solution solve my issue ? Iam using VB.NET for my coding not C#
|
|
|
|
|
Sorry didn't read your post very well. You coud write javascript that prevents back buttion.
But when you press back button, the browser displays a page in previous. It doesn't call a server to check if that is true. It is imposible.
But you could check every time a postback occourd for every page
|
|
|
|
|
Subject says it all.
I've been searching here and across the web for an ASP.NET DatePicker control.
So far, none have handled NULL values properly (unless puking is proper).
Anyone know if Microsoft will fix this in 2008? If so, I'll tell the boss to shelf this.
"Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit..."
"There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain..."
|
|
|
|
|
If you're on 2.0 you can use the Null Coalesce operator to avoid sending a NULL value to the control.
string origDate = null;
string newDate = origDate ?? DateTime.Now.ToString();
So if origDate is NULL, it will use Now.
Hope that helps you get around your problem. If you're using VB.Net, then I have no clue if it has a Null Coalesce equivalent.
|
|
|
|