.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Redirect to a mobile page

Posted By:      Posted Date: August 21, 2010    Points: 0   Category :ASP.Net
Hi please can anyone help? I have a simple website with a home page called defaut.aspx, also I have a page with in this site called mobile.aspx. My question is, bearing in mind that I posses very little knowledge of VB, what code do I need to place in the default.aspx to detect what kind of device someone is using and redirect them to the mobile page (mobile.aspx)? This needs to be quite up-to-date preferably for blackberry and nokia devices?


View Complete Post

More Related Resource Links

Detecting PPC device on startup page to redirect?

I was wondering (since a search didn't find any posts) if there is a way for my startup page to detect what kind of device (PocketPC or web browser specifically) is loading the page and if it is a PocketPC, then redirect to the mobile pages? I will only be using PocketPC's exclusively as a mobile device.

Thanks for any suggestions!

How to add favicon to a mobile page.


Hi All,

I want to know how to add favicon to a mobile page. I have created a sample web application(.net 2.0 ,c#) . I have added this code  <link rel="shortcut icon" type="image/gif" href="http://find.mobi/favicon.gif" />  in head tag. This is working fine, if I inherit my class from "System.Web.UI.Page".

but not working, if I inherit from System.Web.UI.MobileControls.MobilePage .Can any one tell suggest any reason or solution for this ? 

I need server side code to implement this .

Cannot set custom attributes on mobile controls in this page



I am beginner at mobile Pages with ASP.NET. And i want to make an application with contains  a few TextBox that have different size.

it's my sample code here:

<%@Page Inherits= "System.Web.UI.MobileControls.MobilePage" Language= "C# " %>
<%@ Register TagPrefix= "Mobile" Namespace= "System.Web.UI.MobileControls " Assembly= "System.Web.Mobile" %>
<Mobile:Form runat="server" id="form1" Paginate="true" >
<Mobile:Panel Paginate="True" runat=&

After login redirect to a desired page

Hi,   Just a simple question. After I click login button, I want to page be redirected to display.aspx. How to set up it? Sorry for the silly question.

How to set the variation root redirect page to ALWAYS go to a preset label?

Hi. I have setup variations and I have 4 labels, SE EN FI DK. This is a public website and I want every visitor to first be directed to the predetermined label, for example SE. This no matter what setting they have in their browser... In Sweden, most people have English as the language in the browser since this gets you better content in most places, but in this case, it gets them the EN label instead of the SE label as default. How can I change this in the best way possible? Are there any easily adaptable solutions available? Like on codeplex? The MSDN way is not to my liking, manually customize every front end or compile my own DLL....Noo, there has to be a better way right? (How to: Customize the Variations Label Control Logic http://msdn.microsoft.com/en-us/library/ms551625.aspx) Appreciate any help you can give me on this. RegardsThomas BalkestÃ¥hl - Technical Specialist - SharePoint

SharePoint 2010 Mobile Page Filter Settings

hello, i want to know from where i can edit the mobile page "task" list filter settings ? thanks

Response.Redirect in C# for page to page parameter passing

Looking for examples of this, but can't find anything specific. I'm new to ASP.NET, and C# at the same time... so I'm struggling to get it right...  Thanks, Nick

Edit filter settings in a mobile page

hello, how can i edit list filters using schema.xml in SP 2010 on a mobile page ?  thanks

Edit List Title on a Mobile Page

hello, i want to know if i can edit the title which the item is displayed on a mobile page e.g "New Task for Job No 2", can i edit the way its displayed? e.g can i add to it the start/end date also ? e.g "New Task for Job No 2 StartDate:current EndDate:current". thanks

Authentication required, redirect to login page

Hi,I want authentication required for all webpages in a site. If i copy the url of any of the web page in the current site and paste it in the url address i should redirect to login page. If you have any solution please suggest it.

SPWeb.Properties is not persist over the redirect page.

Hi, I have to pass some object from my code to another redirected page. So I serialize the object and serialized string is save to SPWeb's property as a string and after that I use SPUtility.Redirect('Url'). But on redirected page above updated property is not find in the SPWeb.Property collection. string xml = MyClass.GetXMLFromObject(exInfo); SPContext.Current.Web.Site.RootWeb.AllowUnsafeUpdates = true; SPContext.Current.Web.Site.RootWeb.Update(); if (!SPContext.Current.Web.Site.RootWeb.Properties.ContainsKey("MyInfo")) { SPContext.Current.Web.Site.RootWeb.Properties.Add("MyInfo", xml); SPContext.Current.Web.Site.RootWeb.Update(); } else { SPContext.Current.Web.Site.RootWeb.Properties["MyInfo"] = xml; SPContext.Current.Web.Site.RootWeb.Update(); } SPContext.Current.Web.Site.RootWeb.AllowUnsafeUpdates = false; SPContext.Current.Web.Site.RootWeb.Update(); SPUtility.Redirect("RedirectToErrorPage/ApplicationPage1.aspx?ExInfo=" +xml, SPRedirectFlags.RelativeToLayoutsPage, HttpContext.Current); Redirected page code: if (SPContext.Current.Web.Site.RootWeb.Properties["MyInfo"] != null) { using (SPWeb web = SPContext.Current.Site.OpenWeb(SPContext.Current.Web.Site.RootWeb.Url)) { TextBox1.Text = Convert.ToString(SPContext.Current.Web.Site.Root

how to redirect user to login page if session is null

i have 2 page,1.login.aspx ---  2.welcome.aspxin my login.aspx im storing username into sesssion as below:Session["usernm"] = txtUsername.Text;in my welcome.aspx  pagein page_load event if (Session["usernm"]==null)        {            Response.Redirect("Login.aspx");        }----- here if i manulally paste the url ( http://localhost:4125/Loginado/welcome.aspx) it should go to  login.aspx for user credentialsbut its going directly to welcome.aspx  page.

Redirect to Login Page from Generic Handler

Hi,I have created a asp.net generic handler to use it in auto-complete text box. Here is my code to it /// <summary>     /// Summary description for $codebehindclassname$     /// </summary>     [WebService(Namespace = "http://tempuri.org/")]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     public class ProductSearch : IHttpHandler, IReadOnlySessionState     {         public void ProcessRequest(HttpContext context)         {             String query = context.Request.QueryString["q"];             if (! string.IsNullOrEmpty(query))             {                 int sid =  Convert.ToInt32(HttpContext.Current.Session["ScenarioID"]);                 int evId =  Convert.ToInt32(HttpContext.Current.Session["EventID"]);                 var products = from p in Data.BO.Product.GetScenarioProducts(sid, evId, query) select new { id = p.ID, name = p.Name };                &nbs

Mobile redirect and the browser back button

Has anyone here ever successfully constructed a two-page mobile website with VB, one page for input and one page for displaying results?  If so, how do you call the results page and can you return to the input page using the back button on your mobile browser?  I have no problem creating such a website for regular browsers, but I simply cannot construct one for the iPhone or the Droid ... you can't return to the first page via the backbutton and still have it be functional; all you have is the graphics.  There is no load event for the page you're returning to.  It seems like mobile browsers don't handle server-side redirects properly.  If you open a new page via a hyperlink, you can return to the page you were on and it will still be functional; not so following a redirect to another page on your site. I've experimented endlessly with cache settings, redirect parameters, and the pagestatepersister class to no avail.  I need to know if I'm on a futile quest.  Can anyone offer confirmation for can do/can't do?    

Redirect to specific page based on user Roles

I am using Formsauthentication. My situation is as per below:the login form has codebehind :==============================protected void LoginButton_Click(object sender, EventArgs e)        {            TextBox uname = Login1.FindControl("UserName") as TextBox;            TextBox pass = Login1.FindControl("Password") as TextBox;            CheckBox rm = Login1.FindControl("RememberMe") as CheckBox;            Literal fail = Login1.FindControl("Literal1") as Literal;            if (Membership.ValidateUser(uname.Text, pass.Text))            {                /                FormsAuthentication.SetAuthCookie(uname.Text, rm.Checked);                            }        &

How to catch error in session variable in globals.asax(Application_Error) and redirect to same page

Hi, i have a login page where username got to enter his/her username or password. When you try to enter any scripting over there eg:'<asd>' it gives an error  'Server Error in '/' Application' 'A Potentially dangerous Request. Form value was detected from client' I don't want to redirect user to custom error page when such unpredictable error occurs. infact i got a label on the same page itself where error's are displayed. how can i display such errors on this very same label. can i do that using globals Application_Error ?. Session variable not working here. Please give me the exact steps for how i can catch and display the error which are not validated. waiting for reply thanks and regards, Learning Programmer

Edit item title in a list on a mobile page

hello, can i edit an item title for a list on a mobile page in MOSS 2010 ? e.g i want my list items to appear as "New task StartDate:current EndDate:current" that includes three things the list title,startdate and enddate for the item. thanks
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend