.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

show asp.net modal popup on page load event?

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :ASP.Net
 hi,   I have placed an asp.net modal popup extender on my page. it works fine when a button is target controlId but I want to show it when user enters page. so I put the below in the page load event but nothing happens (ie6) pnlModal_ModalPopupExtender.Show(); Is this the right way?   thanks  

View Complete Post

More Related Resource Links

show / hide jquery modal dialog box on page load



i have a jquery modal dialog box which displays on page load of my asp.net web app - i am using asp.net aspx pages and c#

how can i hide this pop up if a value for example is false and display it if a value is true?

the following is my jquery code:

$(function() {


modal: 'true',

title: 'title'



any advise would be much appreciated as i am new to jquery and its quite a learning curve

many thanks


'calendarShown' is undefined - Got it to show up in modal popup (on one page)

I managed to find the way to get the calender to show in a modal popup by searching the forum.  However, I now have a problem in which the calendarShown function throws an error.  


The strange thing is that it works fine on one page of my website - no error and the calendar shows up but on the other it throws the 'calendarShown' is undefined on page load.  Then the calendar doesn't show up.  I've gone as far as copying the exact function from the working page and pasting it in to the non-working page.  Still get the same error!!!


<asp:TextBox ID="txtEffDate" Width="100px" MaxLength="10" runat="server" onkeyup="enableAddSave();" ></asp:TextBox>
								<cc2:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtEffDate" OnClientShown="calendarShown"></cc2:CalendarExtender>


 function calendarShown(sender, args)
  	sender._popupBehavior._element.style.zIndex = 10005;

Anyone run in to this problem??


Open different page using Ajax Modal PopUp Extender Control

The article Open different page using Ajax Modal PopUp Extender Control was added by Chintan Dave on Thursday, July 15, 2010.

You May use Modal Popup Extender to open some part of the page as Popup. But there we don't have any property to open other html or aspx page in Popup window.We can do it using IFrame control. What we have to do, just add IFrame control in Panel that

want to launch modal Popup from created User Event handler




I have a create user wizard on my page and in the event handler (Created User) I get extra information from the user

via textboxes within the aspx etc.


I then do a response.redirect to another page.

What I want to happen is this


When the CreatedUser Event is fired, I  want a Modal Popup to show up with a message Processing your registration.

once the registration code is processed it will close and the users get redirected.


On my ASPX I have the Modal PopUp and a Panel.

In the code behind in the handler I put ModalPop.show()


but this does not work.


thanks for any suggestions



How to avoid viewstate in page load event??

Hello Everyone, Here Is my scenario,I haveMaster Page -> ASPX page -> User ControlUser control page is contains all dynamic bind controls (e.g Repeater) depended on ASPX Page (Only one parameter say ItemNo) The problem is, if I bound user control on page load event with passing respective parameters then it's create to much view state (I checked source file and it's almost 1.5 MB) In other way if I put one textbox, and a command button and I pass required parameter on button click and load the control then page size is ok (I checked and it's  < 500KB) So is it any way I can reduce my page/state size??

Modal popup with button click event won't work

Hi all,I try to create a asp.net 4 webpage, using masterpage.On webpage I have a formview and inside the formview I have a ajax modalpopup. I have multiple buttons and textboxes on the modalpopup, and created a test event, but I still get the message that the textbox is not declared.Here is how the code is set at this point:<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> <style type="text/css"> .ModalPopupBG { background-color: #666699; filter: alpha(opacity=50); opacity: 0.7; } .popup_Container { background-color:#fffeb2; border:2px solid #000000; padding: 0px 0px 0px 0px; } .HellowWorldPopup { min-width:200px; min-height:150px; background:white; } .popup_Titlebar { background: url(../Styles/titlebar_bg.jpg); height: 29px; } .popup_Body { padding:15px 15px 15px 15px; font-family:Arial; font-weight:bold; font-size:12px; color:#000000; line-height:15pt; clear:both; padding:20px; } .TitlebarLeft { float:left; padding-left:5px; padding-top:5px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; font-size:12px; color:#FFFFFF; } .TitlebarRight { background:url(../Styles/cross_icon_normal.png); background-position:right; background-repeat:no-repeat; height:15px; width:16px; float:right; cursor:pointer; margin-right:5px; margin-top:5px;

Modal Popup Extender server side Show() does not work


Hello. Im using a modal popup extender to tell my user that the page has successfully been updated and then redirect them to a new page with the ok button. The thing is that i do NOT want this extender to fire when i press the button. I would rather call the Show() function myself. Right now i have a simple test page with a button that calls the popup extender Show() function but Nothing happens. If i set the targetID to the button it works but Im not able to call it through codebehind.

Any thoughts?

<%@ Page Title="" Language="C#" MasterPageFile="Master.master"

HoverMenuExtender is displaying popup panel on page load


I am using VS 2010 with .Net 4.0.

I am using a HoverMenuExtender to display a text but just after the page is loaded, the popup panel is already displayed.

Any help is appreciated.

want to show animated loading gi in modal popup on buttton click??



I am using a  5 file upload controls on my page within a Create User Wizard.

In a modal pop up extender, I have a animated ajax gif with a message


When I submit the button (see code below )to send the form, the modal pop up shows up

but the image is not animated. If I put the button below in an update panel it

works with animation. But if I add a twigger for the button as the file upload controls needs a postbackthe image is static again. Is there anywhere I can display an animated image in the modal pop up and still keep my existing code.??



Web form page load event


I have  Web page that uses LinkButton control inside Template Fields of Gridview.

I am trying to work on LinkButton Click event and trying to preserve the Value of LinkButton that user click, and based on that value, i want to refresh tha page data.

I used CommandName and CommandArgument property of Linkbutton, but i can use that property only in GridView_RowCommand method by checking e.CommandName expression. But the problem with that Gridview_RowCommand event fire after all other page_load activity. So the value never used in the page_load event to refresh the data in all other control.

I also tried to use OnClick Method, Session variable and Hidden variable. but when i run Response.Redirect method from Gridview_RowCommand, it clear all the Session and Hidden variable values. also tried (Response.Redirect(,false)) method but never got success.

Any suggestion will be appricated in advance.

createchildcontrols is not fired on page load event


hello frnds

i have develop a custom control as shown below

public class MyControl : System.Web.UI.WebControls.WebControl, INamingContainer


private TextBox txtData ;

protected override void CreateChildControls()
txtData = new TextBox();
txtData.ID = "txtName";



Now, i have placed this control on web page. i also have other asp.net controls like combobox, checkbox etc on this same web page as displayed below. 

<%@ Page Title="" Language="C#" MasterPageFile="~/MyMaster.master" AutoEventWireup="true" CodeFile="Customer.aspx.cs" Inherits="Customer" EnableViewState="true" %>

<asp:Content ID="Content2" ContentPlaceHolderID="PageContent" runat="Server">
    <table cellpadding="0" cellspacing="0" width="100%">
           <td><asp:MyControl ID="CmbMyControl" runat="Server" /></td>

Now in page load ev

Make modal popup scroll with page


I've got a modal popup and when it loads contents that are taller than the browser height I am unable to scroll down to view the rest of the information. Instead the background can scroll but the popup won't, I'd like to have the popup stay in place so the users can see the bottom of the modal.

displaying 2 alternating db records with each new page load event


I have a webpage which displays content drawn from a single record in a database table. I've been asked to change this so that the content displayed alternates between 2 records each time the page is requested by a browser (I guess this would equate to each PageLoad event).

The records to be displayed are chosen on the basis of two dates, a beginning date and and ending date, that define a time period in which the record is to be active. The table containing these records has 2 columns containing these dates (begin date is contained in "dtDisplay" and end date is "lastDisplay."

I'm not sure how to amend the existing code behind to make this happen. Here is the c# that I inherited from a developer who is no longer available. Thanks for any help:

private void getfeatured_properties()
           string today = DateTime.Now.Date.ToString();

           SqlCommand cmd = common.openDatabase();
           if (cmd.Connection.State == ConnectionState.Open)
                 string sql = "select propID from featured_properties where " +
                    "dtDisplay <= '" + today + "' and " +
                    "lastDisplay >= '" + today + "'";

how to call dropdown SelectedIndexChanged event in page load event in c#


Hi everyone,

in my web form i have a department dropdown box, in its selectedIndexChanged event i have to fill the equipment dropdown box and in equiment dropdown selectedIndexChanged i have to fill out the other textboxs.

the depratment dropdown box get its value from sqldatasource.

 <asp:DropDownList ID="dp_deptname" runat="server" DataSourceID="SqlDataSource1" DataTe

Checking Some Values In A CheckBoxList In The Page Load Event.


Hello forum,

I have a checkboxlist (cblTeamMates) with a sqldatasource (sqlTeamMates) that has 3 columns (ID, FullName and Status ).  The datavaluefield and datatextfield for cblTeamMates is "FullName" and the 2 status values possible are "Available" and "Absent".  How do I go about, in the page load event,  checking all  the names (FullName) whose Status is "Available"?

Thank you.

disable button in page load click event using javascript



i have button its  enable false in aspx page, if i click the page load  click event  then button should enable

looking forward the reply.

Need a SharePoint popup on page load

I need to launch a notice and consent banner when a visitor lands on my site. I have lytebox loaded at the root of my SharePoint Site and I can launch the popup via link on the web page. Problem is I need it to popup automatically during page load. Can this be done is SP? The anchor tag of the link to launch the banner looks like this:
A title="Notice and Consent" href="/popup/Notice.aspx" rev="width: 600px; height: 500px; scrolling: no;" rel=lyteframe>Notice and Consent /A

 I need to basically launch this href on page load but do not know how to do it in SharePoint. If anyont has a solution for this scenario or an alternative I would greatly appreciate it.


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