vb.net - Using panels in ASP.net -
i created textbox, button , panel in page. aim create links put inside panel. however, turns out every time add one, seems replace created link. there way add links, not replacing created links? don't have background in asp.
this code researched.
protected sub button1_click(byval sender object, byval e eventargs) handles button1.click dim link new hyperlink() dim ltr new literal() link.text = textbox1.text link.navigateurl = "default.aspx?field1=" + textbox2.text + " " ltr.text = "<br/>" panel1.controls.add(ltr) panel1.controls.add(link)
please me. thanks!
as said @rex, when post occurs dynamically controls removed page until retain them in init event.
while adding controls placeholder, save same data id, text..etc. in object session variable , retrieve same data in page init event , add place holder.
protected void page_init(object sender, eventargs e) { // retrieve session variable , add same data place holder. }
Comments
Post a Comment