Click here to Skip to main content
15,902,447 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

i use theme to my website.
but i have a problem about navigation.
when i click button to my website,normally the button click action will works,however
its navigate to me to the:

http://localhost:44152/Find.aspx?ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl00%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl07%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl07%24btnSepeteAt.x=129&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl07%24btnSepeteAt.y=39&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl14%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl01%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl08%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl15%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl02%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl09%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl16%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl03%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl10%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl17%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl04%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl11%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl18%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl05%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl12%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl19%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl06%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl13%24txtAdet=1&ctl00%24ContentPlaceHolder1%24dlstUrunler%24ctl20%24txtAdet=1[^]

how can i fix this problem?


my aspx:
ASP.NET
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <form id="form1">
    <div>
        <asp:DataList ID="dlstUrunler" runat="server" RepeatColumns="3" DataKeyField="urunid" Width="507px" OnItemCommand="dlstUrunler_ItemCommand" >
        <ItemTemplate>
            <div style="text-align:center">
                <asp:Label ID="lblUrunAd" runat="server" Text='<%#Eval("urunad") %>'></asp:Label><br />
                <asp:ImageButton ID="ImgResim" runat="server" AlternateText='<%#Eval("urunad") %>' ImageUrl='<%#Eval("urunresimyolu1") %>' Width="100px" Height="120px" CommandName="detay" CommandArgument='<%#Eval("urunid") %>' /><br />
                <asp:Label ID="lblUrunFiyat" runat="server" Text='<%#Eval("urunfiyat", "{0:N}") %>'></asp:Label> <asp:TextBox ID="txtAdet" Text="1" TextMode="Number" runat="server" Width="30px"></asp:TextBox><br />
                <asp:ImageButton ID="btnSepeteAt" runat="server" ImageUrl="/images/sepeteekle.png" CommandName="sepet" CommandArgument='<%#Eval("urunid") %>'/>
            </div>
        </ItemTemplate>
    </asp:DataList>
</div>
       </form>
</asp:Content>


my master page aspx:
ASP.NET
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MasterPage.master.cs" Inherits="WebEc.MasterPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="http://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
	<link rel="stylesheet" href="style.css" type="text/css" />
	<link rel="stylesheet" href="css/dark.css" type="text/css" />
	<link rel="stylesheet" href="css/font-icons.css" type="text/css" />
	<link rel="stylesheet" href="css/animate.css" type="text/css" />
	<link rel="stylesheet" href="css/magnific-popup.css" type="text/css" />

	<link rel="stylesheet" href="css/responsive.css" type="text/css" />
	<meta name="viewport" content="width=device-width, initial-scale=1" />

	<!-- External JavaScripts
	============================================= -->
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/plugins.js"></script>


	<!-- Document Title
	============================================= -->
    <title></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body class="stretched">
    <form id="form1" runat="server">
         


    	<!-- Document Wrapper
	============================================= -->
  <div id="wrapper" class="clearfix">

        <!-- Top Bar
        ============================================= -->
        <div id="top-bar">

            <div class="container clearfix">

                

                <div class="col_half col_last fright nobottommargin">

                    <!-- Top Links
                    ============================================= -->
                    <div class="top-links">
                        
                    </div><!-- .top-links end -->

                </div>

            </div>

        </div><!-- #top-bar end -->
        <!-- Header
        ============================================= -->                    
      <header id="header" class="transparent-header semi-transparent full-header">
          <div id="header-wrap">

              <div class="container clearfix">


                  <div id="primary-menu-trigger">^__i class="icon-line-cross"></a>
                          <form action="search.aspx" method="get">
                              <asp:TextBox ID="txtSearch" runat="server" CssClass="form-control" Text="Arama Yapmak İçin Entera Basınız" ForeColor="Gray"></asp:TextBox>
                          </form>
                      </div>
                      <!-- #top-search end -->

                  </nav>
                  <!-- #primary-menu end -->

              </div>

          </div>

      </header><!-- #header end -->

      <section id="content">

          <div class="content-wrap">

              <div class="container clearfix">
                  <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                  </asp:ContentPlaceHolder>
              </div>

          </div>

      </section>
      
    </div><!-- #wrapper end -->
    <script type="text/javascript" src="js/functions.js"></script>

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


What I have tried:

move the button to the begining to the cs and its works fine
Posted
Updated 27-Apr-16 3:38am
v2
Comments
ZurdoDev 27-Apr-16 8:12am    
How can we know why if we can't see anything?
Member 10525430 27-Apr-16 8:31am    
what do you need? in my code?
ZurdoDev 27-Apr-16 8:41am    
You said, if you click a button it takes you to a long url. So, show the aspx of the button and any code behind it.
Suvendu Shekhar Giri 27-Apr-16 8:48am    
We can not see the websites/web apps running locally on your machine. so http://localhost:44152......... will be no use for us.

Please share the relevant code.. the code you have written for redirection probably.

1 solution

Remove <form id="form1"> from your <asp:Content>. You already have a form in the master page, and you cannot have nested forms.
 
Share this answer
 
Comments
Member 10525430 27-Apr-16 9:43am    
its not working and button action never called
Richard Deeming 27-Apr-16 9:47am    
Define "not working"?
Member 10525430 27-Apr-16 9:49am    
when i press the button nothing happened.
no working button action
Richard Deeming 27-Apr-16 9:54am    
Does the page post to the server when you click the button, or does it do nothing?

If it's posting to the server, then there's something wrong with your code-behind, which you haven't shown.

If it's doing nothing, then check the browser's error console for script errors.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900