必须放在带有runat

必须放在带有runat

本文介绍了“Button”类型的“Control”ContentPlaceHolder1_rptProducts_btnShowDetails_0'必须放在带有runat = server的表单标签内。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Below is my complete master page contains , on which i have multiple forms before , after main content place holder .. 

I know there should be only one form tage with runat=server which i kept inside my main content place holder so all my child pages who will take master pageget forms functionality ..

But when i created my next page which has this master page .. and i have created there repeatwer and inside it a button .. when i click this button it gave me following error 


"Control 'ContentPlaceHolder1_rptProducts_btnShowDetails_0' of type 'Button' must be placed inside a form tag with runat=server."


so i am wondering what went wrng ,,

<%@ Master Language="C#"  AutoEventWireup="true" CodeBehind="UserMaster.master.cs" Inherits="AutoSpareParts.UserMaster" %>



<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title></title>
    
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Spare Parts-Index</title>
        
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        
        
        
        <script type="text/javascript" src="../scripts/jquery.min.js"></script>
        
        
        
        
        <script type="text/javascript" src="../scripts/responsiveslides.min.js"></script>
        <script type="text/javascript" src="../scripts/jquery.tinycarousel.js"></script>

        <script type="text/javascript">
            // You can also use "$(window).load(function() {"
            $(function () {

                // Slideshow 1
                $("#slider1").responsiveSlides({
                    auto: true,
                    pager: true,
                    nav: true,
                    speed: 500,
                    maxwidth: 900,
                    namespace: "centered-btns"
                });

            });

        </script>

        <script type="text/javascript">
            $(document).ready(function () {
                $(".Title_FastFinder").click(function () {
                    $(".sercah_finder").slideToggle("slow");
                });

                $(".close").click(function () {
                    $(".sercah_finder").css("display", "none");
                });

            });
        </script>

        <script type="text/javascript">
            $(document).ready(function () {
                $('#slider2').tinycarousel();

            });
        </script>

        

        <script type="text/javascript" src="../scripts/jquery.contactable.js"></script>

        <script type="text/javascript">
            jQuery(function () {
                jQuery('#my-contact-div').contactable(
                {
                    subject: 'feedback URL:' + location.href,
                    url: '',
                    name: 'Name',
                    email: 'Email',
                    dropdownTitle: 'Services',
                    dropdownOptions: ['Repairing', 'Rent', 'Buy'],
                    message: 'Message',
                    submit: 'SEND',
                    recievedMsg: 'Thank you for your message',
                    notRecievedMsg: 'Sorry but your message could not be sent, try again later',
                    disclaimer: 'Please feel free to get in touch, we value your feedback',
                    hideOnSubmit: true
                });
            });
        </script>

        <script src="scripts/jquery-ui.js"></script>

        <script type="text/javascript">
            $(document).ready(function () {
                var isMobile = window.matchMedia("only screen and (max-width: 1024px)");

                if (isMobile.matches) {
                    jQuery("#nav1 li a").on("click", function (e) {
                        if (jQuery(this).parent().has("ul")) {
                            e.preventDefault();
                        }
                        $(this).next('ul').slideToggle();
                    });
                }
                $(".nav").click(function () {
                    $("ul#nav1").toggle();

                });

            });
        </script>

    
</head>
<body>
    
    
    
        
        
            
            
            
                
                    
                         
                             
                                 
                                    
                
                
                    Register Log In Currencies
                    <select class="currency_boxtop">
                        <option>Rupees</option>
                        <option>Euro</option>
                        <option>Us Dollar</option>
                    </select>
                
                
            
            
        
        
    
    

    
    
        
        
            
                
                    
            
            
                <form name="search" method="post" action="">
                    <input type="text" name="search" id="" class="search" value="Search for category ,product or brand" />
                    
                        
                    
                    <input type="submit" name="" value="Search" class="search_submit" />
                    
                </form>
            
            
                <input type="submit" name="" value="ADD TO CART" class="Add_Cart" />
                
                Items:0 | Total: Rs.0.00
                
                    <input type="submit" name="" value="Chekout" class="checkout_button" />
                
            
            
        
        
    
    

    

    

        
        
            
                
            
            
                 
                <form name="finder" action="">
                    Select Your Vehicle
                    
                </form>
                
                    
                        <label class="label_01">Make</label>
                    
                    <select class="select_finder">
                        <option>Make</option>
                        <option>Lorum</option>
                        <option>Lorum</option>
                    </select>
                    
                    
                
                
                    
                        <label class="label_01">Model</label>
                    
                    <select class="select_finder">
                        <option>Model</option>
                        <option>Lorum</option>
                        <option>Lorum</option>
                    </select>
                    
                    
                
                
                    
                        <label class="label_01">Year</label>
                    
                    <select class="select_finder">
                        <option>Year</option>
                        <option>2014</option>
                        <option>2013</option>
                    </select>
                    
                    
                
                
                    
                        <label class="label_01">Engine</label>
                    
                    <select class="select_finder">
                        <option>100cc</option>
                        <option>200cc</option>
                        <option>Lorum</option>
                    </select>
                    
                    
                
                
                    
                        <label class="label_01">Fuel</label>
                    
                    <select class="select_finder">
                        <option>Fuel</option>
                        <option>Lorum</option>
                        <option>Lorum</option>
                    </select>
                    
                    
                
                
                    <input type="submit" class="find_sub" value="Find" />
                
                <%--</form>--%>
            
        
        
        
            
                
            
            
                
                    
                        My Account
                            <%--
                                Register
                                Login
                            --%>
                        
                        What's New
                             
                                Cat 1
                                Cat 2
                            
                        
                        Specials
                        Support
                        Fix My car
                        About Us
                        Contact Us
                    
                
                Car Parts
                Accessories
                Tools
                Batteries
                Engine Oil
                Summer
            
            
        
    

    
    

    
        <form id="form1"  runat="server" method="post">
            
        </form>
    

    
    
        
            
                
                    
                        Information
                    
                    
                        Our Offers
                    
                
                
                    
                        Your Account
                    
                    
                        
                            Get In Touch 
                        
                    
                
            
            
        
        
            
                
                    About Us
                    Sitemap
                    Contact Us
                    Terms & Conditions
                    Refund Policy
                
            
            
                
                    Whats New?
                    Top Sellers
                    Specials
                    Categories
                    Review
                
            
            
                
                    My Account
                    Register
                    Add to cart
                    Support
                    Locations
                
            
            
                
                    
                         
                             
                                 
                                    
                
                Subscribe to Newsletter
                
                    <input type="text" name="search" id="" class="search" value="[email protected]" />
                    <input type="submit" name="" value="Subscribe" class="search_submit" />
                
            
        
    
              
    
        

        
    

</body>
</html>

推荐答案




这篇关于“Button”类型的“Control”ContentPlaceHolder1_rptProducts_btnShowDetails_0'必须放在带有runat = server的表单标签内。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 02:51