Hi,
I am using Message box in web application. For MessageBox, separate class is used. It is working fine in IE but in Firefox it’s not working. How to rectify this?
Below is My Code: using System; using System.Web; using System.Web.UI.WebControls; using System.Drawing; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Data;
namespace webControlClass { /// <summary> /// Summary description for MsgBox /// </summary> public class clsGenCtrlCode { public static void ShowMsg(System.Web.UI.Page objPage, string Msg) { Label lblShowMsgText = new Label(); Label lblMsg = new Label(); lblShowMsgText.ID = "MsgText"; lblShowMsgText.Style.Add("VISIBILITY", "hidden"); lblShowMsgText.Text = Msg; lblMsg.Style.Add("'VISIBILITY", "hidden"); lblMsg.Text = "<Script Language = 'Javascript'>alert(MsgText.innerText);</script>"; //Page.RegisterStartupScript(etType(), "alert", lblMsg.Text.ToString()); objPage.Controls.Add(lblShowMsgText); objPage.Controls.Add(lblMsg);
} public static void ShowMsgDel(System.Web.UI.Page objPage, string Msg) { Label lblShowMsgText = new Label(); Label lblMsg = new Label(); lblShowMsgText.ID = "MsgText"; lblShowMsgText.Style.Add("VISIBILITY", "hidden"); lblShowMsgText.Text = Msg; lblMsg.Style.Add("'VISIBILITY", "hidden"); lblMsg.Text = "<Script Language = 'Javascript'>confirm(MsgText.innerText);</script>"; objPage.Controls.Add(lblShowMsgText); objPage.Controls.Add(lblMsg); } } }
clsGenCtrlCode.ShowMsg(this, ex.Message);
|
| Author: Rajapandian 04 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
Hi,
Instead of innerText, Use innerHTML in your code.
|
| Author: lakshya 04 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
hi try firebug... this will tell you what the error is
Happy dotneting Spread Smiles :-) Visit Lakshya
|