English 中文(简体)
在用户控制 asp.net C# 中披露 OnclicClick 函数 [重复]
原标题:Exposing OnclientClick function in user control asp.net C# [duplicate]
  • 时间:2012-05-25 10:14:47
  •  标签:
  • c#
  • asp.net
This question already has answers here:
Closed 11 years ago.

Possible Duplicate:
expose and raise event of a child control in a usercontrol in c#

我有一个 html 输入按钮的用户控制 。

在页面上我正在消耗用户控制。 我怎样才能在客户端中披露用户控制内部输入按钮的事件, 所以如果该按钮客户端可以拨打页面功能 。

<uc2:UC_LayoutSelector ID="UC_LayoutSelector1" runat="server" OnClientLayoutSelect="UC_LayoutSelector1_MyPageFunction" />

 <script type="text/javascript">

        function UC_LayoutSelector1_MyPageFunction(e) {
            alert(e);
        }
    </script>
问题回答

取决于您要达到的目标, 您可能只想创建输入按钮的客户属性上的公共属性。 如果您试图捕捉用户点击该按钮的瞬间, 您会想要用 javascript 函数进行后退并按程序提高事件控制。 这将允许您在父页上隐藏事件 。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签