|
|
Hi,
I have written some C# code that appears to be working, but as I write this message, I can see that it won't. In the catch routine the ToString will give an exception if the session has timed out.
What I am doing is obtaining a bunch of information about a user at login time and storing the information in session variables. In other C# web screen I reference the variables, but I'm unsure the proper way to determine if the session has timed out.
Here's what I have got, but I think it would be better to set up something that captures timeouts and redirects them, but i'm not sure how other than this.
<br />
try<br />
{<br />
dblSaleLimit = Convert.ToDouble(Session["SALELIMIT"].ToString( ));<br />
}<br />
<br />
catch(Exception e)<br />
{<br />
if (Session["ID"].ToString() == "")<br />
{<br />
Response.Redirect("Timeout.aspx");<br />
return;<br />
}<br />
<br />
String = e.ToString() + 0x0d + 0x0d + " Message: " + e.Message + 0x0d + " Stack Trace: " + e.StackTrace;<br />
efResponse.Text = String;<br />
<br />
args.IsValid = true;<br />
return;<br />
}<br />
Thoughts are appreciated....
Thank you,
Glenn
|
|
|
|
|
You can capture this in OnSessionEnd event in Global.asax...
<< >>
|
|
|
|
|
|
I created a user control in C# that I'd like to display in IE. I also did create a virtual directory on my local host. It works fine on one machine, but I can't get the control to show up on 3 other machines. They just show a placeholder box for the control.
Here is html that I am using:
<object id="MyUserCtrl"
classid="http://localhost/MyCtrl/MyCtrl.dll#MyCtrl.UserControl1" height="500" width="500" viewastext="">
I think this might have something to do with my IIS settings?
Please help.
|
|
|
|
|
For starters, localhost won't be the right machine on any machine but your own.
----
Bots don't know when people die.
--Paul Watson, RIP
|
|
|
|
|
yes, I am running this on my local machine for now
|
|
|
|
|
Right. But that URL is evaluated by the browser, not the server - so for it to have a chance of working on any machine but the server (your machine) itself, you'll need to use the actual network name of your machine, not localhost .
----
Bots don't know when people die.
--Paul Watson, RIP
|
|
|
|
|
but I can't even get it to show up on the same machine in 3 cases out of 4.
and I configured the virtual directories the same on all of them
|
|
|
|
|
hi ,
I am facing a problem in my ASP.Net project. The scenario is something like this.....
I have a radio button list (web control) and say few text boxes(say TB1, TB2 ..etc) and buttons .......When I select a particular radio button from the list, TB1 and Button1 should be enabled. I want to give this on client side...I have used C# for serverside scripting......
What I did was , I wrote a javascript function and that function should be called when selected index changes....something like this
<asp:radiobuttonlist id="rblistmain" onselectedindexchanged="fun1" runat="server">
<asp:listitem> A
<asp:listitem> B
I then wrote the fun1 in > tag.
But I get error when I execute it - that the function was not found....
Can some one tell me what's going wrong?
I dont want to give autopostback as true coz I want the things to happen at client side
Thanks,
Deeps
|
|
|
|
|
|
no actually if autopostback is enabled, it will use only serverside function. and even if its not enabled, it will by pass the client side-- thisi is what i found in one of the books. Also Chandana suggested to use html controls instead but then these html controls i ll not be able to refer them in my code behind class. I dont understand what to do. Can anyone help
Thanks,
Deeps
|
|
|
|
|
hi
i have a html file and want parse it ,which find all of tag in the file
this parser should to diagnosis the text is like tag of html.
please help me.
thanks.
Just C#
|
|
|
|
|
Is it XHTML ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
|
|
I assume that you mean the number of characters in the options that are displayed in the select box.
Loop through the options collection of the select box and add upp the length of the text property for each option.
---
b { font-weight: normal; }
|
|
|
|
|
|
Hello Dear
How to know whether the client browser can accept cookie or not?
When ActiveX control and cookies are disabled on the client machine.
Is it possible to use MSWC.BrowserType when client system disabled ActiveX Control?
N.Rajakumar B.E.,
Application Developer,
www.newdreamz.tk
|
|
|
|
|
|
can you elaborate it ....
N.Rajakumar B.E.,
Application Developer,
www.newdreamz.tk
|
|
|
|
|
|
I have to can be sure that my pages are correctly presented on PDA .. Palm, Microsoft Pocket PC, Windows Mobile 5.0, etc. How can i do it ? Does exists some kind of emulators, etc of them ?
Thanks in advance !
|
|
|
|
|