Showing posts with label click. Show all posts
Showing posts with label click. Show all posts

Wednesday, March 28, 2012

view problem within cc1:ModalPopupExtender ..

I have a view problem within cc1:ModalPopupExtender .. when I click an asp image button the specified panel located most top-left in a page even I do not use x or y ModalPopupExtender properties

this problem happens only with ie

in firefox everything works fine ..

here is ModalPopupExtender code :

<cc1:ModalPopupExtender ID="ModalPopupExtender3" runat="server"
TargetControlID="submitBuyImgBt"
PopupControlID="Panel1"
BackgroundCssClass="modalBackground"
DropShadow="true"
OkControlID="OkButton"
OnOkScript="onOk()"
CancelControlID="CancelButton" />

any help would be greatly appreciated

why it's position always in top left side of the page ?


what does the css look like for the panel? are you using one?

heres what i always use and it shows up at the center of the screen.

<ajax:ModalPopupExtender ID="mpeEditUserForm" runat="server" TargetControlID="btnEditUser" BackgroundCssClass="modalBackground"
PopupControlID="pnlUserModal" />
<asp:Panel ID="pnlUserModal" runat="server" CssClass="modalPopup" Style="display:none; padding:3px 3px 3px 3px" Width="320px">

css:

.modalBackground
{
background-color:Gray;
filter: alpha(opacity=70);
}
.modalPopup{
background-color:White;
border: solid 3px Gray;
padding: 3px 3px 3px 3px;

font-size:medium;
}


Mezzaluna:

what does the css look like for the panel? are you using one?

heres what i always use and it shows up at the center of the screen.

<ajax:ModalPopupExtender ID="mpeEditUserForm" runat="server" TargetControlID="btnEditUser" BackgroundCssClass="modalBackground"
PopupControlID="pnlUserModal" />
<asp:Panel ID="pnlUserModal" runat="server" CssClass="modalPopup" Style="display:none; padding:3px 3px 3px 3px" Width="320px">

css:

.modalBackground
{
background-color:Gray;
filter: alpha(opacity=70);
}
.modalPopup{
background-color:White;
border: solid 3px Gray;
padding: 3px 3px 3px 3px;

font-size:medium;
}

I have CSS but it's still not working .. but both panel and moalPopupExtender located in a web user control ( .ascx )

does the problem because of this ?

Note that every thing works fine in firefox. however not fine in ie6 or above


Not sure on that then. I always have the opposite problem. I get things to work in IE and they fail in Firefox.


Monday, March 26, 2012

Want on click event on CollapsiblePanelExtender?

want onclick event onCollapsiblePanelExtender. how should i know that panel is cliecked or expanded.

there is a bool property for the extender called collapsed that you can use :)


but I have to do some oprations on that click like assigning datasource. also selecting items which are not this panel.


Hi shantanu,

Based on your description, Iunderstand that there are two parts to your issue. I have presented the issues and their possible solutions below:

When a click event is fired , you want whether the CollapsiblePanelExtender is collapsed or not.


Excellent example, this cleared things out for me at least...
Thanks!

/Mats


I know this thread already has an answer but I found another solution that suited me better and wanted to share it. The event will be triggered after the animation is complete.

<script type="text/javascript" language="javascript"> var objExtender; // this will run automatically when the page has finished loading function pageLoad(sender, args) { objExtender = $find("<%=CollapsiblePanelExtenderObject.ClientID%>"); objExtender.add_expandComplete(getCollapsibleState); objExtender.add_collapseComplete(getCollapsibleState); } function getCollapsibleState() { if(objExtender.get_Collapsed()) { // code for when it is closed } else { // code for when it is opened } } </script>

Hi Mastl,

I have been very impressed with your high level of technical proficiency; it has been a pleasure working with you. Big Smile

Best Regards,

Jonathan


Thanks, the same to you!

This forum really is fantastic. Great to be able to get help from people like you, who really knows their stuff.

Best regards,
Mats

Want to call a javascript function from code behind

Hi.

I am trying to call a javascript function on button click, buttton is present in update panel. It is not working.

On button click event handler i m writing the following code

Response.Write("<script>functionname();</script>");

I have added script reference in script manager and given the path.

Response.Write("<script>functionname();</script>") --> this works if button is outside update panel.

Help me...

Why not try placing your javascript function name in the button's OnClientClick parameter? That way it calls it directly without requiring a post back...

OnClientClick = "functionname();"


PhunkNugget:

If you do that, which runs first, the javascript in the client or the

click event code in the code behind? may be related, so it's

important to know..I also need to invoke a modal popup

extender from code in a codebehind, not from a click event..

I'm watching this thread closely.. Geeked

Thanks in advance..


The OnClientClick runs first.


Kanwar,

You can't use Response.Write() inside an update panel. It conflicts with the ajax somehow (very annoying). You can attach the script to your button's onclick event in page load such as the following:

string myString="<script language='Javascript'>\n";

myString+="function fuctionname()\n";

myString+="{\n";

myString+="whatever your function does...\n";

myString+=

"}\n";myString+="</script>\n";

Page.RegisterClientScriptBlock(

"MYFUNCTION", myString);

btnMyButton.Attributes.Add(

"onClick","functionname();");

Then when you click on the MyButton, the javascript function will be called.

Wednesday, March 21, 2012

Web Parts menu/dragging disabled after partial update

I have a:

UpdatePanel. Inside it is a WebPartZone. Inside it is a web part.

It really simple. Button click and change the textbox to something. My problem is that as soon as I execute this the web part "verb" menu goes away and you can't drag and drop the web part after the first time it does the partial update. When you first load the page menu/dragging and dropping works fine.

Is this is a bug?

I have the same problem with asp.net ajax RC!!!!

It seems there is a big bug!!!!

It seems there is no tester in the asp.net ajax development team!!!Confused


To get around that problem can you on the postback set the webpartzone to enable again?

Web service class undefined on Client load

Having tested a simple atlas web method call from the client which is fired by calling a javascript function on a button client side click event -it works perfectly.

The problem is I need this function called when the page loads, however whenever calling this function from either the body onload client side event or by using the RegisterStratupScript on the server side page load method, I get a javascript error refering to the web service class name as being undefined.

In theory this should work, Am I missing something regarding my understanding of the atlas lifecycle perhaps?

Please help!
Thanks

Dynamic script references (included in the References section of the ScriptManager) are not available until after page loading. To use these, you need to hook the Load event of the Application object. Declaratively, you can do this with:

<application>

<load>

<invokeMethod method="MyMethodName" />

</load>

</application>

Alternatively, you can statically include the service with a <script> tag.


A simpler syntax to do this is to have:

<application load="OnApplicationLoad" />

This goes into your <components>. So you would have something like this:

<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<references>
</references>
<components>
<application load="OnApplicationLoad" />
</components>
</page>
</script>

David


BTW, I should mention that there is yet an easier way: just name your method pageLoad and it will be automatically called without having to be registered. See theAtlas docs for some examples.

David