asp.net - PreviousPage Findcontrol Issue -


i need text of following linkbutton set postback page:

<itemtemplate>      <asp:linkbutton id="linkbutton1" runat="server" text='<%# bind("computername") %>' postbackurl="~/assetdetails.aspx" commandname="select">linkbutton</asp:linkbutton> </itemtemplate> 

i have tried many things in receiving pages load event ended with:

dim gv gridview = trycast(previouspage.master.findcontrol("content").findcontrol("gridview2"), gridview) dim lb linkbutton = trycast(gv.selectedrow.cells(0).findcontrol("linkbutton1"), linkbutton) lblasset.text = lb.text 

obviously doesnt (returns blank, not null) work or not making post. :) please help!

you doing wrong way.

here gridview inside content page ( uses master page), access gridview present in content page as:

if (not (me.page.previouspage) nothing)     dim contentplaceholder1 control =                   me.page.previouspage.master.findcontrol("contentplaceholder1")     dim gv gridview =                   ctype(contentplaceholder1.findcontrol("gridview1"), gridview)      dim lb linkbutton =             trycast(gv.selectedrow.cells(0).findcontrol("linkbutton1"), linkbutton)     lblasset.text = lb.text end if 

gridview , other contents present inside contentplaceholder controls actually.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -