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

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

ModalPopup BackgroundCssClass is not transparent!!!

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net

I am using the ModalPopup and I assign the BackgroundCssClass to the following style:


 The problem is that the whole background goes a solid Gray and completely covers the content of the parent page.  How do I make the colour transparent so it just grays out the background allowing the content to still be visible like it does on the example on the ajax toolkit web site???


View Complete Post

More Related Resource Links

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?

Upload transparent PNG image


Hi everybody

I'm creating a website where it must  be able to upload, crop and resize images. This works until I use transparent PNG images. When I upload a transparent PNG, the transparency becomes black. I've searched the whole internet, but found no solution so far. Can someone help me? This is my code. I'm working with MVC 2.

			try {
				HttpPostedFileBase file = Request.Files["image"];
				file.SaveAs(Server.MapPath("/Uploads/" + file.FileName));

				ViewData["ImageLocation"] = "/Uploads/" + file.FileName;
				return View();
			catch (Exception exc) {
				return RedirectToAction("UploadImage");

ModalPopup/UpdatePanel from codebehind, inconsistent behavior onClick


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

setting label using modalpopup selected value


Hi all:

I have a modalpopup control which has  a gridview and search criteria. User selects a records and clicks modalpopup ok button ( which is set as modalpopup's okbutton). I have attached an event to okbutton click event. and inside this event, I am setting a label control which in on main page which called this modalpopup. I debugged code, it comes inside that event but doesnt set value. below is my event code.

protected void btnOkCustomers_Click(object sender, EventArgs e)


Int32 CustomerID = Convert.ToInt32(GridView2.SelectedDataKey.Value);

orders = new Orders();

DataSet CustomersDs = orders.GetCustomerById(CustomerID);

lblCustomerName.Text = "sadasdad"; // CustomersDs.Tables[0].Rows[0]["first_name"].ToString();




Please suggest me solution to this.

Asif Hameed

Converting PNG to Transparent PNG


Hi there,

I have a bunch of PNG images and i want the background for each one to be transparent. At the moment they all have white background and i want to remove that. Can this be done programatically possibly with the help of some imaging component.

Thanks in advance.


Displaying transparent text using TextOut

Hi, I'm currently working on a C# project that displays transparent windows (like splashscreens) using Windows Forms. I've been using a class that allows me to call GDI Win32 functions such as UpdateLayeredWindow(), GetDC(), TextOut()... I can show a transparent PNG, it's ok but when I want to add a transparent text with TextOut it works but doesn't follow the form. In the TextOut function, I've tried to specify the HDC of the current form using e.Graphics.GetHdc() without success... Is there a way I can draw my transparent text so it follows the transparent form ? Here is my code, written within the Form_Paint method (private void Form1_Paint(object sender, PaintEventArgs e)). The HDC for the TextOut method used here is null so it draw within the screen DC. IntPtr Hdc = API.GetDC(IntPtr.Zero); IntPtr memDc = API.CreateCompatibleDC(Hdc); IntPtr hBitmap = IntPtr.Zero; IntPtr oldBitmap = IntPtr.Zero; try { //Display-image Bitmap bmp = new Bitmap(backgroundImage); hBitmap = bmp.GetHbitmap(Color.FromArgb(0)); //Set the fact that background is transparent oldBitmap = API.SelectObject(memDc, hBitmap); //Display-rectangle Size size = bmp.Size; Point pointSource = new Point(0, 0); Point topPos = new Point(this.Left, this.Top); e.Graphics.GetHdc() //Set up blending options API.BLENDFUNCTION blend = new API.BLENDFUNCTION(); blend.BlendOp = API.AC_SRC_O

Transparent child forms

Hi, I'm developing a Windows Forms application that uses an MDI and child forms. The MDI has an image for the background. I am trying to make the child form background be transparent so the MDI image shows through. I have trawled the internet, and from my understanding this is not possible. However, it seems to be possible in unmanaged code using API’s. Are there any examples of how to do this and what API I should use?   Many thanks in advance.   Andy (MCTS)

How can i make a WPF transparent group box control that is in the toolbox?

How can i make a WPF transparent Groupbox control that will show a picturebox image behind it? Thanks -civilwarrock

Transparent image

Is there any way in which image background can be made transparent? Thanks,Krunal C

modalpopup and javascript error object required

Hi!   I Have this error when click on a button to open a popup box in my page: "object required"   Here is my code:   <%@ Page Language="VB" MasterPageFile="~/artm.master" AutoEventWireup="false" CodeFile="artm_principal.aspx.vb" Inherits="artm_principal" title="Principal" Debug="true" MaintainScrollPositionOnPostback="true"%><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="AJT" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">                                      <AJT:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"></AJT:ToolkitScriptManager>                                        <AJT:ModalPopupExtender ID="ModalPopupExtender1" runat="server"         &

showing modalpopup and saving data to database simultaneously using ajaxtoolkit and javascript

hi,i have a button ,i want that when i click on that button the data should be saved in the database as well as at the same time a modal popup should display the customerid .i have written the code as <asp:button id="save1" runat="server" onclick="Button4_Click" style=""z-index:" mode="hold" xmlns:asp="#unknown" /> left: 740px; position: absolute; top: 304px" Text="save"/> <asp:panel id="panel" runat="server" xmlns:asp="#unknown">  /asp:Panel> <ajaxtoolkit:modalpopupextender id="MPE" runat="server" targetcontrolid="save1" xmlns:ajaxtoolkit="#unknown"> PopupControlID="panel" DropShadow="true" BackgroundCssClass="modalBackground/> protected void Button4_Click(object sender, EventArgs e) { string id = TextBox1.Text; string name = TextBox2.Text; string cn = "Data Source=hcl;Initial Catalog=mydata;Integrated Security=True"; SqlConnection con = new SqlConnection(cn); SqlCommand cmd = new SqlCommand("insert into customer values (@id,@name)", con); con.Open(); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@id", id); cmd.Parameters.Add("@name",name); cmd.ExecuteNonQuery(); con.Close(); CUSTID.Text = id.ToString(); MPE.Show(); }

How do I stop ModalPopup from closing

I have a simple example of a ModalPopup with a panel that appears in the center of the ModalPopup and a couple of buttons in that panel. One of the buttons is a cancel and the other is an OK button. No matter how many other buttons that I add each one closes the ModalPopup. I need to keep the ModalPopup open so that I can run a few calculations then click a close button.  Any help is appreciated.

Asp AJax ModalPopup Problems

HI, I am invoking a modal formview popup for edit and insert on a gridview selection. When the edit button is first clicked, the popup shows up and on subsequent click it gives errors like    Microsoft JScript Error:Sys.InvalidOperationException:Two Components with the same id.    ctl100_ContentPlaceHolder1_ucopsphone11_mdlPopupPhone cannot be added to the application. The ucopsphone11 is a grid user control within which I placed a modal formview. 1. How to make the modal popup work properly. 2. The update/cancel/command should be inside the popup formview or outside of the modal popup. 3. In the modalPopup usercontrol page_load event I was trying to set default mode. But it fires only once because     of (Not PostBack) during the page load. But when modalPopup is shown it is not fired.      I want to the use same modalPopup for edits/insert.   I have been struggling with this for more than a day. I would appreciate if someone help me move forward with this. Thanks Suresh   Grid View Page protected void GridViewAppPhone_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow row = GridViewAppPhone.SelectedRow; int index = GridViewAppPhone.SelectedIndex; strkey1 = GridViewAppPhone.DataKeys[rows.RowIndex["id"].ToString() Session["papp_id"] = strkey

How can I draw a JPG in transparent mode?

Hi! I have 2 JPEGs. The 1st is background and the 2nd should be drawn in transparent mode over the 1st. After that I need to save the combination as a 3rd JPEG. How can I do it with GDI+ and Winforms?

display modalpopup after clicking the linkbutton in grdview with the data based on bound vale

Hi I have gridview with link button as itemtemplate.i want to display the modalpopup after clicking the linkbutton in the gridview.This modalpopup should dispaly some data based on the value associate with the linkbutton.Please helo me. 

Ajax Control Toolkit - ModalPopup displaying behind Flash

HiI have a flash on my page and I need to popup an ajax window, I use ModalPopupExtender. The problem is that ajax popup window always shows behind the flash in Internet explorer and Google Chrome. In firefox there are no such problem.I tried to set wmode="transparent" but id didn't help.Thanks

Transparent WPF window blinks when background is redrawn

Hello everyone. I have a problem with a window which is transparent. If the background changes under the window, you can see that the whole window is redrawn, so it blinks and it doesnt look well.   <Window x:Class="Transparent" WindowStyle="None" AllowsTransparency="True" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Transparent" Background="Transparent" Width="190" Height="200" Topmost="True">   <Canvas Background="#FF444444" Height="200" Width="190" Name="TranspaerntCanvas"></Canvas> </Window> On some changing background it works fine (for example when I put it over a youtube video), but over openGL background the window is blinking. I use .NET 3.5 on win XP. Does anyone know, how to fix this problem? Thank you
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