 |
|
 |
It's my pleasure friend, glad it could help you out! Let me know if you discover any other interesting implementations
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
Hi,
Your article is very simple and worthy.
Keep helping others
Thanks!
Rajendran Thiagarajan.
|
|
|
|
 |
|
 |
Hi,
I check the followig condition in my Master Page.
If Session("UserId") = "" Then
response.redirect("Login.aspx")
End If
I've set the session time out to 240 minutes in global.asa file and also web.confic and it works fine in development.
When the application is deployed in IIs 6.0, the application times out after 20 minutes and the is redirected to Login.aspx...
Please suggest me what to do..
Naveen
|
|
|
|
 |
|
 |
did you checked your machine.config?
|
|
|
|
 |
|
 |
Hi,
This seems to be just the sort of thing I'm after but I don't think it's working properly for me.
I've only got a few months ASP.NET under my belt so many of these concepts are new to me coming as I do from a VB6 background.
I don't have a persistent user control but all the pages in my site use a single master page.
My application stores the userid in session state and it is used in most database updates
I tried putting the Iframe in the body of the master page and left the app running until after the session would have timed out. When I clicked on the button I was returned to my login page and having entered the userid and pwd the update failed as it didn't have the user id anymore.
Can you suggest where I went wrong?
Thanks
Neil
|
|
|
|
 |
|
 |
Hey Neil,
Glad to help out. Check your HTML output by right clicking on the page and doing 'view source'. You might have to give your iframe page some visual elements so you can right click on it in the browser to view source. Inspect the header and see what made it in there. That will tell you if the response was formed as you intended.
Make sure your iframe page is running on the same web as the master page. Make sure your clients have cookies enabled. Still at a dead end? review your authentication code to see what is going on there may be something in your code that is disposing the session variable you expect to be there and redirecting to authenticate again.
Next, go to amazon.com and buy the MCPD: Web Developer set of 3 books from Microsoft Press for the MCPD certification. If you're new to .NET, those are the most efficient resources to learn all the fundamentals for the cheapest price. I did the same thing back in 2001 coming to .NET from Perl, C, and fortran, but it wasn't until I got the MCSD training books for .NET 1.1 that I felt in complete control of the framework.
For ASP.NET focus on the internals - how it works, what happens when you get an HttpRequest, through to the HttpResponse. What is Global.asax? What does it do? How can you manipulate the pipeline with HttpModules? These are great things for a winform developer to master first, which will save a lot of frustration about the differences between win/web apps in .NET.
Cheers,
Tommy
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
Hi Thomas,
Thanks for the reply, I'd forgotten that I still had an issue with this so here goes.
I did a view source on the page (that uses a master page) and the source for the iframe was:
<iframe id="ctl00_Defib" src="/Defibrillator.aspx" frameborder="0" width="0" height="0">
</iframe>
I'm not sure what you meant by "Inspect the header and see what made it in there" as the iframe had to be placed in the body not the head.
All my pages, once the user has logged in use the same master page.
All pages are running on the same web as I'm still developing on a single machine at present.
What should I look at in respect of authentication code? The user has to log in and from there on the menu uses the user's roles to identify what should be displayed so I'm assuming that the authentication is OK, is that a false assumption?
I'll certainly look into buying the books you recommend when I have some spare cash.
Thanks
Neil
|
|
|
|
 |
|
 |
Hello,
If I implemented this in my master page footer and the page which is inheriting this master page on which I am doing some long database process. In this case what will happen? Does my process will get affected in any way? or something else?
Please guide me on this issue.
Thanks & regards,
Mahesh
RishabhMahesh
|
|
|
|
 |
|
 |
Nothing should happen to the database access because you are firing the refresh from an IFRAME and not your main page. Bear in mind that the IFRAME will have it's own page associated with it.
Deja View - the feeling that you've seen this post before.
|
|
|
|
 |
|
 |
Thank you Thomas,
That was an interesting article, and I want to try your suggestion in parts of our code.
I was wondering if you have a solution for another problem we run into: that the server empties its buffer after a time of inactivity.
Our situation is that we are running serveral domains on a server, and if someone calls the domain (www.domain1.com) after a periode of inactivity, the IIS has to load the whole code again before it answer the request.
I have seen it suggested that one could add a "keep alive" code that calls each domain, but was wondering if you had a better solution?
Thanks
Bjørn
|
|
|
|
 |
|
 |
