C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Message Box


Posted Date: 04 Nov 2009      Posted By: kavithathiayagarajan      Member Level: Silver     Points: 1   Responses: 2



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);





Responses

Author: Rajapandian    04 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,

Instead of innerText, Use innerHTML in your code.



Author: lakshya    04 Nov 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

hi try firebug... this will tell you what the error is

Happy dotneting Spread Smiles :-)
Visit Lakshya



Post Reply
You must Sign In to post a response.
Next : Please check this stored procedure
Previous : File Splitting in
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use