By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,083 Members | 1,957 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,083 IT Pros & Developers. It's quick & easy.

asp.net and Firefox

P: n/a
Hi. Recently I discovered that my asp.net site doesn't render ok in Firefox,
so I added some browser caps into my web.config file as adviced in some
articles, but nothing happened. Please need some advice on that.
Thanks,
Alejandro
Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
to be more specific overflow:auto property of <div> doesn' work, as well as
some <td> and <tr> widths and heights.
"Alejandro Penate-Diaz" <al*******@apenate.com> wrote in message
news:Op****************@TK2MSFTNGP11.phx.gbl...
Hi. Recently I discovered that my asp.net site doesn't render ok in
Firefox, so I added some browser caps into my web.config file as adviced
in some articles, but nothing happened. Please need some advice on that.
Thanks,
Alejandro

Nov 19 '05 #2

P: n/a
I also had trouble with the TextBox widths in Firefox, Netscape, and Safari
browsers. I worked around it by deriving a class from TextBox and overriding
the Render method. You could probably do the same to solve your issue with
the controls. Here's the code I used for my fixed textbox:

public class FixedTextBox : System.Web.UI.WebControls.TextBox
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
#region Add Cross Browser Size To Attributes Collection
#region Width
if(this.Width != System.Web.UI.WebControls.Unit.Empty)
{
string WidthString = this.Width.Value.ToString();
#region Append UnitType Symbol
switch(this.Width.Type)
{
case System.Web.UI.WebControls.UnitType.Percentage:
WidthString += "%";
break;

case System.Web.UI.WebControls.UnitType.Pixel:
WidthString += "px";
break;
}
#endregion Append UnitType Symbol
if(this.TextMode == System.Web.UI.WebControls.TextBoxMode.MultiLine)
{
this.Attributes.Add("width", WidthString);
this.Attributes.Add("style", "width:" + WidthString); // Firefox
}
else
{
//this.Attributes.Add("width", WidthString);
this.Attributes.Add("style", "width:" + WidthString); // Firefox
}
}
#endregion Width
#region Height
if(this.Height != System.Web.UI.WebControls.Unit.Empty)
{
string HeightString = this.Height.Value.ToString();
#region Append UnitType Symbol
switch(this.Height.Type)
{
case System.Web.UI.WebControls.UnitType.Percentage:
HeightString += "%";
break;

case System.Web.UI.WebControls.UnitType.Pixel:
HeightString += "px";
break;
}
#endregion Append UnitType Symbol
this.Attributes.Add("height", HeightString);
}
#endregion Height
#endregion Add Cross Browser Size To Attributes Collection
base.Render (writer);
}

}

"Alejandro Penate-Diaz" wrote:
to be more specific overflow:auto property of <div> doesn' work, as well as
some <td> and <tr> widths and heights.
"Alejandro Penate-Diaz" <al*******@apenate.com> wrote in message
news:Op****************@TK2MSFTNGP11.phx.gbl...
Hi. Recently I discovered that my asp.net site doesn't render ok in
Firefox, so I added some browser caps into my web.config file as adviced
in some articles, but nothing happened. Please need some advice on that.
Thanks,
Alejandro


Nov 19 '05 #3

P: n/a
thanks a lot. I'll try that to fix widths and heights. still <div>
attributes don't work and it is static html so I don't know how to fix that.
but I think your solution can fix 50% of my problems.
tnx,
Alejandro.

"Solel Software" <So***********@newsgroup.nospam> wrote in message
news:FB**********************************@microsof t.com...
I also had trouble with the TextBox widths in Firefox, Netscape, and Safari
browsers. I worked around it by deriving a class from TextBox and
overriding
the Render method. You could probably do the same to solve your issue
with
the controls. Here's the code I used for my fixed textbox:

