protected void Page_Load(object sender, EventArgs e) { //CARREGAR TODAS AS COMBOS NetworkCredential myCredentials = new NetworkCredential("convidado", "convidado"); wsCateg.Credentials = myCredentials; Resgetallcategorias allCategorias = wsCateg.getallcategorias(); ListItem seleccionaCateg = new ListItem(); seleccionaCateg.Text = "Seleccione Categoria !"; seleccionaCateg.Value = "0"; DDLListaAllCategorias.Items.Add(seleccionaCateg); foreach (Categoria1 cat in allCategorias.categorias) { //INSERIR NA DDL ListItem elementoCategoria = new ListItem(); elementoCategoria.Text = cat.nome; elementoCategoria.Value = cat.id.ToString(); DDLListaAllCategorias.Items.Add(elementoCategoria); } }
protected void Page_Load(object sender, EventArgs e) { //VALIDAR WEBSERVICE wsCateg.Credentials = myCredentials; //OBTER TODAS AS CATEGORIAS Resgetallcategorias allCategorias = wsCateg.getallcategorias(); DDLSeleccionaCategoria.Items.Add("SELLECIONE UM PRODUTO !"); foreach (Categoria1 cat in allCategorias.categorias) { //INSERIR NA DDL ListItem elementoCategoria = new ListItem(); elementoCategoria.Text = cat.nome; elementoCategoria.Value = cat.id.ToString(); DDLSeleccionaCategoria.Items.Add(elementoCategoria); } }
protected void Page_Load(object sender, EventArgs e) { //CARREGAR TODAS AS CATEGORIAS PARA DDL NetworkCredential myCredentials = new NetworkCredential("convidado", "convidado"); wsCateg.Credentials = myCredentials; //OBTER TODAS AS CATEGORIAS //Resgetallcategorias allCategorias = wsCateg.getallcategorias(); Resgetallcategorias allCategorias = wsCateg.getallcategorias(); foreach (Categoria1 cat in allCategorias.categorias) { //INSERIR NA DDL ListItem elementoCategoria = new ListItem(); elementoCategoria.Text = cat.nome; elementoCategoria.Value = cat.id.ToString(); DDLCategoria.Items.Add(elementoCategoria); } }