.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick

Posted By:      Posted Date: August 23, 2010    Points: 0   Category :ASP.Net

First post bear with me please:

I have a simple form with a list of linkbuttons, each fires the same onclick event which sets an indicator image.  I have a dummy button with style="display:none" which I have set as the TargetControlID of the modal.

onClick event from the imagebutton, the modal is shown via modal.Show().  The cancel button inside the modalpopup fires an event which turns off the indicator image and hides the modal via modal.Hide(). 

The events fire perfectly, it's very simple!  Although after doing some testing I noticed the modalpopup is not presented after the 6-10th cycle of clicking the open event, then clicking cancel.  The grey background appears but it is behind the main panel and the modal is either presented behind this or is just simply not displaying. 

I spent hours researching various methods, implemented the CancelControlID to see if it was somehow tied to my call of modal.Hide() that fails.

This occurs with an updatepanel only.  The behaviour is much cleaner this way, so I would hope to be able to implement this.  I have basically eliminated everything but these two events!  Please help

View Complete Post

More Related Resource Links

Updatepanel and Multiview and recaptcha and Modalpopup


Hi all

Would some kind guru please advise me on the best way to cover all the angles on the following scenario, in any combination that works:

A navigation system (buttons, links, it doesn't matter)

A multiview with one View using a recaptcha and Modalpopup for response to a submit button within the View

An Updatepanel

I've spent hours and hours and hours searching around for any sort of solution that covers all of those without *some* sort of problem. If I put the menu inside, something won't work. If I put it outside, something else won't work. If I set 'conditional' or 'child-this-or-that' or whatever, *something* comes out to bite me. The recaptcha will vanish, or there are postbacks, or Modalpopup has gone again, or *something*.

I know it sounds vague but it is the basic structure that I can't get my head around. Every time I think 'Of course! This has got to work', something else breaks. This can't go inside that, and vice versa. I've had more triggers than Roy Rogers.

There's got to be a way to set this thing up. It's such a basic structure. A page, with some graphics, with an 'area' with some text in a few containers, with one of the containers having entry fields and a recaptcha, all switched by buttons or links, wthout continual postbacks and va

LinkButton inside UpdatePanel not executing onClick javascript



So, I have a MasterPage, in which I have an ImageButton and an UpdatePanel. Inside the UpdatePanel I have a LinkButton.

<asp:ImageButton ID="imgPdf" runat="server" ImageUrl="~/Images/pdf.png" OnClick="LnkRelease1_Click" ToolTip="Document1.pdf" Width="31px" />

<asp:UpdatePanel ID="UpdatePanel9" runat="server">                                                                                    

<asp:LinkButton ID="LnkRelease1" runat="server" OnClick="LnkRelease1_Click" ToolTip="Document1.pdf" Font-Underline="false">View Pdf</asp:LinkButton>



As you can see, both components are asociated to the same OnClick event, which should open said PDF document in a new window
using javascript (Code Behind of the MasterPage):

protected void LnkRelease1_Click(object sender, EventArgs e)
     try {   if ((((System.Web.UI.WebControls.WebControl)(sender))).ToolTip != "") { string script = @"

Strange ModalPopUp behavior



I use .Net Framework4.0 and Ajax control Toolkit.Binary.NET4.0

When I use a ModalPopupExtender it works fine but sometimes it has a strange behavoir.

It could popup behind the default.aspx page so the default.aspx page stays on front and pnlModalPopUp on the back.

How can I prevent the ModalPopUp from this undesirable behavior?



<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
<AjaxToolkit:ModalPopupExtender ID="mdlPopup" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlModalPopUp" BackgroundCssClass="ModalBackground" CancelControlID="CloseBtn" >
<asp:Button ID="btnShowPopup" runat="server" style="display:none" />
<asp:LinkButton ID="CloseBtn" runat="server" OnCommand="Button_Click" CommandName="Close">
<asp:Panel ID="pnlModalPopUp" runat="server" CssClass="ModalPopup" Style="display:none;">
<img alt="" src="" ID="Ima

onclick: run 1)vb codebehind 2)print without print dialogue box



First-time poster, please bear with me...

I have a aspx page that when the user clicks a button, I need it to run a vb sub on the code-behind page (which after hitting a SQL server, populates controls on the page) and then prints the page without the print confirm dialogue box.

I can get it to work just running the vb sub on the code-behind page and using window.print(), but it still gives them the print confirm dialogue box.

Or, I can get it to print the page without giving them the print confirm dialogue box, but I have to leave out calling the vb sub on the code-behind page.

It's getting the javascript, vbscript and vb on the code-behind page to all work in the proper sequence that I cannot accomplish.  With the posted code, the printed page is blank except for "Page 1 of 1" in the header and web page path and date in the footer.

Why do I want it to print without the print dialogue box? My next step will be to add a second print button that loops through the entire process a predetermined amount of time (for example, it may print 5 pages, each with different data from the vb sub).

Here is my source code:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="FormID1.aspx.vb" In

Custom Editing Behavior for DataGridView TextBox Columns

For various reasons I'm using a DataGridView instead of a ListView, and while configuring the DataGridView to look like a ListView wasn't much of a problem, there's one thing that got on my nerves, which is the behavior of textbox cells in edit mode: It is much too easy to leave the edit mode accidentally, simply by pressing the cursor keys at the wrong time. For example when the text caret is positioned behind the last character of the textbox cell content, and you press the right arrow key

UpdatePanel is not a known element - message when upgrading to 1.0 ajax


It worked on one of my old pages.  I change the web.config, renamed all the <asp.

On some aspx page it doesn't recognize the updatepanel.  It only does on one page.  If I create a new aspx page with a different name - then it works.

Should I just create a new web project ajax - then copy all my code into there?  Or is there a way to get those old pages to recognize the new ajax controls?

Gridview inside updatepanel


I am displaying large amount of data in gridview,the gridview placed within updatepanel,every 1sec i am refreshing updatepanel using ajax timer.my problem is while displaying large data the cpu performance is low,pls give idea to increase cpu performance..

Open ModalPopup dialog on page load


Is there a way to make a modal popup panel active on page load so that the user can't do anything until they deal with the popup dialog?

Run Button Behavior: Suggestion/Bug


Note: This could be a bug or considered as suggestion. I am not looking for solution.

1: I have ImageWatermark.cshtml open and currently in focus.

2: I have Photo1.jpg selected in left Files workspace.

3: Now if I Click "Run", instead of opening ImageWatermark.cshtml it trys to open Photo1.jpg and it fails.

So ideally I would expect the "open file (ImageWatermark.cshtml) to run rather than running the selection from Workspace.

Word Automation - Multiple DCOM Errors/Behavior

Before I get started, I already know that Microsoft does not support and highly discourages server-based MS Office automation.  I've read a multitude of posts and smarmy "*wink*, here's a link" replies, so I'm looking for actual help here, not condescending reprimands.

That notwithstanding, here is my problem.  I have developed a simple method that will open a local Word document, modify some header information, and then save the document as a new file.  As expected, it works great as a console/windows app, but as soon as I went to ASP.NET, DCOM jacked my world up when accessing the app remotely from a different domain account (that has access to the ASP.NET app.  For reference, my method is shown below:


1    public static string ModifyAndSaveBuildDocument(string localFilePath, BuildDocumentType docType, string buildNumber, DateTime buildDate, string projectName)
2            {
3                try
4                {
5                    ProjectConfiguration config = (ProjectConfiguration)ConfigurationManager.GetSection("ProjectConfiguration");

Wicked Code: UpdatePanel Tips and Tricks


Jeff Prosise explains when it's better to use UpdatePanel and when it's better to use asynchronous calls to WebMethods or page methods instead.

Jeff Prosise

MSDN Magazine June 2007

Extreme ASP.NET: Codebehind and Compilation in ASP.NET 2.0


As I write this column, the release candidates of the Microsoft® .NET Framework 2.0 and Visual Studio® 2005 have just come out, and by the time you read this, they will both already be on the shelves. It feels like it's been a long time coming.

Fritz Onion

MSDN Magazine January 2006

How do you insert a google map into an ajax updatepanel?


I have built a site that I am using google maps on.  The default page has a google map with info windows containing links and all works great... until a user clicks on the link in the info window.  Doing so takes them to a community page that I have built.  On this community page, I have an ajax update panel that has 2 panels nested inside of it with the visibility set for one to be on and the other off.  The default panel shows community photos, and the second panel I want to show the google map and common directions to the community.  In testing, my buttons to switch the visibility of the panels works great as it should without postback, but when I try to add the map to its panel, it does not show up.  I am new to ajax as well as google maps and I'm not sure why the same code would work fine on my default page but not the community page.  The only obvious thing I can assume is because the community page map is in an update panel.  

How do you insert a google map into and ajax updatepanel and have it work correctly?  Many thanks in advance. 

UpdateProgress with a dummy updatepanel not working


I have a Submit button and some functionality like updating DB and fetching next page in the button click event. This process takes a long time and I want to display a message saying "Progress...." right after clicking the botton. I want to do the same in 20 other pages. So, best way to do it wd be to put the modalpopup MPE or an Updateprogress in a usercontrol or in master page. I first tried putting both of these on the page itself to test and see and neither worked.

I tried using Update progress control with a dummy updatepanel and giving the Submit button as Asyntrigger to the dummy updatepanel. I have also tried using MPE but it didnt work either. Below is an example of what i did..

<asp:UpdatePanel ID="UpdatePanel1" runat=server><contenttemplate><triggers><asyntrigger ID= "Submit"> /> /> />

<asp:updateprogress ID="Progress1" unat=server AssociatedUpdatePanelID="UpdatePanel1"><Progresstemplate>Progress.... />/>

<asp:button ID= "Submit" runat=server >

I have nothing for updateprogress in code behind. Am i missing or doing somethign wrong here? Any help would be appreciated.

onclick and onclientclick


Hei I have the following line in asp.net

<asp:LinkButton runat="server" ID="createuser" OnClientClick="javascript:$('#dialogform').dialog('open');" onclick="AddCaseInfo_Click">Create Case</asp:LinkButton>

Onclientclik works fine, but not onclick :(  Any help please?

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend