[Resolvido] Mudar tamanho de DIV da Master em outra pagina
Bom dia iMasters!
Tenho uma div em minha master.page com um determinado tamanho e uma imagem de fundo, definidos em um CSS.
preciso alterar o tamanho dela e a imagem de fundo em uma outra pagina... contato por exemplo.
o codigo:
Master.cs
public void Muda_Banner(string tamanho)
{
div_master_ban.Attributes.CssStyle.Add("height", tamanho);
}
Contato.cs
MasterPage mp = new MasterPage();
mp.Muda_Banner("100px");
se eu utilizar a função na propria master, funciona, mas quando passo para a pag contato, da o seguinte erro.
** Object reference not set to an instance of an object. **
Description: Anunhandled exception occurred during the execution of the current webrequest. Please review the stack trace for more information about theerror and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
Line 56: public void Muda_Banner(string tamanho)
Line 57: {
Line 58: div_master_ban.Attributes.CssStyle.Add("height", tamanho);
Line 59: }
Line 60:
no aguardo, Abraços!!
Discussão (2)
Carregando comentários...