Thanks for your interest Bjorn. I am curious if you are looking for the GAC. You can load your web assembly into the Global Assembly Cache and see if it helps your performance issue.
I wonder if there are other underlying issues. Are you seeking to improve upon scalability in general? I have used a number of techniques to do this in my architecture.
You can view one of my implementations at www.bridgestreet.com. Note how fast it is browsing through that site and searching it. Did you know that there is not a single letter that is static text in that site? Relational multilingual data is stored in a custom CMS.
It is multilingual for multiple domains, but those domains are on the same web in IIS.
It knows what your language preference is. You can go to www.bridgestreet.fr or www.bridgestreet.co.uk and you will actually be accessing the same code base, on the same web farm.
I made an interface ICacheable so that all classes that implement it can work with the Web Cache to reduce trips to the database exponentially. Also, all UI text that is not relational is not even in the DB, it is in the Satellite Assemblies (resx) and localized.
Tracing on a staging environment may also help you isolate the performance sink-holes. You may also seek out code sources of unscalability. I would refer you to Code Complete 2nd Edition by Steve McConnell, the chapter on Code Tuning.
Good luck with your solution and please let me know if I can help further!
Cheers,
Thomas
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
It helped me a lot. Simple and easy way to keep session alive.
Thanks a lot.
|
|
|
|
 |
|
 |
It is my pleasure Mr. Ramesh, I am glad that you could make use of it! Thank you for letting me know. Regards, Thomas
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
If I used Ashaman solution, which is using the html page to refresh itself, other than the aspx, will the session refresh?
Because I think that an aspx page should be refreshed, to refresh the session,
i did not try it, but this question has just popped into my mind!!
Nasser
|
|
|
|
 |
|
 |
That is a good question Nasser! Unfortunately I have to answer it with a question that eludes my understanding at this point: is a request to the server for an htm file processed by the session HTTP module? Is it considered an HttpRequest like any other and processed by the .NET pipeline? Or does IIS simply serve up the HTM and bypass the Http Modules? It's more of a .NET architecture problem. I am using an aspx page in mine, because I could not answer those questions in minimal time, and I had bigger fish to fry. If you can answer those questions please let us know!
Good luck and best regards,
Tommy
This is a great article about Session from our friend Mr. Esposito:
http://msdn.microsoft.com/library/?url=/library/en-us/dnaspp/html/ASPNetSessionState.asp[^]
Just to demo my articles in use (although my Geo article is outdated now, I have improved the code greatly, it still uses the same mathematics and basic ideas):
You can visit www.bridgestreet.com to see my work in action. Notice how fast the site runs even though not a single text element is hard coded (all coming from database or satellite assemblies for globalization / localization). Right now we only have British and US dialects of English but we will be plugging other languages in soon. The speed is achieved by using StateServer on a web farm and server caching of class instances from the data layer.
Close your browser and go to www.bridgestreet.co.uk
you are hitting the same software (same web on IIS). Notice how minor things change (skins/theme, $ to pounds, date format changes, content from CMS changes to different dialect).
Type in Lindon for the UK and search. Notice how fast the recommendations come up for comparing your misspelling to hundreds of thousands of cities. I used a SQL fuzzy search implementation that combines NYSIIS system phonetic matching and the levenshtein algorithm for word distance. Hopefully my company will move to SQL 2005 soon so we can use their fuzzy searching.
The geo-distance calculations are fast too because they occur in SQL with using bounding-plane techniques.
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
the session will not refresh, just the page being refreshed
|
|
|
|
 |
|
 |
It helped very much. I appreciate your cleverness.
Rajan Devaraj
|
|
|
|
 |
|
 |
Thank you Rajan, I am very pleased to be of service! Hopefully when ATLAS is finally rolled into .NET 3.0 at the end of the year I will be able to develop an even better solution with AJAX.
Cheers,
Tommy
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
Your idea works great with IE, but not with FireFox.
The session ended after 20 minutes.
|
|
|
|
 |
|
 |
Interesting, have you confirmed that Firefox doesn't support the Meta Refresh header? Or that the dotNet session didn't time out prematurely by logging the SessionEnd in Global.asax? Can't imagine that it would be an ASP.NET related issue since the response output is truly nothing more than HTML tricks when it hits the client. Unless of course the dotNet session is prematurely going out to lunch as we have seen before. Seems like it's one or the other. I know we had a hard time with getting firefox to support the latest flash plugin. What's your take?
Thanks,
T
Achieve by taking great pride in everything you're charged with, be successful by having the initiative to charge yourself, and realize that talent is comprised of aptitude, hard work, and spirit. Hone in on your aptitudes and dedicate your spirit to reach your full potential.
|
|
|
|
 |
|
 |
Was wondering if anyone came up with a reason that the code doesn't work in firefox or a solution?
Thanks
C
|
|
|
|
 |
|
 |
Hello! this is works with Firefox!Try by using the mettag of HTML: <meta http-equiv="refresh" content="[timeIn seconds];url=yourUrl.nn;">
|
|
|
|
 |
|
 |
I cant get this to work in Safari. Please can somebody explain properly how to get this working in Firefox and Safari. please!!!!!!!!! I nearly cried when I saw it didnt work in Safari.....
|
|
|
|
 |
|
 |
Hi,
Did you get to work in Safari. I have same problem too. Thanks in advance
karakas
|
|
|
|
 |
|
 |
My wager is that this is due to aggressive browser caching. Create a client-side javascript that auto-increments a querystring variable in the IFRAME refresh to force the browser to request the page each time. This would be instead of using META tag.
|
|
|
|
 |