Hi!
I'm trying to intsert an image to a Windows Form > Webpage project. I tried to insert an Image control to webpage and assign the image to the control:
- Image1.ImageUrl = "1.jpg";
- Image image = new Image();
- image.ID = "image1";
- image.ImageUrl = "1.jpg";
- image.ImageAlign = ImageAlign.AbsMiddle;
- image.Visible = true;
- Form.Controls.Add(image);
Thank you.


Jitendra Kumar164 reputationPosted Aug 24, 2018, 12:55 AM EDT
Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="StackOverFlow_2._Default" %> asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> asp:Content> asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> asp:Panel ID="pnlImages" runat="server">asp:Panel> asp:Content>Kasun Lee152 reputationPosted Aug 24, 2018, 8:46 AM EDT
"Parse error". I just wanna load an different image file dynamically when I select different radio buttons. For example: Radio button: Beatles -- a image of Beatles gotta be loaded. Radio button: Pink Floyd -- A pink Floyd image should load. Donno what to do. ANyways, thanks for the reply