Click here to Skip to main content
15,886,919 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionMultiple Image Upload like in orkut ... Pin
priyareguri29-Apr-10 1:27
priyareguri29-Apr-10 1:27 
AnswerRe: Multiple Image Upload like in orkut ... Pin
Brij29-Apr-10 1:40
mentorBrij29-Apr-10 1:40 
GeneralRe: Multiple Image Upload like in orkut ... Pin
priyareguri29-Apr-10 1:55
priyareguri29-Apr-10 1:55 
AnswerRe: Multiple Image Upload like in orkut ... Pin
Abhijit Jana29-Apr-10 1:54
professionalAbhijit Jana29-Apr-10 1:54 
QuestionGenerating code behind file after converting an ASP application to ASP.NET Pin
Rijz29-Apr-10 0:29
Rijz29-Apr-10 0:29 
Questionasp login Pin
netDeveloper29-Apr-10 0:10
netDeveloper29-Apr-10 0:10 
AnswerRe: asp login Pin
Brij29-Apr-10 0:27
mentorBrij29-Apr-10 0:27 
Questionmessagebox does not appear when asp:updatepanel and updateprogress control is used Pin
sanjubaba28-Apr-10 23:49
sanjubaba28-Apr-10 23:49 
hi,
i am displaying a messagebox server side. For that i have developed a class which is called from an aspx page which inherits masterpage. the master page includes asp:updatepanel control and updateprogress control. due to this i cant use httpconetxt.current.response.write to display the message box.

Following is the aspx code:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Presentation_Admin_Menu_MenuGroup_MenuGroupDetail : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
MsgPopUp.Show(Page, "sandeep with me");
}
}



THIS IS THE CLASS CODE FOR DISPLAYING THE MESSAGEBOX
====================================================
public static void Show_Panel(Page sender, string Message)
{
try
{
UpdatePanel sender1 = (UpdatePanel)sender.Master.FindControl("UpdPanel");
ScriptManager.RegisterStartupScript(sender1, typeof(UpdatePanel), "ABC", "alert('"+Message+"');", true);

//if (!(handlerPages.Contains(HttpContext.Current.Handler)))
//{
// Page currentPage = (Page)HttpContext.Current.Handler;

// if (!((currentPage == null)))
// {
// Queue messageQueue = new Queue();
// messageQueue.Enqueue(Message);

// handlerPages.Add(HttpContext.Current.Handler, messageQueue);
// currentPage.Unload += new EventHandler(CurrentPageUnload_withupdpanel);
// }
//}
//else
//{
// Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler]));
// queue.Enqueue(Message);
//}
}
catch (Exception ex)
{
throw ex;
}
}

private static void CurrentPageUnload_withupdpanel(object sender, EventArgs e)
{
try
{
Queue queue = ((Queue)(handlerPages[HttpContext.Current.Handler]));

if (queue != null)
{

StringBuilder builder = new StringBuilder();

int iMsgCount = queue.Count;

builder.Append("<script language='javascript'>");

string sMsg;

while ((iMsgCount > 0))
{

iMsgCount = iMsgCount - 1;

sMsg = System.Convert.ToString(queue.Dequeue());

sMsg = sMsg.Replace("\"", "'");

builder.Append("alert( \"" + sMsg + "\" );");

}

builder.Append("</script>");

handlerPages.Remove(HttpContext.Current.Handler);

//HttpContext.Current.Response.Write(builder.ToString());

Page currentPage = (Page)sender;

UpdatePanel sender1 = (UpdatePanel)currentPage.Master.FindControl("UpdPanel");
ScriptManager.RegisterStartupScript(sender1, typeof(UpdatePanel), "ABC", "alert('Hi, I did it!');", true);

//currentPage.RegisterStartupScript("alert", builder.ToString());
//if (!script.IsClientScriptBlockRegistered(script.GetType(), "Alert"))
//{
// script.RegisterClientScriptBlock(script.GetType(), "Alert", "alert('record inserted');", false);
//}
}
}
catch (Exception ex)
{
throw ex;
}
}


Instead of httpcontext.response.write i use
UpdatePanel sender1 = (UpdatePanel)currentPage.Master.FindControl("UpdPanel");
ScriptManager.RegisterStartupScript(sender1, typeof(UpdatePanel), "ABC", "alert('Hi, I did it!');", true);
in the above class code. But the message box doest not get displayed.

Thanks.

Sandeep Kumbhar
AnswerRe: messagebox does not appear when asp:updatepanel and updateprogress control is used Pin
Jamil Hallal28-Apr-10 23:55
professionalJamil Hallal28-Apr-10 23:55 
GeneralRe: messagebox does not appear when asp:updatepanel and updateprogress control is used Pin
sanjubaba29-Apr-10 21:06
sanjubaba29-Apr-10 21:06 
AnswerRe: messagebox does not appear when asp:updatepanel and updateprogress control is used Pin
Jamil Hallal28-Apr-10 23:57
professionalJamil Hallal28-Apr-10 23:57 
QuestionReciving Mail Pin
AtiqueJnp28-Apr-10 23:39
AtiqueJnp28-Apr-10 23:39 
AnswerRe: Reciving Mail Pin
Michel Godfroid29-Apr-10 1:32
Michel Godfroid29-Apr-10 1:32 
QuestionJava script & IE 7 Pin
Enobong Adahada28-Apr-10 22:49
Enobong Adahada28-Apr-10 22:49 
AnswerRe: Java script & IE 7 Pin
Jamil Hallal28-Apr-10 22:55
professionalJamil Hallal28-Apr-10 22:55 
AnswerRe: Java script & IE 7 Pin
Arindam Tewary28-Apr-10 23:04
professionalArindam Tewary28-Apr-10 23:04 
GeneralRe: Java script & IE 7 Pin
Jamil Hallal28-Apr-10 23:10
professionalJamil Hallal28-Apr-10 23:10 
GeneralRe: Java script & IE 7 Pin
Arindam Tewary29-Apr-10 0:01
professionalArindam Tewary29-Apr-10 0:01 
GeneralRe: Java script & IE 7 Pin
Jamil Hallal29-Apr-10 0:05
professionalJamil Hallal29-Apr-10 0:05 
GeneralRe: Java script & IE 7 Pin
Brij29-Apr-10 0:41
mentorBrij29-Apr-10 0:41 
GeneralRe: Java script & IE 7 Pin
Arindam Tewary29-Apr-10 0:53
professionalArindam Tewary29-Apr-10 0:53 
GeneralRe: Java script & IE 7 Pin
Brij29-Apr-10 1:31
mentorBrij29-Apr-10 1:31 
AnswerRe: Java script & IE 7 Pin
Enobong Adahada29-Apr-10 2:28
Enobong Adahada29-Apr-10 2:28 
GeneralRe: Java script & IE 7 Pin
Jamil Hallal29-Apr-10 2:55
professionalJamil Hallal29-Apr-10 2:55 
GeneralRe: Java script & IE 7 Pin
Jamil Hallal29-Apr-10 2:58
professionalJamil Hallal29-Apr-10 2:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.