I have a basic asp.net page with an image upload loaded through an iframe:
<asp:TextBox runat="server" id="imgCaption" CssClass="imgCaption" PlaceHolder="caption(optional)" />
<asp:FileUpload runat="server" ID="programmImages" Width="200px" CssClass="offScreen" />
<asp:Button runat="server" id="hiddenImageUpload" OnClick="UploadImage" CssClass="insButton" Text="Upload" />
the image upload depends on the route data in order to upload but whenever i try to upload the image i get this error:
> Object reference not set to an instance of an object
on this line:
var ProgName = Page.RouteData.Values["prog"].ToString()
this line works fine in other pages.
so how can i retrieve the route data through the iframe.
Edited 14-Nov-12 12:02pm
If you're in an iframe, it's a different page. The values in the hosting page don't come in to it. You have to pass those values to the iframed page, on the URL as a query string parameter
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)