Click here to Skip to main content
15,889,411 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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,
C#
Public void GridFill()
{
    //my C# code here
}

Now i want to call the method while we click on the View Exam Tab
Posted
Updated 3-Jun-13 18:44pm
v2
Comments
Samresh.ss 4-Jun-13 1:09am    
Why don't you fill up the grid in the first place, if it is not dynamic.

1 solution

Set AutoPostBack property of tabcontainer to true and raise an event use OnActiveTabChanged Event. See this:
HTML:
ASP.NET
<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:
C#
protected void TabContainer1_ActiveTabChanged(object sender, EventArgs e)
{
    //Call your function here.
}



--Amit
 
Share this answer
 
Comments
Shafeequl 4-Jun-13 1:21am    
Thanks Amit...
I already tried this..but i forgot to set autopostback to true..
thanks again
_Amy 4-Jun-13 1:21am    
Welcome. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900