Dynamic Carousel image resolution

Asked

Viewed 113 times

0

I’m having problems solving the images that comes inside the carousel, have to set a pattern by css or javascript ? follow the images inserir a descrição da imagem aqui

follows my aspx code:

  <div id="paginas">
        <div class="sliderFrame">
           <div id="slider">
                <asp:PlaceHolder runat="server" ID="phFotos"></asp:PlaceHolder>

            </div>
        </div> 

*BS put * because it did not load tags

.CS:

public partial class ImovelDetalhe : System.Web.UI.Page
    {
        private ImovelBo _imovelBo;

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                carregarInformacoes();
            }
        }

        private void carregarInformacoes()
        {
            int codigoImovel = 0;
            Int32.TryParse(Request.QueryString["CodImovel"], out codigoImovel);

            _imovelBo = new ImovelBo();
            var imovel = _imovelBo.ObterDetalhe(codigoImovel);

            if (imovel != null)
            {
                lblDescricao.Text = imovel.Descricao;
                lblOperacao.Text = imovel.Operacao;
                lblCidade.Text = imovel.Cidade;
                lblLocalizacao.Text = imovel.Localizacao;
                lblTipoImovel.Text = imovel.Tipo;
                lblQtDormitorios.Text = imovel.QntDormitorio.ToString();
                lblValor.Text = imovel.Valor.ToString("#,##0.00");

                if (imovel.Fotos != null)
                {
                    foreach (var item in imovel.Fotos)
                    {
                        Image foto = new Image();
                        foto.Width = 700;
                        foto.Height = 306;
                        foto.ImageUrl = item;
                        phFotos.Controls.Add(foto);
                    }
                }
            }
        }
    }
}

*I set the sizes here just so didn’t work out wanted to leave more or less like this : inserir a descrição da imagem aqui

from now on thank

  • Hello André, you applied width/height and still nothing happened? Is that it? You want to expand the photo as in the second image?

  • I did the test with the same code and the image resized without problem, please make sure that the external Divs to the placeholder are not influencing. C# code works. Ta with CSS adjustment face. :)

  • So I applied width and height and even then there was no effect has photos that fits perfectly in the slideshow and other that are very applied ... and the css already made the changes and there was no effect

  • Could I have access to the images you use to test and html/css? For me to test the example more faithfully.

  • 1

    Rodrigo, I managed to solve this problem add a Hendler for images, thank you so much for your help

  • Opa André, glad you found a solution, sometimes just changing the way to solve even kkk. Success in the project!

  • Thank you partner! Good week

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.