|
Ersan Ercek wrote: to create a label, when a specific event is fired
to change its text to 'loading' and add '.' in a half second like
loading
loading.
loading..
loading...
You can simply do it usign AJAX. Try to use AJAX UpdatePanel and UpdateProgressBar .
Let us know if you need further help.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
there are two ways to achieve this..
if you are using ajax then you need to put gif like
http://www.cis.uab.edu/forensics/blog/loading.gif[^]
in your update progress control which is related to ajax update panel.
or second thing if you want to handle it manually then you can show and hide it on start and end of each event manually.
Http://www.gen-sys.com
Government Dyal Singh College Lahore.
|
|
|
|
|
Dear All,
Could somebody tell me how to call selectedindexchanged event during page_load event...
All the best
|
|
|
|
|
I assume you want to trigger that event during page_load.
Why don't you put the code in the event handler in some other method (a new one, which you must implement). Then you call the new method both in the event handler and in handler for page_load?
SkyWalker
|
|
|
|
|
use this..
Create this in page load and call the SelectedIndexChanged
object sender1 = new object();
EventArgs e1 =new EventArgs();
DropDownList1_SelectedIndexChanged(sender1, e1);
event:
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
}
|
|
|
|
|
I created a web service with a method in it that returns the client's IP address. If I "view in browser" on the web service, the method works. If I call that method from a desktop application, The method throws an exception because HttpContext.Current is null .
How should I go about retrieving the client's IP address?
Here's the line I'm trying to use:
string clientIP = HttpContext.Current.Request.UserHostAddress;
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
It worked for me. HttpContext was not null when I tried. You can also try this.Context.Request.UserHostAddress as well.
Best wishes,
Navaneeth
|
|
|
|
|
This doesn't work either. Remember - I'm making the call from a desktop application - not a ASP.net web page.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
Did you added System.Web NameSpace with your windows application ?
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
That's not going to make a property in HttpContext null is it? In fact, if there was a missing using , it wouldn't even compile.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
I understand that you are calling from a Desktop application and it worked just fine for me. Can you provide additional informations to reproduce this? I believe you are using a SOAP web service. Here is what I did and which worked for me.
In Web service:
[WebMethod]
public string TestHttpContext()
{
if (HttpContext.Current != null)
return "Context is not null";
else
return "Context is null!";
} In Desktop application:
ServiceReference1.Service1SoapClient s = new ServiceReference1.Service1SoapClient();
string str = s.TestHttpContext();
Console.WriteLine(str); I also tried moving the HttpContext check to other class library as part of reproducing. But everything worked as expected.
If you can provide more information, I will try to reproduce.
Best wishes,
Navaneeth
|
|
|
|
|
Hi John
These two can give you the ip of a Client
string clientIP = Request.ServerVariables ["REMOTE_ADDR"];
or
string clientIP = Request.UserHostAddress;
Kind Regards
Vuyiswa Maseko
Vuyiswa Maseko,
Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code.
C#/VB.NET/ASP.NET/SQL7/2000/2005/2008
http://www.vuyiswamaseko.com
vuyiswa@its.co.za
http://www.itsabacus.co.za/itsabacus/
|
|
|
|
|
This doesn't help when he is getting HttpContext.Current as NULL.
Best wishes,
Navaneeth
|
|
|
|
|
I believe you are blurring the lines between an Internet application and a desktop application.
When the application is running on the Internet you are executing on a hosting server which has a published IP address. Thus resolving it using HttpContext.Current.Request.UserHostAddress;
The IP address of a client machine executing a desktop application will be 127.0.0.1, the loop back IP address.
|
|
|
|
|
JimmyRopes wrote: I believe you are blurring the lines between an Internet application and a desktop application.
Look past the ego and actually read John's post.
John Simmons / outlaw programmer wrote: I created a web service
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: JimmyRopes wrote:I believe you are blurring the lines between an Internet application and a desktop application.
Look past the ego and actually read John's post.
John Simmons / outlaw programmer wrote:I created a web service
He is either working with a web service or a desktop application. Never both.
Thus my comment about blurring the lines between Internet applications (web services) and desktop applications.
Please confine you snipping to my post and not try to make it a global war.
Better yet if you would like to continue to snipe take it to the soapbox.
modified on Sunday, October 18, 2009 5:19 PM
|
|
|
|
|
JimmyRopes wrote: He is either working with a web service or a desktop application.Never both.
Jimmy,
As per my understanding he is consuming a Web Service from a desktop Application. Current Context returning null because of that.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Right I was mistaken there.
When he calls from a browser there is a current context but not from a desktop application.
|
|
|
|
|
JimmyRopes wrote: When he calls from a browser there is a current context but not from a desktop application.
Exactly.
I am having doubt that regarding. It is not possible to get HttpContext from windows application as it is never running as an HTTP Context.
There may be some alternative solution.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Abhijit Jana wrote: It is not possible to get HttpContext from windows application as it is never running as an HTTP Context.
I would have to do some testing to see what is available from a desktop application. The debugger would probably be a good place to start.
Then when I found that I would need to see how to get it from a web service. I don't know if it is possible because there are real security concerns with accessing a client machine from the Internet.
An interesting question. If you have any thoughts please post them.
|
|
|
|
|
I would probably have to hit the web service via a http request so it could establish a context. But can't I somehow determine the IP address of the client without doing that?
Google hasn't been any help yet.
.45 ACP - because shooting twice is just silly ----- "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." - J. Jystad, 2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: I would probably have to hit the web service via a http request so it could establish a context.
Do you access the web service from the client application with a HTTP connection? If so you are hitting the web service with an HTTP request.
John Simmons / outlaw programmer wrote: But can't I somehow determine the IP address of the client without doing that?
Probably because of the security restriction about accessing the client machine. Even just giving up the IP address would be a breach of protocol.
|
|
|
|
|
JimmyRopes wrote: Please confine you snipping to my post
I did. You were incorrect.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: Look past the ego
Maybe you don't think it is sniping but I find it offensive that you should refer to my ego and not just state where I was wrong, which I was and happened to admit it when I saw the error.
Take it to the soapbox if you want to post things like that.
|
|
|
|
|
Yet is was perfectly ok for you insult me.
JimmyRopes wrote: A look at your profile reveals that you are undoubtedly good at taking tests but that just means that you are good at taking tests, nothing more.
JimmyRopes wrote: Take it to the soapbox if you want to post things like that
Practice what you preach.
only two letters away from being an asset
|
|
|
|