The question is pretty simple. I have <asp:Image>one who lives in <asp:Panel>. My goal is to provide a very simple “preview” where alignment to the left, center, or right is selected. The panel is the entire printable area (a sheet of paper 8.5 x 11 inches), and the image inside is the area that will actually be printed. Full code:
<asp:Panel ID="Panel2" runat="server"
BackColor="Black"
BorderStyle="Inset"
Width="425px"
Height="550px" >
<asp:Image runat="server" Height="425px" ImageAlign="" />
</asp:Panel>
I set the property ImageUrlin the code behind, no problem. If I want to align the entire image to the left or right, I can just point ImageAlign="[Left|Right]". However, I could not find a way to center the image in the panel. I tried all the different ImageAlign values, and none of them seem to do what I want. Am I here SOL? If I need, I can change the CSS class for the image or panel, but I could not understand anything successful with this approach.
source
share