ASP.NET按钮链接覆盖URL中的文件夹扩展名

时间:2012-12-19 20:38:48

标签: c# asp.net jquery-mobile

我觉得这个问题几乎是愚蠢的,因为我认为答案可能非常基本。但是,就在这里。

我正在设计一个带有“滚动骰子”按钮的网站,然后启用页面上的其他按钮(游戏中的类别),最终将使用这些按钮转到正确的类别。因此,实际上,[click“roll ...”],页面的C#(Game.aspx.cs)处理启用哪些按钮,显示/启用这些按钮以实现点击功能。

我的问题是:

页面是

[domain]/UncommonSense/Game.aspx

但点击“滚动...”按钮后,网址将变为

[domain]/Game.aspx#/Game.aspx

这会导致categories按钮出现问题,因为我需要重定向到

[domain]/UncommonSense/Question.aspx

但由于Game.aspx#/取代UncommonSense/,因此失败。

CODE:

好的,这是我的Game.aspx文件中的代码。按钮是“Label12”下面的“ID = Roll”按钮。后面的代码现在字面上是一个空白函数,因此除了回发(显然)之外它在C#端没有做任何事情。但是,单击该按钮时,URL将来自:

[域] /UncommonSense/Game.aspx 至 [域] /Game.aspx#/Game.aspx

注意:我刚刚从根目录进行了测试,它做了同样的事情:

[域] /Game.aspx 成为 [域] /Game.aspx#/Game.aspx

这可能与表格有关吗?

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Game.aspx.cs" Inherits="Uncommon_Sense.Game" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Uncommon Sense</title> 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
    <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
    <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
    <script type="text/javascript">
</script>
</head>
<body>
    <form id="form1" runat="server">
    <div data-role="page">
    <div data-role="header" data-theme="b">
        <h1><asp:Label ID="Label1" runat="server" Text="Uncommon Sense"></asp:Label></h1>
    </div>


    <div data-role="content">
        <h4><asp:Label ID="Label4" runat="server" Text="Game Statistics"></asp:Label></h4>
        <asp:Label ID="Label11" runat="server" data-mini="true" Text=""></asp:Label>
        <asp:Label ID="Label10" runat="server" data-mini="true" Text=""></asp:Label>

        <h4><asp:Label ID="Label2" runat="server" Text="Game Play"></asp:Label></h4>
<asp:Button ID="Roll" runat="server" Text="Roll Dice ..." data-mini="true" 
            onclick="Roll_Click" />
        <hr width="80%" />
    <div class="ui-grid-c">

    <div class="ui-block-a">
        <asp:Button ID="btnShortStuffChecked" runat="server" Text="Short Stuff" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnShortStuffNotChecked" runat="server" Text="Short Stuff" data-mini="true" 
            Enabled="False" Visible="False" onclick="btnShortStuffNotChecked_Click" /></div>
    <div class="ui-block-b">
        <asp:Button ID="btnWhoSaidChecked" runat="server" Text="Who Said?" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnWhoSaidNotChecked" runat="server" Text="Who Said?" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    <div class="ui-block-c">
        <asp:Button ID="btnCommonQuipChecked" runat="server" Text="Common Quip" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnCommonQuipNotChecked" runat="server" Text="Common Quip" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    <div class="ui-block-d">
        <asp:Button ID="btnRhymeTimeChecked" runat="server" Text="Rhyme Time" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnRhymeTimeNotChecked" runat="server" Text="Rhyme Time" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    <div class="ui-block-a">
        <asp:Button ID="btnAnythingGoesChecked" runat="server" Text="Anything Goes" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnAnythingGoesNotChecked" runat="server" Text="Anything Goes" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    <div class="ui-block-b">
        <asp:Button ID="btnDefineItChecked" runat="server" Text="Define It" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnDefineItNotChecked" runat="server" Text="Define It" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    <div class="ui-block-c">
        <asp:Button ID="btnAllAbroadChecked" runat="server" Text="All Abroad" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnAllAbroadNotChecked" runat="server" Text="All Abroad" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    <div class="ui-block-d">
        <asp:Button ID="btnSpellItChecked" runat="server" Text="Spell It" data-mini="true" 
            data-icon="check" Enabled="False" Visible="False" />
        <asp:Button ID="btnSpellItNotChecked" runat="server" Text="Spell It" data-mini="true" 
            Enabled="False" Visible="False" /></div>
    </div>
        <h4><asp:Label ID="Label3" runat="server" Text="Settings"></asp:Label>
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Question.aspx">HyperLink</asp:HyperLink>
        </h4>

    <label for="slider-0">Computer Difficulty:</label>
   <input type="range" name="slider" id="slider-0" value="2" min="1" max="4"  />
        <h3><asp:Label ID="Label5" runat="server" Text="Label"></asp:Label></h3>
        <asp:Button ID="ChoiceA" runat="server" Text="Button" onclick="ChoiceA_Click" />
        <asp:Button ID="Button2" runat="server" Text="Button" Visible="False" />
        <asp:Button ID="Button3" runat="server" Text="Button" Visible="False" />


</div>
</div>
    </form>
</body>
</html>

更新:

答案是...... JQuery Mobile!

通过简单地删除对JQuery Mobile的引用,问题就解决了,显然这是他们的库中更改URL的内容。这很糟糕,因为我喜欢使用JQuery Mobile。哦,好吧,我的评论现在将停止在烦恼,因为我很感谢他们做的99.9%的帮助。但是,为了记录......

任何链接都会:

linker.aspx

更改为:

接头#/ linker.aspx

出于某种原因。

0 个答案:

没有答案