选择选项卡时调用函数 [英] Call a function while a Tab is selected

查看:66
本文介绍了选择选项卡时调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我,我是非常新的asp.net

in ma .aspx

我有一个 Ajax Tab容器 .And第一个选项卡(Exam)包含一些标签和文本框,Second(View Exams)包含一个gridview。

我有一个填充Gridview的方法,即

please help me,I am very new to asp.net
in ma .aspx
I have a Ajax Tab container.And First tab(Exam) contains Some labels and textbox,Second (View Exams) contains a gridview.
I have a method to fill the Gridview ie,

Public void GridFill()
{
    //my C# code here
}



现在我想在点击查看考试时调用该方法Tab


Now i want to call the method while we click on the View Exam Tab

推荐答案

将tabcontainer的 AutoPostBack 属性设置为 true 并引发事件使用 OnActiveTabChanged 事件。见:

HTML:

Set AutoPostBack property of tabcontainer to true and raise an event use OnActiveTabChanged Event. See this:
HTML:
<cc1:tabcontainer id="TabContainer1" runat="server" autopostback="true" font-names="Calibri" activetabindex="0" width="710px" cssclass="yui" align="left" onactivetabchanged="TabContainer1_ActiveTabChanged" xmlns:cc1="#unknown"></cc1:tabcontainer>



Code Behind:


Code Behind:

protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
{
    //Call your function here.
}







- Amit

这篇关于选择选项卡时调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