CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

MS SQL 2008 on ASP.NET Hosting



Zone: > NEWSGROUP > Asp.Net Forum > starter_kits_and_source_projects.portal_starter_kit Tags:
Item Type: NewsGroup Date Entered: 7/24/2002 3:18:50 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 8 Views: 28 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
9 Items, 1 Pages 1 |< << Go >> >|
Smyrnian
Asp.Net User
IBS Portal: How to cache PortalSettings?7/24/2002 3:18:50 AM

0/0

Two questions:

1) I really don't like the idea that the GetPortalSettings stored procedure is called for EVERY request... OK, the modules have a caching mechanism, which lessens the webserver load; but how would you cache the PortalSettings to make the application more efficient. Why not use something like Application("PortalSettings")?

2) Similarly, the following line is used throughout the portal to read the PortalSettings:

' Obtain PortalSettings from Current Context
Dim _portalSettings As PortalSettings = CType(Context.Items("PortalSettings"), PortalSettings)

Is this "Context" object similar to the traditional Application() object? How does it work?

Thanks in advance :)

Nuri

Shannon
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?7/24/2002 10:13:47 AM

0/0

Hi Smyrnian,

2) The context.Items dictionary is for that request only, and it allows things like a HttpHandler and a HttpModule to share data. The way it's used in IBuySpy is to allow the global.asax file (HttpApplication) to get the information from the DB, and share it to any page in the application.

HTH,
Shannon.
smyrnian
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?7/24/2002 10:26:47 AM

0/0

Thanks Shannon, that makes sense.

Since the PortalSettings data doesn't change very often, it doesn't make sense that the database is hit for this information in EVERY request. I am toying with the idea of creating an Application("PortalSettings") global variable and storing the configuration data in here.

So in Global.asax:

If Application("UseCachedPortalSettings") = True Then
LoadPortalSettingsFromCache
Else
LoadPortalSettingsFromDB
End If

The Application("UseCachedPortalSettings") can be switched on and off in the admin page as necessary..

How does that sound? anyone?

Nuri
Smyrnian
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?7/24/2002 11:36:52 AM

0/0

Hey guys! I just found something in IBS Portal that will probably interest you. Have you ever noticed that if you put a breakpoint anywhere in the PortalSettings Class (\Components\Configuration.vb) and then hit F5 to run the app.... it actually hits the database for the Portal settings twice!...

Well, whats happening there is Default.aspx.vb uses Response.Redirect to DesktopDefault.aspx or MobileDefault.aspx depending on the type of client.

Default.aspx.vb IS a request in itself and then the redirection is also a second request to the webserver, the PortalSettings Class is run TWICE!!!

To correct the problem, open Default.aspx.vb and modify it to use use Server.Transfer instead of Response.Redirect like this:

If Request.Browser("IsMobileDevice") = "true" Then

Server.Transfer("MobileDefault.aspx")
Else

Server.Transfer("DesktopDefault.aspx")
End If

All the more reason to find a way to cache the PortalSettings somehow eh? ;)

Happy coding!
Nuri
shadowdanser
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?7/24/2002 3:05:30 PM

0/0

And what is the difference between this?

Response.Redirect("DesktopDefault.aspx");

-- or --

Server.Transfer("DesktopDefault.aspx");

There should be a reason that they (asp.net team) have used Response.Redirect, or not?

Thanks!
smyrnian
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?7/24/2002 3:11:30 PM

0/0

The difference is where they the redirect is done:

In Response.Redirect("DesktopDefault.aspx") the client browser makes a second request to DesktopDefault.aspx

In Server.Transfer("DesktopDefault.aspx") the server terminates the current request and transfers the current request to DesktopDefault.aspx

If there is a reason why the asp.net team have used Response.Redirect, that can't justify two (huge) hits on the database! ;)

Nuri
elevo
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?2/6/2004 12:15:00 AM

0/0

Smyrnian, any improvements with this? Does the IBUYSpy portal connects to the database just when the user initiates the session or what?
officialboss
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?11/6/2006 10:31:25 PM

0/0

Hello All,

I was looking at the code for Rainbow and Ibuy portals and was wondering the same thing as the posts above, is the database queried on each request for each page?

How are the user controls cached? Could someone please explain this with some sample codes.

Thanks
Mike
 


Please be sure to click "Mark as Answer" on the post that helped you.
tayyab81
Asp.Net User
Re: IBS Portal: How to cache PortalSettings?10/22/2007 12:21:53 PM

0/0

even i have changed the Response.Redirect to Server.Transfer ... but still this is un-answerable yet ... or i couldn't find the reason yet for it as why portal settings are being loaded more then one time on each request?

Is it for the fact that Application_BeginRequest is being called on every web-event raised in the application?
then how many hidden web events are being raised as a result of a single clickin the portal. Since i m getting this line executed four times after one click:

Context.Items.Add("PortalSettings", new PortalSettings(tabIndex, tabId));    in Global.cs

 

Smyrnian:
The difference is where they the redirect is done:

In Response.Redirect("DesktopDefault.aspx") the client browser makes a second request to DesktopDefault.aspx

In Server.Transfer("DesktopDefault.aspx") the server terminates the current request and transfers the current request to DesktopDefault.aspx

If there is a reason why the asp.net team have used Response.Redirect, that can't justify two (huge) hits on the database! ;)

Nuri

 

9 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
IBS Portal: How to cache PortalSettings? - ASP.NET Forums OK, the modules have a caching mechanism, which lessens the webserver load; but how would you cache the PortalSettings to make the ...
IBuySpy Portal White Paper The portal settings are represented by the PortalSettings Class, which is defined in the Configuration .... IBS Portal Milestone Module - Edit page part ...
ExamGuru IT/.Net Guru : ASPFriends.com 'aspngibuyspy' list Has anyone tried to modify the IBS portal to use NT Groups for access control? .... IsInRoles( portalSettings.ActiveTab.AuthorizedRoles) False Then Line 36: ...
SourceForge.net: Files NOTE: I've had to temporarily disable caching of portalSettings: classic ... Module based on the picture album from Ender and the original IBS shop. ...
ASPSmith Training : ASP.NET Training Q: My IBS Portal install fails because of something to do with MSDE - why? ... Q : BUG FIX: PortalSettings loaded twice per request! ...
Utveckling av moduler för DotNetNuke- baserade CMS/CRM-system En IBS-portal lät användare skapa nya och dynamiska webbsidor från grunden. ..... AddLog(objTabInfo, PortalSettings, UserInfo.UserID, UserInfo.Username, _ ...
ASPSmith Training : ASP.NET Training Q: My IBS Portal install fails because of something to do with MSDE - why? ... Q : BUG FIX: PortalSettings loaded twice per request! ...
Utveckling av moduler för DotNetNuke- baserade CMS/CRM-system En IBS-portal lät användare skapa nya och dynamiska webbsidor från grunden. ..... AddLog(objTabInfo, PortalSettings, UserInfo.UserID, UserInfo.Username, _ ...
ASPSmith Training : ASP.NET Training Q: My IBS Portal install fails because of something to do with MSDE - why? ... Q : BUG FIX: PortalSettings loaded twice per request! ...
Utveckling av moduler för DotNetNuke- baserade CMS/CRM-system En IBS-portal lät användare skapa nya och dynamiska webbsidor från grunden. ..... AddLog(objTabInfo, PortalSettings, UserInfo.UserID, UserInfo.Username, _ ...




Search This Site:










installation problem

low-impact logging

compile problem?

ibuyspy portal: c# code for document management modul

can't get the web page on my local machine to come up

copy right

portal configuration file

looking ms access version of ibuyspy writtent in vb.net but not mobilewebportal

announcements module problem

portal starter kit

business layer

moving the login module

modifying the userdb class

webparts module

can' get portal to appear in browser

pop up calendar

deployment issue path to portalcfg.xml

security settings for iis and sql2000

checkbox validation ?

portal starter kit

ibuyspy on windows 2003 server and sql server 2000 sp3

server error in '/portalvbvs' application.

need original portalcfg.xml

admin tab

using cache setting for each module

returnurl problem or authentication problem

sql server does not exist or access denied

questionaire component engine - is there one available?

failed to start monitoring changes

typical problem adding a new module

  Privacy | Contact Us
All Times Are GMT