|
If you want the site to autoupdate, you can use javascript to make the page auto refresh, or AJAX to make a call to refresh part of a page.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
In a good design, the content and news items should be controlled and should not autoupdate since it would irritate users besides an undue load on the server.
However, you can have a simple news ticker which refreshes the messages. Have you checked out NDTV (http://www.ndtv.com/[^]) website?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
I am using One Texbox and One Label.. If I click save button ..It show an error ie Operator '>' cannot be applied to operands of type 'string' and 'string' ..
In First.aspx
Time | <asp:textbox id="addrow51" width="80%" runat="server">
|
<asp:button text="Save" id="btnSave" runat="server" onclick="btnSave_Click1"> |
<asp:label id="lblTS" runat="server">
in First.aspx.cs
protected void btnSave_Click1(object sender, EventArgs e)
{
if ( addrow51.Text > "12:59")
{
lblTS.Text = "Please Enter the Valid Time";
}
}
Please help me
|
|
|
|
|
All of this was clear in your last post, but if you want to clarify something, edit your post, don't post another.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
|
Use a more meaningful subject line
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
In code behind page
if i use this condition. Then it show an error ie Operator '>' cannot be applied to operands of type 'string' and 'string'
How to Solve this problem
if ( addrow51.Text > "12:59")
{
label1.Text = "Please Enter the Valid Time";
}
|
|
|
|
|
I know you've been told this before, but, read this[^]. The many levels on which this shows that you have no idea how C# works, are hard to fathom.
I know people like you don't want to learn, you want your job done for you. So, here goes.
1 - your variable naming is a disaster. Never use the default names. Especially if you 51 different variables that are all called addrow.
2 - like the error says, you can't use > to compare strings. It certainly isn't going to do what you're expecting. Are you generate validating this text to make sure it conforms to the format you're hoping for ? You need to do that first, then you need to turn this into a format such as datetime ( although not sure if you can make a datetime without a date, I'd be more inclined to use string.split and int.TryParse to work out what you were dealing with )
I suspect you have no idea what I just said. If so, it proves again that you need to read some basics before you write code that is ever going to be used by anyone, and if anyone is paying for your code, you are stealing from them.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Ease back Chris, you've blown the trans-axle!
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I'm sorry, but *seriously*....
Christian Graus - Microsoft MVP - C++
"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 agree, and your post cracked my sh*t up, just had to throw some Aliens quote in there (use it or lose it!) Do you think we should even bother telling him/her about CompareTo or DateTime.TryParse/Parse, et al?
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
I dunno if DateTime.TryParse will work with just a time ? I tried to give a pretty straightforward answer, I think the best way to enforce this format, and to check the value, is to split the string and do an int.TryParse on the different values.
Even when I blast someone for utter laziness and cluelessness, I try to provide an answer they can use, if they are willing to read it.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
TryParse does work with just a time, it defaults to the current system date.
So this works, although it seems a bit complex:
string userText = "12:59";
DateTime now = DateTime.Now;
DateTime checkTime = new DateTime(now.Year, now.Month, now.Day, 12, 59, 0); // assuming 12:59am
DateTime userTime = DateTime.MinValue;
DateTime.TryParse(userText, out userTime);
if (userTime > checkTime)
{
// Valid
}
else
{
// Invalid
}
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
OK, well, I guess he got his answer then Thanks, I had no idea and I didn't like to do more work for an answer than the OP was willing to do for himself. But, it's good to know.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Oops! Yeah, I shouldn't do that, fully agree (especially with the level of questions being posted these days). But, curiosity killed my cat, so I had to know. Plus we all learned something.
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
Christian Graus wrote: DateTime.TryParse will work with just a time
How about a tweak of current Date plus time as string and then passing them to DateTime.Parse()? I admit care should be taken for time between 23:59 and the next days particularly in time-sensitive applications.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
|
ASP.NET C Sharp User Info Snag
Suppose I write a asp.net app using c sharp and I want to have a look at some user information. How would I go about doing this? i remember in good ol' html and dhtml there was a way of peeking at the information packet sent to the server. I remember it was called "sniffing". But I don't recall how it is done. How do I snag the user's information?
|
|
|
|
|
Probably on the Request object.
Christian Graus - Microsoft MVP - C++
"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 want to add a progress bar to my button click event, since the Button_Click event in code-behind does a lot of data process and sometime takes 3-4 minutes to finish. Does anyone have ideas how to do it?
Any help would be very appreciated!
Thanks!!
|
|
|
|
|
You need to use AJAX to do that.
Christian Graus - Microsoft MVP - C++
"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 responses! Do you know any examples that I can reference?
|
|
|
|
|
|
Thank you very much! It looks very promising. I will give it try and see if it works.
|
|
|
|
|
I can upload file from my local machine using the ,FTPClient, to the FTP site,
but when once the application is on the web server no file shows on the FTP site.
It does not even try to upload...
|
|
|
|