asp.net按钮不会回复Colorbox

时间:2014-07-02 10:57:00

标签: jquery asp.net colorbox

使用ColorBox http://colorpowered.com/colorbox/

时,我无法从文本框中获取值

我有一个打开ColorBox Inline Html的表单。在defult3.aspx页面中,当我点击按钮时我有一个asp.net按钮我想要更改按钮的名称。但按钮onclick不起作用!

default3.aspx

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

<!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">

<link rel="stylesheet" href="css/colorbox.css" />
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
        <script src="js/jquery.colorbox.js"></script>
    <title></title>
    <script type="text/javascript">
        $(document).ready(function () {
            $(".example8").colorbox({ width: "50%", inline: true, href: "#inline_example1" });

        });
    </script>
    <style>
            body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
            a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
            h2{font-size:13px; margin:15px 0 0 0;}
        </style>


</head>
<body>
<form id="form1" runat="server">
     <a class='example8'
        href="#">Inline HTML</a></p>
    <!-- This contains the hidden content for inline calls -->
    <div style='display: none'>
        <div id='inline_example1' style='padding: 10px; background: #fff;'>
            <asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click" />
        </div>

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

default3.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default3 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Button1.Text = "test is ok";
    }
}

我读了这些页面但是测试了那些骚动 但我的计划不正常

http://midnightprogrammer.net/post/ASPNET-Postback-Issue-with-Colorbox-jQuery-Plugin/
http://stackoverflow.com/questions/12564254/close-colorbox-on-postback
http://stackoverflow.com/questions/2434659/colorbox-jquery-plug-in-my-textbox-values-are-empty-after-postback
http://stackoverflow.com/questions/6929654/jquery-colorbox-breaks-postbacks-in-asp-net-web-forms

此页面与我的问题最相关

http://stackoverflow.com/questions/4785684/colorbox-asp-net-button-wont-postback

但是当我使用这个解决方案时,我点击按钮

后关闭了对话框

感谢您的帮助

0 个答案:

没有答案