的fancybox模式里面Asp.net控制不"工作" [英] Asp.net control inside of fancybox modal is not "working"
问题描述
您典型的它不工作吓坏了事情在这里。任何方向会有所帮助。
Your typical "It doesn't work" freak out going on over here. Any direction would help.
我有我的母版页上的登录控制和我想只使用jQuery的fancybox显示出来,然后重定向用户一旦登录。
I have a login control on my master page and I'm trying to only display it using jquery fancybox and then redirect the user once they are logged in.
但是,当,当我把花哨的盒子里面都没有响应pressed认为应该做的东西任何按钮或控制。如果我继续在div可见,然后使用控制不使用的fancybox我得到预期的结果。
But any buttons or controls that should do "something" when pressed when I put inside the fancy box are not responding. If I keep the div visible and then use the control not using fancybox I get the expected result.
我有哪些选择?
推荐答案
这不是一个JavaScript错误。我宁愿说使用的fancybox模式时,
的fancybox创建一个新的窗口,你再也不能达到C-背后的$ C $。
It is not a Javascript error. I would rather say that when using Fancybox modal, Fancybox creates a new "window" and you can no longer reach the code-behind.
您需要做的就是创建一个hiddenfield和javascript函数通过它可以将数据对象发送到hiddenfield。
What you need to do is create a hiddenfield and a javascript function via which you can send the data object to the hiddenfield.
*的fancybox文本框(里面的fancybox) - >在发送产品:Javascript按钮创建一个文本框的对象(值),发送到ASP:Hiddeenfield。 - >从HiddenField到你需要做什么?
*Fancybox textbox (inside fancybox) ->On Send: Javascript button creates a object(value) of the textbox and sends to asp:Hiddeenfield. -> From HiddenField to what you need to do???
div#inline2 {display: none;}
.myDummyClass {height: inherit;}
<!--Link that activates the fancybox with textbox-->
<a href="#inline2" class="myDummyClass">LinkName</a>
<!--this will be shown in fancybox-->
<div id="inline2">
<p>
<asp:TextBox ID="tBox" runat="server" TextMode="MultiLine" Width="200px" Style="overflow:hidden; height:400px;" />
<asp:Button runat="server" Text="Knappen" OnClientClick="Send()" />
</p>
</div>
<input id="HiddenField" type="hidden" runat="server" />
<script>
$(".myDummyClass").focus(function() {
$(".myDummyClass").fancybox({
'modal': true
});
});
function Send()
{
document.getElementById("<%=HiddenField.ClientID %>").value = document.getElementById("<%=txt1.ClientID%>").value;
$.fancybox.close();
}
</script>
codeBehind :
var SomeThing = HiddenField.Value;
这篇关于的fancybox模式里面Asp.net控制不&QUOT;工作&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!