web parts - how to add webpartzone in sharepoint 2010 programmetically on c#? -


i have simple question , hard answer. want add webpartzone sharepoint page using c# code, how can that? search of web , found nothing. did is: create visual web part project , added code page_init event of it:

    protected void page_init(object sender, eventargs e)     {         webpartzone webpartzone1 = new webpartzone();         webpartzone1.allowlayoutchange = true;         webpartzone1.emptyzonetext = "no data provided";         webpartzone1.enabled = true;         webpartzone1.headertext = "my custom zone";         webpartzone1.visible = true;          this.page.controls.add(webpartzone1);     }  

and it's doesn't work. can give idea of want. im confused. help. anyway.

i think, you're trying bit wrong, you're trying add web part zone in web part. don't know if possible can try create via code master page.

i mean, not add created web part zone control in "this.page" master.


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -