 |
|
 |
Yeeow, i found the reason, the problem are the form layers, you must to put messagebox over the most external layer, if you have your form statements next to bodies statements the most external one of the layers will be all the page, and you will see this bad behavior.
try changing the position of your <form> and </form> statements send them to inside the code page, all you can...
Keep Learning...
ff
|
|
|
|
 |
|
 |
Your server side message box control is just what I was looking for!
Easy to use and to configure.
But when I use my own defined user control on the page it doesn't work anymore.
It shows the box but it doesn't raise the click event as defined in btn1_Click....
Any ideas or suggestions!?!?
jan
|
|
|
|
 |
|
 |
this is a prefect control, but it cannot run with master page. The reason is system cannot get the handle of the Element Client ID in Master page.
so just a little update of javascript, this control can run in Master page correctly, a example as follow:
original code:
gPopupMask = document.getElementById(ControlName + "_popupMask");
update code:
gPopupMask = document.getElementById("<%=popupMask.ClientID %>");
like this, update every sentence in source code, u can get a perfect control worked with Master page.
eric
|
|
|
|
 |
|
 |
Thanks, thanks and againg thanks.
it's exacly what that I looked for.
|
|
|
|
 |
|
 |
Thank you very much...
|
|
|
|
 |
|
 |
I'm sorry but I'm new at this. Do you have any sample code or a project where this was used in a master page that I could look at? Thanks, Warren
|
|
|
|
 |
|
 |
Not working for me, even after making changes with respect to master pages.
Can you please suggest solution?
Thanks in advance
|
|
|
|
 |
|
 |
As this solution doesn't work for me (and i don't know why, cause i do not know javascript) i digged more, what took me over 2 days (i'm new to asp.net though) and i do not really know, why haven't yet anybody posted solution i'm going to give here, because when you'll see it, you certainly will agree with me, that all those mvp's and other great guys had to know it.
So to make this great control work in all common *.aspx and in the ones bounded to some ContentPlaceHolder:
- open the behind cs code file
- find the one of the overloaded Show methods that invokes ShowPowWin script
- it gives the script three parameters - third is the ID of the control to show, but ID is the ID of control in the ascx file, but we need ID of the control in the entire page which differs f.e. when mbox is placed in ContentPlaceHolder (you can see this when you open source of page shown in your IE or sth)
- change this.ID to this.ClientID, which is generated on fly by framework when it is generating the page for the request
That's all ! I specially made account here, to write this and save some other people hours of searching and frustration - because if i didn't find this solution i would certainly depracete it and never use anymore.
Good Luck
|
|
|
|
 |
|
 |
Hello,
I used your wonderful code of the Server Side MessageBox, but I had small problem.
I couldn’t find how to relocate the Message window, it always appear in the middle of the page,
Can I change the location ?
|
|
|
|
 |
|
 |
Looks like a great control, however it does not seem to work if placed in a contentplaceholder.
|
|
|
|
 |
|
 |
As this solution doesn't work for me (and i don't know why, cause i do not know javascript) i digged more, what took me over 2 days (i'm new to asp.net though) and i do not really know, why haven't yet anybody posted solution i'm going to give here, because when you'll see it, you certainly will agree with me, that all those mvp's and other great guys had to know it.
So to make this great control work in all common *.aspx and in the ones bounded to some ContentPlaceHolder:
- open the behind cs code file
- find the one of the overloaded Show methods that invokes ShowPowWin script
- it gives the script three parameters - third is the ID of the control to show, but ID is the ID of control in the ascx file, but we need ID of the control in the entire page which differs f.e. when mbox is placed in ContentPlaceHolder (you can see this when you open source of page shown in your IE or sth)
- change this.ID to this.ClientID, which is generated on fly by framework when it is generating the page for the request
That's all ! I specially made account here, to write this and save some other people hours of searching and frustration - because if i didn't find this solution i would certainly depracete it and never use anymore.
Good Luck
|
|
|
|
 |
|
 |
Yes it does - try the following (you need to find the container details) its to do with name mangling with javascript
Create copy of ascx and add 'ctlName' to Public Overloads Sub Show
Page.ClientScript.RegisterStartupScript( _
GetType(String), "mb", "<script>showPopWinServerSide('" + Caption + "', null,'" + ctlName + "_" + Me.ID + "');</script>")
In Master - add
<script type="text/javascript" src="subModalServerSide/subModalServerSide.js"></script>
then the div containing
AccNet:MessBoxChild ID="ctlMessageBoxChild" runat="server" EnableTheming=true>
add to aspx containing Master
<%@ Reference Control="~/frmModalPopupServerSideCopy.ascx" %>
in code behind of aspx
Private oSubModal As New subModalServerSide_frmModalPopupServerSideChildDetail
oSubModal = CType(Master.FindControl("ctlMessageBoxChild"), subModalServerSide_frmModalPopupServerSideChildDetail)
ErrorHandler(ErrorMessage, Nothing, "Cancel", Nothing)
Private Sub ErrorHandler( _
ByVal sErrorMessage As String, _
ByVal sOk As String, ByVal sCancel As String, ByVal sRetry As String)
'-----------------------------------------
' displays error messge
' - uses subModal server side
'-----------------------------------------
oSubModal.Show( _
sErrorMessage, clsApp.MB_ErrorGeneral, _
sOk, sCancel, sRetry, _
subModalServerSide_frmModalPopupServerSideChildDetail.MessageBoxIcons.Information, _
subModalServerSide_frmModalPopupServerSideChildDetail.MessageBoxStyle.Beige, _
clsNamingContainer.GetMasterPageContainerString(Page, subModalSuffix, sContainerName))
End Sub
Then finally clsNamingContainer contains
Public Shared Function GetMasterPageContainerString( _
ByVal oPage As Page, ByVal sSuffix As String, _
ByVal sContainerName As String) As String
'-----------------------------------------
' returns string of NamingContainer for MasterPage
'-----------------------------------------
Dim sString As String = ""
Dim phContent As ContentPlaceHolder
'-----------------------------------------
' get container
'-----------------------------------------
phContent = CType(oPage.Master.FindControl("MainContent"), ContentPlaceHolder)
'-----------------------------------------
' extract ID
'-----------------------------------------
If Trim(sSuffix) = "" Then
sString = phContent.ClientID.ToString
Else
sString = phContent.ClientID.ToString & "_" & sSuffix
End If
'-----------------------------------------
' only need MasterID
' - ctl00_ctlMessageBoxChild & not ctl00_MainContent_ctlMessageBoxChild
'-----------------------------------------
sString = sString.Replace("_" & sContainerName, "")
'-----------------------------------------
' return
'-----------------------------------------
Return sString
End Function
Bit of messing about but should work
|
|
|
|
 |
|
 |
This is one of the BEST controls in codeproject. Thanks a lot. It works great and no more problems with popup blockers..
I am waiting for improvements...
|
|
|
|
 |
|
 |
Excellent article – also works as a neat little demo of how to link up events to a control in C#
Keep up the good work!!
|
|
|
|
 |
|
 |
The source files you have provided is irking with some problems for me. They are as follows
1.) c:\inetpub\wwwroot\MessageBox\Default.aspx.cs(11): Expected class, delegate, enum, interface, or struct
This is coming at "public partial class _Default : System.Web.UI.Page"
Error at partial
2.) System.Web.UI.WebControls.WebParts also has some probs. What is the reference I have to take inorder to make this namespace work
thnks
|
|
|
|
 |
|
 |
Hi my friend, if you get error on the keyword "partial" your problem is so simple and so big. you have problem with your version of .NET FW Because, as you could see in the article, this component is written for ASP.NET 2.0, so you need .NET FW 2.0
if it still does not work, please feel free to ask and search for help.
http://blogs.yazgelistir.com/kivanc/
|
|
|
|
 |
|
 |
This Sample doesnt work for me. I get tons of Warnings and Erros when try to compile. Can you give me Tips, if i tell what happens in my Environment?
Regards
Jan Waiz
Jan Waiz
|
|
|
|
 |
|
 |
Did you download the source files and look at them to see what is differnt about your code?
"Art doesn't want to be familiar. It wants to astonish us. Or, in some cases, to enrage us. It wants to move us. To touch us. Not accommodate us, make us comfortable." -- Jamake Highwater
Toasty0.com
My Grandkids
|
|
|
|
 |
|
 |
That would be great.
Thanks!
|
|
|
|
 |
|
 |
It would be also nice to have an ability to make changes through CSS rules (defined by user) and not only use 2 built in color schemas.
|
|
|
|
 |
|
 |
Yeas, you are right.
But you can edit the code, Mbox.ascx.cs file and the InitializeStyle method. Also you may add a new enum-item to MessageBoxStyle.
if you add good styles to messagebox, please mail them to me. I will update this article and ad your styles.
http://blogs.yazgelistir.com/kivanc/
|
|
|
|
 |
|
 |
I have tried a number of div popup window solutions, most do not cope with a dropdown list showing through in IE.
The normal technique is the put an iframe shim below the window div, as this is the only object that is opaque to a dropdown list.
|
|
|
|
 |
|
 |
Hi there,
check the code, you will see that, it also hides comboboxes.(Dropdownlists).
As everyone knows, <Select> html element has always the highest z-index. So, there is only oneway to hide them: Make them invisible..!!!
Check the code..
http://blogs.yazgelistir.com/kivanc/
|
|
|
|
 |
|
 |
How can I modify the z-order so that that MBox will display properly and ComboBox(Dropdownlists) will appear at the back of the MBox?
|
|
|
|
 |
|
 |
Eline sağlık sevgili Kıvanç,
Seninle gurur duyuyoruz... Makalelerinin artarak devam etmesini diliyorum.
Mesut Koşucu
|
|
|
|
 |