Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dynamically change iframe src

Status
Not open for further replies.

sramey00

Programmer
Jun 9, 2004
149
US
i have a lnkbutton in a datagrid.
commandname = viewpage
commandargument =
when the link is clicked the datagrid onitemcommand is called
and i want to set the attributes of the iframe source to the commandargument.

Code:
if (e.commandname == "viewpage")
  iframe1.attributes["src"] = e.commandargument.tostring();

however a null reference exception occurs...
the walkthrough shows e.commandargument.tostring() has a value ( but the error still states a null refernce occurs.
any thoughts as to what i'm doing wrong?




Mr. Steve
 
scratch that post... i didn't have runat=server in my <iframe/> html code

Mr. Steve

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top