DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Tue, 22 May 2007 15:51:00 -0700,    posted on: microsoft.public.dotnet.framework.aspnet.mobile        back       

Thread Index
  1    Alex Maghen am
          2    (Walter Wang [MSFT])
                 3    Alex Maghen am
                 4    Alex Maghen am
                 5    (Walter Wang [MSFT])


Session Object & Link Navigation   
I'm building an ASP.NET Mobile Web application that uses Session. Because I 
am also doing FormsAuthentication, I've set up my Web.Config with certain 
settings I read I should use. It looks like:

	<system.web>
		<compilation debug="true"/>
		<authentication mode="Forms">
			<forms loginUrl="~/Login/Default.aspx"
				name="HomoMoAuth" timeout="10" path="/">
			</forms>
			
		</authentication>
		<authorization>
			<allow users="*"/>
		</authorization>

		<sessionState
			mode="InProc" cookieless="true" timeout="20"
		/>

		<httpRuntime useFullyQualifiedRedirectUrl="true" />

		<mobileControls
			 cookielessDataDictionaryType="System.Web.Mobile.CookielessData" />
		
	</system.web>


ANYWAY, here's my problem: It seems that, maybe, because of the 
"useFullyQualifiedRedirectUrl" or something, I can't really use the "~" in my 
Link Paths. If I do, I loose my Session object. Can someone help me 
understand how/if I can still use the "~"? I like it!
Date:Tue, 22 May 2007 15:51:00 -0700   Author:  

RE: Session Object & Link Navigation   
Hi Alex,

It's related to the cookieless session:

<quote>
#ASP.NET Web Site Paths
http://msdn2.microsoft.com/en-us/library/ms178116.aspx
Note 

For mobile pages only, if your application relies on cookieless sessions or 
might receive requests from mobile devices that require cookieless 
sessions, using a tilde ("~") in a path can result in inadvertently 
creating a new session and potentially losing session data. To set a 
property on a mobile control with a path that includes a tilde (such as 
"~/path"), resolve the path using the ResolveUrl method before assigning it 
to the property.
</quote>

Hope this helps.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Wed, 23 May 2007 09:18:07 GMT   Author:  

RE: Session Object & Link Navigation   
Walter -

Thanks for this. It *does* seem to improve things somewhat. Now I have 
another related question: Let's say I want to create my own Link control 
which will automatically perform this ResolveUrl() function and also will do 
some other things to alter the standard <mobile:link> control. If my new 
control is defined as 

public partial class AxMobileLink : System.Web.UI.MobileControls.Link

Is there a way that I can sort of automatically support all of the 
properties and methods exposed by the constituent <mobile:Link? without 
writing my own proerty and function overriding each one which does nothing 
but call the base?

Ax




"Walter Wang [MSFT]" wrote:


> Hi Alex,
> 
> It's related to the cookieless session:
> 
> <quote>
> #ASP.NET Web Site Paths
> http://msdn2.microsoft.com/en-us/library/ms178116.aspx
> Note 
> 
> For mobile pages only, if your application relies on cookieless sessions or 
> might receive requests from mobile devices that require cookieless 
> sessions, using a tilde ("~") in a path can result in inadvertently 
> creating a new session and potentially losing session data. To set a 
> property on a mobile control with a path that includes a tilde (such as 
> "~/path"), resolve the path using the ResolveUrl method before assigning it 
> to the property.
> </quote>
> 
> Hope this helps.
> 
> 
> Regards,
> Walter Wang (wawang@online.microsoft.com, remove 'online.')
> Microsoft Online Community Support
> 
> ==================================================
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ==================================================
> 
> This posting is provided "AS IS" with no warranties, and confers no rights. 
> 
> 
Date:Fri, 1 Jun 2007 08:29:02 -0700   Author:  

RE: Session Object & Link Navigation   
Walter -

I am now confused a little further. Let's say I want to place two links on a 
Mobile form with the Web.config settings I defined below. The links are as 
follows:

1. ~/Default.aspx
2. SomeFolder/Default.aspx

You recommended that I user ResolveURL() on these paths before placing them 
in the NavigateURL field of the <mobile:Link> control. The problem is, if I 
do that for #1 above, it works fine. But if I do it for #2, it doesn't behave 
properly. How am I supposed to know when to use ResolveURL and when now?

Alex


"Alex Maghen" wrote:


> Walter -
> 
> Thanks for this. It *does* seem to improve things somewhat. Now I have 
> another related question: Let's say I want to create my own Link control 
> which will automatically perform this ResolveUrl() function and also will do 
> some other things to alter the standard <mobile:link> control. If my new 
> control is defined as 
> 
> public partial class AxMobileLink : System.Web.UI.MobileControls.Link
> 
> Is there a way that I can sort of automatically support all of the 
> properties and methods exposed by the constituent <mobile:Link? without 
> writing my own proerty and function overriding each one which does nothing 
> but call the base?
> 
> Ax
> 
> 
> 
> 
> "Walter Wang [MSFT]" wrote:
> 
> > Hi Alex,
> > 
> > It's related to the cookieless session:
> > 
> > <quote>
> > #ASP.NET Web Site Paths
> > http://msdn2.microsoft.com/en-us/library/ms178116.aspx
> > Note 
> > 
> > For mobile pages only, if your application relies on cookieless sessions or 
> > might receive requests from mobile devices that require cookieless 
> > sessions, using a tilde ("~") in a path can result in inadvertently 
> > creating a new session and potentially losing session data. To set a 
> > property on a mobile control with a path that includes a tilde (such as 
> > "~/path"), resolve the path using the ResolveUrl method before assigning it 
> > to the property.
> > </quote>
> > 
> > Hope this helps.
> > 
> > 
> > Regards,
> > Walter Wang (wawang@online.microsoft.com, remove 'online.')
> > Microsoft Online Community Support
> > 
> > ==================================================
> > When responding to posts, please "Reply to Group" via your newsreader so
> > that others may learn and benefit from your issue.
> > ==================================================
> > 
> > This posting is provided "AS IS" with no warranties, and confers no rights. 
> > 
> > 
Date:Fri, 1 Jun 2007 22:13:00 -0700   Author:  

RE: Session Object & Link Navigation   
Hi Alex,

Please try following approach:

    public class Class1 : Link
    {
        protected override void OnPreRender(EventArgs e)
        {
            NavigateUrl = Page.ResolveUrl(NavigateUrl);
            base.OnPreRender(e);
        }
    }


Using this customized Link control will make sure it calls ResolveUrl 
before displaying the hyperlink. 

Let me know if this works for you.


Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Date:Mon, 04 Jun 2007 06:55:38 GMT   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us