开发者

breakpoint problem in asp.net

开发者 https://www.devze.com 2022-12-22 17:59 出处:网络
I\'ve posted a breakpoint in web user control. But Control is not going on breakpoint. Why is this happening.

I've posted a breakpoint in web user control. But Control is not going on breakpoint. Why is this happening. I have done inline code.

<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="IBlog.Web.HandleUserControl" %>

<script language="C#" runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        Pagemenu.pageload();
    }
    public string Geturl(string url)
    {
        return Pagemenu.Geturl(url);
    }
    protected void menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
        Pagemenu.menu1_MenuItemClick(sender, e);
    }

    //protected void Page_SelectedIndexChanged(object sender, EventArgs e)
    //{
    //    Pagemenu.Page_SelectedIndexChanged(sender, e);

    //}

    //protected void MoreClick(object sender, EventArgs e)
    //{
    //    DataList2.Visible = true;

    //}

    protected void lbmore_Click(object sender, EventArgs e)  //this is the code i want to debug
    {

    }
</script>

 <script type="text/javascript">
    function mover()
    {
    var elem = document.getElementById("<%= DataList2.ClientID %>");
    elem.style.display="block"

    }
    function mout()
    {
    var elem = document.getElementById("<%= DataList2.ClientID %>");
    elem.style.display="none" 
    }

</script>

<div class="navi">
    <div class="pages">
        <ul>
            <asp:DataList ID="DataList1" runat="server" RepeatDirection="Horizontal">
                <ItemTemplate>
                    <li><a href='<%#Geturl((string)DataBinder.Eval(Container.DataItem, "URL"))%>'>
                        <%# DataBinder.Eval(Container.DataItem, "Title") %>
                    </a></li>
                </ItemTemplate>
            </asp:DataList>
        </ul>
    </div>
     <asp:LinkButton ID="lbmore" runat="server" Text="More" OnClick="lbmore_Click"></asp:LinkButton>
    <div class="pages2" id="more" runat="server">

        <%--<a href="" onmouseover="mover()" onmouseout="mout()">More</a>--%>
        <ul style="background-color: #626669; padding: 0 6px 0 6px; margin: 28px 0 0 0px">
            <asp:DataList ID="DataList2" runat="server" Visible="false">
                <ItemTemplate>
                    <li style=开发者_C百科"float: left;"><a href='<%#Geturl((string)DataBinder.Eval(Container.DataItem, "URL"))%>'>
                        <%# DataBinder.Eval(Container.DataItem, "Title") %>
                    </a></li>
                </ItemTemplate>
                <ItemStyle Wrap="True" />
            </asp:DataList>
        </ul>

    </div>
</div>


You've got an empty method - the framework won't allow you to attach a debugger in there, as there's nothing to do - the compiler will have optimised that code base out, as there's no code in the method.

Have you tried adding some simple code in the method to force it to do something (declare, set and view a variable for example)?

Edit to respond to comments

You have specified debug="true" in your web.config, and you have attached Visual Studio to the web site (either by pressing F5 in VS with the project loaded, or through "Debug | Attach to process...")?

Are you building a Web Application (you have to compile the project to see changes in code, you have a /bin folder in the root with a dll in in) or a web site (you don't have to compile things, you have an /app_code folder for shared classes, etc).

0

精彩评论

暂无评论...
验证码 换一张
取 消