Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have around 10 User Controls designed and accessed in Single "aspx" page.

Each User Control has Page Load event with "!IsPostback" condition where I am binding details to Grid View.

I access controls based on respective menu/button click to load that control on aspx page. But on Click of menu or button "IsPostback" is "true" and Grid view available in User Control is not binding when control is loaded.

So how can I make IsPostBack as false while loading User Control? Or is there any other solution to solve this problem?

Please reply. Its Urgent.

Regards,
Rashmi.MK
Posted

So u want to display database in Gridview view So inpage load calls the function of Gridview().
void loadgrid()
{
ds=new dataset()
ad=new sqldataadapter("select * from table",con);
ad.fill(ds);
gridview1.datasource=ds;
gridview1.databind();
}

call the loadgrid function in page load.
 
Share this answer
 
v2
call you girdload method onclick button event after all work finish
like:
void button_click(sender sender,enentargs e)
{
   --your code here
   -- now call your method here
}
 
Share this answer
 
v3
Put a break point in pageLoad. Sometimes VS may raise a problem. Or Check that you have actually called the function in PageLoad or not.
 
Share this answer
 

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