Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 08, 2012 06:08 AM by programmersharp2
Aug 07, 2012 09:04 PM|LINK
I am moving the functionality from standart ASP.Net forms web site to ASP MVC 4 web site. The problem is I can't set ClientTarget property of the page.
Aug 07, 2012 09:07 PM|LINK
What are you trying to do? IOW, does Request.Browser not give you what you need?
Aug 07, 2012 09:18 PM|LINK
I don't know why it is done so and my aim is just to carry existing functionality to MVC, but http://browsercompatibility.codeplex.com/ gives explanation of asp menu control (of course I will not use
this control in MVC site). I guess the bigger problem is descibed here http://blog.lavablast.com/post/2011/05/29/Gotcha-iPad-versus-ASPNET.aspx. (an
application that worked fine when you shut down your iPad minutes ago will be completely unusable. No amount of refreshing will solve the issue. Clearing Safari’s cache and using it outside of the home screen icon is the only workaround).
Aug 07, 2012 09:36 PM|LINK
Well, I think you're going to run into a lot of things like this if your mindset is to port from WebForms to MVC. They're really two different programming models. It's really going to be a re-write and not a port since so many features are different and
don't map from one model to the other.
Aug 07, 2012 09:58 PM|LINK
Yes, models are really different but actually my problem is only how to do Page.ClientTarget = "uplevel". Any ideas?
Aug 07, 2012 10:06 PM|LINK
My point is that there's nothing like it in MVC. Setting this in the Page sets the ClientTarget property of the HttpRequest (which nulls out the Browser property). The next time you access the Browser property it then re-creates the HttpBrowserCapabilities
based upon the setting you pass.Basically all this is internal to the System.Web DLL.
To achieve the same net result, you'd have to assign the Browser property of the underlying HttpContext.Current.Request object (there's no set on the HttpRequestBase).
Aug 08, 2012 06:08 AM|LINK
Can anybody gives me more precise source code or other ideas?