LinkButton control and page anchor not working in Mobile 6.0

Discussion in 'ASP .Net' started by David C, Jun 10, 2008.

  1. David C

    David C Guest

    I have posted this question, which I think is very simple on several
    sites, and nobody seems to know what I am talking about. At my wits
    end here. Please help.

    I am putting together a site for mobile devices using regular ASP.NET
    controls after giving up on "Mobile Web Forms" for several reasons.
    Two problems.

    LinkButton
    ========

    The LinkButton control does not work in Mobile 6.0, even though it
    works fine with the Mobile 6.0 emulators. My particular make and
    model is Palm Treo 750, but I am observing similar issues with other
    brands such as HTC, and Kiser.

    When the user presses a LinkButton, it simply does not respond. Is
    there a setting in the browser that can change? I know that it works
    with Mobile 5.0, but not 6.0 (although emulators seem to have no
    trouble with it). I suppose one option is the replace all LinkButtons
    with Buttons, but I really don't want to do that.

    Page Anchor
    =========

    Can't get it to work. When my URL looks like "myhpage.aspx?
    id=85565#A" to redirect to an anchor within a page, it does not work
    in any of the mobile devices I've tested with including emulators. Is
    there a workaround to this? This is very important since the limited
    size of the mobile screen, so I want to do what I can to help the user
    not have to scroll a lot.

    I have put together a sample application to demonstrate my problem.
    Here is the link to it.
    http://junk.petrotools.com/From.aspx

    The code files are really simple.
    ***From.aspx
    <form id="form1" runat="server">
    <div>
    <asp:LinkButton ID="LinkButton1" runat="server"
    OnClick="LinkButton1_Click">Click Me</asp:LinkButton>
    <br />
    <asp:Label ID="Label1" runat="server"></asp:Label><br />
    <br />
    <asp:Button ID="Button1" runat="server"
    OnClick="Button1_Click" Text="Send Me to another page" /></div>
    </form>
    ***From.aspx.cs
    public partial class From : System.Web.UI.Page
    {
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
    Label1.Text = "you clicked a link button";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
    Response.Redirect("ToPage.aspx#A");
    }
    }

    ToPage.aspx
    <form id="form1" runat="server">
    <div>
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <br />
    <a name="A">Here is my anchor</a>

    </div>
    </form>
     
    David C, Jun 10, 2008
    #1
    1. Advertising

  2. David C

    bruce barker Guest

    there a lot of issues with smart phones.

    the link button requires javascript support and should be avoided on a
    mobile phone unless its an iphone (which has full javascript and css
    support).

    also many wireless carriers use a proxy infront of web sites that reformats
    the html (some may strip the bookmarks) and will not execute javascript or
    send to the phone.

    if you are not doing a form post, just use a hyperlink (maybe with a url
    arg). also as the network is slow, you should use seperates pages, not
    bookmarks.

    -- bruce (sqlwork.com)


    "David C" wrote:

    > I have posted this question, which I think is very simple on several
    > sites, and nobody seems to know what I am talking about. At my wits
    > end here. Please help.
    >
    > I am putting together a site for mobile devices using regular ASP.NET
    > controls after giving up on "Mobile Web Forms" for several reasons.
    > Two problems.
    >
    > LinkButton
    > ========
    >
    > The LinkButton control does not work in Mobile 6.0, even though it
    > works fine with the Mobile 6.0 emulators. My particular make and
    > model is Palm Treo 750, but I am observing similar issues with other
    > brands such as HTC, and Kiser.
    >
    > When the user presses a LinkButton, it simply does not respond. Is
    > there a setting in the browser that can change? I know that it works
    > with Mobile 5.0, but not 6.0 (although emulators seem to have no
    > trouble with it). I suppose one option is the replace all LinkButtons
    > with Buttons, but I really don't want to do that.
    >
    > Page Anchor
    > =========
    >
    > Can't get it to work. When my URL looks like "myhpage.aspx?
    > id=85565#A" to redirect to an anchor within a page, it does not work
    > in any of the mobile devices I've tested with including emulators. Is
    > there a workaround to this? This is very important since the limited
    > size of the mobile screen, so I want to do what I can to help the user
    > not have to scroll a lot.
    >
    > I have put together a sample application to demonstrate my problem.
    > Here is the link to it.
    > http://junk.petrotools.com/From.aspx
    >
    > The code files are really simple.
    > ***From.aspx
    > <form id="form1" runat="server">
    > <div>
    > <asp:LinkButton ID="LinkButton1" runat="server"
    > OnClick="LinkButton1_Click">Click Me</asp:LinkButton>
    > <br />
    > <asp:Label ID="Label1" runat="server"></asp:Label><br />
    > <br />
    > <asp:Button ID="Button1" runat="server"
    > OnClick="Button1_Click" Text="Send Me to another page" /></div>
    > </form>
    > ***From.aspx.cs
    > public partial class From : System.Web.UI.Page
    > {
    > protected void Page_Load(object sender, EventArgs e)
    > {
    >
    > }
    > protected void LinkButton1_Click(object sender, EventArgs e)
    > {
    > Label1.Text = "you clicked a link button";
    > }
    > protected void Button1_Click(object sender, EventArgs e)
    > {
    > Response.Redirect("ToPage.aspx#A");
    > }
    > }
    >
    > ToPage.aspx
    > <form id="form1" runat="server">
    > <div>
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <br />
    > <a name="A">Here is my anchor</a>
    >
    > </div>
    > </form>
    >
     
    bruce barker, Jun 10, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sathyaish
    Replies:
    3
    Views:
    3,113
    Sathyaish
    Sep 8, 2005
  2. chen selina
    Replies:
    0
    Views:
    1,325
    chen selina
    Jul 13, 2010
  3. Sathyaish

    Linkbutton does not look like a linkbutton

    Sathyaish, Sep 8, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    189
    Sathyaish
    Sep 8, 2005
  4. Mike McAllister
    Replies:
    11
    Views:
    391
    Yan-Hong Huang[MSFT]
    Feb 21, 2006
  5. David C
    Replies:
    2
    Views:
    808
    Damon B.
    Aug 31, 2008
Loading...

Share This Page