Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ModalPopup Message Box

Posted on 2009-05-19
6
Medium Priority
?
335 Views
Last Modified: 2012-05-07
I have a datagrid that allows the user to update its contents, however, it does not update the database, instead, it emails a supervisor that changes need to be made and what those changes are.  This is fine.  However, I would like to have a modal box pop-up that tells the user the supervisor has been notified.   have this almost working by putting Show() in the onUpdating event but it acts wierd.

First I don't know what to attach the extender to.  If I attach it to the datagrid, the pop-up comes up when the user hits edit instead of when they hit update.  Obviously not desireable.  

Second, the panel that is in the popup is momentarily visible when the page loads, also not a desireable effect.

Currently I have the extender attached to a button but I don't want this button on the page.

Can I get some advice here?

Thanks!
0
Comment
Question by:jglazer63
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 7

Accepted Solution

by:
kGenius earned 2000 total points
ID: 24425500
For hiding the panel when page loads; add a CSS-class to the panel.
In your css give the class display:none;

For the first problem; you can create a buttonfield visible in editmode.
Add CommandName="ShowModal" to the button and OnRowCommand="GridView1_RowCommand".
Then in your code-behind add:

public void GridView1_RowCommand(Object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "ShowModal")
{
  youModal.Show();
}

Then you also call your update/e-mail function

HTH,
jaan
0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24425647
you can also use hidden button (style display:none) as a control for TargetControlID if you don't want any additional (visible) controls on your page.
0
 

Author Comment

by:jglazer63
ID: 24425757
I have a better queston.  What is the best way to develop some procedure to have a standard pop-up modal message box.  This kind of thing would be used throughout the site.  Assume I have no controls in particular on the form but some sort of event could fire the need for the box.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Expert Comment

by:tetorvik
ID: 24425970
Don't know about the best way, but we've implemented an alert user control that wraps the ModalPopup control and all the other necessary controls. Then on a BasePage that all the pages in our application derives from we have methods to dynamically load the alert control on the page.
This approach has been working greatly in our scenarions.
0
 

Author Comment

by:jglazer63
ID: 24426068
Can you expand on this a bit?   Perhaps some code?
0
 
LVL 9

Expert Comment

by:tetorvik
ID: 24428768
First of all I need to say this is getting little of topic from the original question in which kGenius answered very well (IMO an accepted solution). I think if the question focus is changing in a thread, it would be fare to reward the correct answers so far and the then start a new question.

Unfortunately I cannot provide the exact code as it is not really my property, but I can say there is no magic in this.
Simply putting the mark-up you have for ModalPopup into User Control and expose some methods to control ModalPopupExtender visibility and some properties for message text and message severity. I encourage to create an interface for this (see INotificationControl used below), so when you're are using the control you can do that throught the interface.  Then you can load to control dynamically on your page with the snippet below:



                INotificationControl notifier = LoadControl(@"~\SomePath\NotificationControl.ascx") as INotificationControl;
                ((Control)notifier).ID = Guid.NewGuid().ToString();
                notifier.NotificationText = "Some text";
                notifier.Show();
                this.Form.Controls.Add(notifier as Control);

Open in new window

0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question