public class FixedTextBox : System.Web.UI.WebControls.TextBox
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
#region Add Cross Browser Size To Attributes Collection
#region Width
if(this.Width != System.Web.UI.WebControls.Unit.Empty)
{
string WidthString = this.Width.Value.ToString();
#region Append UnitType Symbol
switch(this.Width.Type)
{
case System.Web.UI.WebControls.UnitType.Percentage:
WidthString += "%";
break;

case System.Web.UI.WebControls.UnitType.Pixel:
WidthString += "px";
break;
}
#endregion Append UnitType Symbol
if(this.TextMode == System.Web.UI.WebControls.TextBoxMode.MultiLine)
{
this.Attributes.Add("width", WidthString);
this.Attributes.Add("style", "width:" + WidthString); // Firefox
}
else
{
//this.Attributes.Add("width", WidthString);
this.Attributes.Add("style", "width:" + WidthString); // Firefox
}
}
#endregion Width
#region Height
if(this.Height != System.Web.UI.WebControls.Unit.Empty)
{
string HeightString = this.Height.Value.ToString();
#region Append UnitType Symbol
switch(this.Height.Type)
{
case System.Web.UI.WebControls.UnitType.Percentage:
HeightString += "%";
break;

case System.Web.UI.WebControls.UnitType.Pixel:
HeightString += "px";
break;
}
#endregion Append UnitType Symbol
this.Attributes.Add("height", HeightString);
}
#endregion Height
#endregion Add Cross Browser Size To Attributes Collection
base.Render (writer);
}

}

"Alejandro Penate-Diaz" wrote:
to be more specific overflow:auto property of <div> doesn' work, as well
as
some <td> and <tr> widths and heights.
"Alejandro Penate-Diaz" <al*******@apenate.com> wrote in message
news:Op****************@TK2MSFTNGP11.phx.gbl...
> Hi. Recently I discovered that my asp.net site doesn't render ok in
> Firefox, so I added some browser caps into my web.config file as
> adviced
> in some articles, but nothing happened. Please need some advice on
> that.
> Thanks,
> Alejandro
>


Nov 19 '05 #4

P: n/a
Your welcome. Since you have to add a "runat=server" tag to div's to access
them in asp.net anyways, this should work with those too (just derive from
the HtmlGenericControl).

"Alejandro Penate-Diaz" wrote:
thanks a lot. I'll try that to fix widths and heights. still <div>
attributes don't work and it is static html so I don't know how to fix that.
but I think your solution can fix 50% of my problems.
tnx,
Alejandro.

"Solel Software" <So***********@newsgroup.nospam> wrote in message
news:FB**********************************@microsof t.com...
I also had trouble with the TextBox widths in Firefox, Netscape, and Safari
browsers. I worked around it by deriving a class from TextBox and
overriding
the Render method. You could probably do the same to solve your issue
with
the controls. Here's the code I used for my fixed textbox:

public class FixedTextBox : System.Web.UI.WebControls.TextBox
{
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
#region Add Cross Browser Size To Attributes Collection
#region Width
if(this.Width != System.Web.UI.WebControls.Unit.Empty)
{
string WidthString = this.Width.Value.ToString();
#region Append UnitType Symbol
switch(this.Width.Type)
{
case System.Web.UI.WebControls.UnitType.Percentage:
WidthString += "%";
break;

case System.Web.UI.WebControls.UnitType.Pixel:
WidthString += "px";
break;
}
#endregion Append UnitType Symbol
if(this.TextMode == System.Web.UI.WebControls.TextBoxMode.MultiLine)
{
this.Attributes.Add("width", WidthString);
this.Attributes.Add("style", "width:" + WidthString); // Firefox
}
else
{
//this.Attributes.Add("width", WidthString);
this.Attributes.Add("style", "width:" + WidthString); // Firefox
}
}
#endregion Width
#region Height
if(this.Height != System.Web.UI.WebControls.Unit.Empty)
{
string HeightString = this.Height.Value.ToString();
#region Append UnitType Symbol
switch(this.Height.Type)
{
case System.Web.UI.WebControls.UnitType.Percentage:
HeightString += "%";
break;

case System.Web.UI.WebControls.UnitType.Pixel:
HeightString += "px";
break;
}
#endregion Append UnitType Symbol
this.Attributes.Add("height", HeightString);
}
#endregion Height
#endregion Add Cross Browser Size To Attributes Collection
base.Render (writer);
}

}

"Alejandro Penate-Diaz" wrote:
to be more specific overflow:auto property of <div> doesn' work, as well
as
some <td> and <tr> widths and heights.
"Alejandro Penate-Diaz" <al*******@apenate.com> wrote in message
news:Op****************@TK2MSFTNGP11.phx.gbl...
> Hi. Recently I discovered that my asp.net site doesn't render ok in
> Firefox, so I added some browser caps into my web.config file as
> adviced
> in some articles, but nothing happened. Please need some advice on
> that.
> Thanks,
> Alejandro
>


Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.