Showing posts with label panel. Show all posts
Showing posts with label panel. 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

VS doesnt recognize tags asp

Hei,

I'm getting started with ajax, i do a lot of things with the ajaxToolkit but i still have a problem,

When i put an update panel on a page, visual studio can't recognize all the asp tag, and my code loose its formating and i can't use completion (ctrl+space) anymore.

Is it a problem of web.config?

Thanks to help me.

ps: Sorry for my english ...

This is my web config

<?

xmlversion="1.0"?>

<

configuration>

<

configSections>

<

sectionGroupname="system.web.extensions"type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<

sectionGroupname="scripting"type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<

sectionname="scriptResourceHandler"type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>

<

sectionGroupname="webServices"type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">

<

sectionname="jsonSerialization"type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>

<

sectionname="profileService"type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>

<

sectionname="authenticationService"type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"requirePermission="false"/>

</

sectionGroup>

</

sectionGroup>

</

sectionGroup>

</

configSections>

<

connectionStrings>

<

addname="DBConnectStr"...."/>

</

connectionStrings>

<

system.web>

<!--

Recupere la langue du browser-->

<

globalizationuiCulture="auto"culture="auto" />

<

trustlevel="Medium"/>

<

pagesstyleSheetTheme="Default">

<

controls>

<

addtagPrefix="asp"namespace="System.Web.UI"assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

controls>

</

pages>

<compilationdebug="true">

<

assemblies>

<

addassembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addassembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/></assemblies>

</

compilation>

<

httpHandlers>

<

removeverb="*"path="*.asmx"/>

<

addverb="*"path="*.asmx"validate="false"type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addverb="*"path="*_AppService.axd"validate="false"type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addverb="GET,HEAD"path="ScriptResource.axd"type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"validate="false"/>

</

httpHandlers>

<

httpModules>

<

addname="ScriptModule"type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

httpModules>

</

system.web>

<

system.web.extensions>

<

scripting>

<

webServices>

</webServices>

</scripting>

</

system.web.extensions>

<

system.webServer>

<

validationvalidateIntegratedModeConfiguration="false"/>

<

modules>

<

addname="ScriptModule"preCondition="integratedMode"type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

modules>

<

handlers>

<

removename="WebServiceHandlerFactory-Integrated"/>

<

addname="ScriptHandlerFactory"verb="*"path="*.asmx"preCondition="integratedMode"type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addname="ScriptHandlerFactoryAppServices"verb="*"path="*_AppService.axd"preCondition="integratedMode"type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<

addname="ScriptResource"preCondition="integratedMode"verb="GET,HEAD"path="ScriptResource.axd"type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

</

handlers>

</

system.webServer>

</

configuration>noone for me?

want collapsiblePanel in user control to remember its state

Hi,

I am using the ajax collapsible panel extender. Is there a way to remember the state of the collapsible panels?...

basically i am using it as part of a side navigation, the sidenavigation is a user control and is used on every webpage of the site. when i click the hyperlinks (contained within the panels that extend) the page navigates to the new page and all the panels collapse. i can see how this can get frustrating to users. so is there a way that it can remember what state it is in??

thanks

Hi,

According to your description, you want to maintain the state of collapsible panels between different pages, isn't it?

In order to implement this, you need to save the state in a place out of the scope of a page, so that it can't be shared among different pages. Cookie, Session, or Profile will be good choices for you.

By default, the state is saved in ViewState or some additional HiddenField. The problem with them is that they are inside a page, and are always transfered to the server with POST http request. When it's redirected to a new page with GET request, those values will not be available in the new page. So, storages that doesn't rely on a specific page should be used.


yes i want it to remember the state across different webpages.

Can you guide me further with what i may need to do?...can i do this by assigning something to a session variable? if so what must i assign?and what must i do to open the new page with the newly assigned state?

thanks


You can save the state in session. For example, Session["cp1State"] = ture; // indicates collapsibelPanel1 is expanded.

Another thing you need to do is use javascript to invoke a web service to save current state in session. This javascript will work as the expanded and collapsed event handler for the corresponding CollapsiblePanelBehavior.


Hello Raymond,

Please can you give further details with the web service i need. i dont really know about web services...are there any examples used in conjunction with collapsiblePanel?

thanks


Here is a sample:

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server">[System.Web.Services.WebMethod] public static void SaveState(string state) { HttpSessionState session = HttpContext.Current.Session; session["State"] = state; } protected void Page_Load(object sender, EventArgs e) { string script = @."function pageLoad(sender, args) { {0} $find('cpe2Behavior').add_collapsed(onCollapsed); $find('cpe2Behavior').add_expanded(onExpanded); }"; if (Session["State"] != null && Session["State"].ToString() == "expanded") { script = script.Replace("{0}", "$find('" + CollapsiblePanelExtender2.BehaviorID + "').expandPanel();"); } else { script = script.Replace("{0}", ""); } ScriptManager.RegisterStartupScript(this, this.GetType(), "expand", script, true); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"> </asp:ScriptManager> <asp:Panel ID="panel4" runat="server" > <asp:LinkButton ID="lnk2" runat="server" Text="Show Details"/> </asp:Panel>  <!--Content to show--> <asp:Panel id="panel3" runat="server"> Content </asp:Panel> <ajaxToolkit:CollapsiblePanelExtender SuppressPostBack="true" ID="CollapsiblePanelExtender2" BehaviorID="cpe2Behavior" runat="server" TargetControlID="panel3" ExpandControlID="panel4" CollapseControlID="Panel4" Collapsed="True" TextLabelID="lnk2" CollapsedText="Show Details.." ExpandedText="Hide Details.." > </ajaxToolkit:CollapsiblePanelExtender> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default3.aspx">Redirect to me</asp:HyperLink></div> <script type="text/javascript"> function pageLoad(sender, args) { $find("cpe2Behavior").add_collapsed(onCollapsed); $find("cpe2Behavior").add_expanded(onExpanded); } function onCollapsed(sender, args) { PageMethods.SaveState("collpased"); } function onExpanded(sender, args) { PageMethods.SaveState("expanded"); } </script> </form></body></html>

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.

Saturday, March 24, 2012

Watermark and popup cal inside update panel

Hi David Anson, want to know if the problem for watermark and popup cal have been sloved.
Thanks.

Not sure I know what issue you mean, but maybe the following blog posting helps?

http://blogs.msdn.com/delay/archive/2006/08/15/701848.aspx


Thanks, David. I try the code with AtlasControlToolkit-1064. It reports error
object does not support the property or method

the code for this error is:
$object("TextBoxWatermarkBehavior_TextBox1").set_text(favoriteColor);.

I try the apporach for my case as with textbox and popup calendar.
Code:
<script>
function commitScript() {
var mydate = $("TextBox1").mydate;
if("" == favoriteColor) {
favoriteColor = "";
}
$object("TextBoxWatermarkBehavior_TextBox1").set_text(mydate);
}
</script
<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" RenderMode="Inline">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlProperties TargetControlID="txtBatchDateTextBox" PopupControlID="Panel1"
Position="Bottom" ID="PopControlBehavior1" CommitProperty ="batchDate" CommitScript ="commitScript()"/>
</atlasToolkit:PopupControlExtender>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel
<atlasToolkit:TextBoxWatermarkProperties ID="TextBoxWatermarkBehavior" TargetControlID="TextBox1"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" /
<asp:TextBox ID="TextBox1" runat="server" CssClass="TextBox" Width="152px"></asp:TextBox></td
The I got error:
Object Required

The code for this error is:
var mydate = $("TextBox1").mydate;

So questtions are:
Where to get the 60731 release of the Toolkit?
Only this release support custom expando property for targetControlID?
Sorry, the code is:

<script>
function commitScript() {
var mydate = $("TextBox1").mydate;
if("" == mydate) {
mydate = "";
}
$object("TextBoxWatermarkBehavior_TextBox1").set_text(mydate);
}
</script
<asp:Panel ID="Panel1" runat="server" CssClass="popupControl">
<atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional" RenderMode="Inline">
<ContentTemplate>
<center>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="#808080" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlPropertiesTargetControlID="txtBatchDateTextBox" PopupControlID="Panel1"
Position="Bottom" ID="PopControlBehavior1" CommitProperty ="mydate"CommitScript ="commitScript()"/>
</atlasToolkit:PopupControlExtender>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel
<atlasToolkit:TextBoxWatermarkProperties ID="TextBoxWatermarkBehavior" TargetControlID="TextBox1"
WatermarkText="<DD/MM/YYYY>" WatermarkCssClass="watermarked" /
<asp:TextBox ID="TextBox1" runat="server" CssClass="TextBox" Width="152px"></asp:TextBox></td>
As I note in the blog post, the example is forToolkit release 60731.
Hi David, Thanks for your message. I download the release 60731 and try it for watermark and popcalendar, it is greate okay. But I have another prblem.

In my page, I use many other atlas toolkit controls. It works fine when I use AtlasControlToolkit-1064. But with the release 60731, it cause a lot of assertion errors. The following code cause assertion errors for ConfirmButton and errorMessage user control.

Any new release include 67031 and 1064 fixes?

<%@. Register src="http://pics.10026.com/?src=errormessage.ascx" TagName="errormessage" TagPrefix="uc2" %>
...
<atlasToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server">
<atlasToolkit:ConfirmButtonProperties TargetControlID="btnDelete" ConfirmText="Are you sure you want to delete?" />
</atlasToolkit:ConfirmButtonExtender>
<uc2:errormessage ID="ErrorMessage1" runat="server" />
More info about ConfirmButton:

For the ConfirmButton, its target control is a button. This button is visible or invisible dynamically. When It is invoisible, then there is a assertion error.
This visible attirbute is set in asp code.

With release 1064, it's okay. With release 60731, it report assertion error.

<atlasToolkit:ConfirmButtonExtender ID="ConfirmButtonExtender1" runat="server">
<atlasToolkit:ConfirmButtonProperties TargetControlID="btnDelete"ConfirmText="Are you sure you want to delete?" />
</atlasToolkit:ConfirmButtonExtender>

Please post a simple page demonstrating the assertion you hit. Thanks!

watermark disappears after partial postback on another update panel

I have two update panels on page. One of them has an watermark toolkit control which just displays a piece of text in a textbox.

When the page loads the watermark is visible. But if there is a partial postback on the other updatepanel then the watermark disappears.

I am on beta 2 of ajax, and the most recent version of the toolkit.

Is this a known issue, a bug, or are there workarounds?

This scenario should work (and does in at least some circumstances) - please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

Way to hold state of collapsible panel?

I've created a website application with a MasterPage that has an Accordion side-menu contained in a Collapsible Panel. It works fine, however, I need a way to hold the state of these controls when the user is redirected to another page.

So, if they have the side-menu collapsed and click a link to another page, when the new page is displayed, the side-menu should remained collapsed...is there anyway to do this? Basically, I just need to set some Session Variables to hold the state whenever the user manipulates the side-menu...

You could probably do it in viewstate? I don't have time to test it out right now, I'll try to get back to this later if nobody else has answered. Basically after you open a collapsible panel you could set something like viewstate("thiscontrolisCollapsed")=false and then on the page load you could do something like

if viewstate("isCollapsed")=false then

' code to open panel

end if

just off the top of my head. Sorry I can't be more technical with it, I'm getting ready to walk out the door and thought I'd throw this out as a suggestion.


Thanks, but the problem is actually being able to hold the state of the collapsible panel on the server side. All the collapsing and expanding is handled in client side javascript, and I'd need to somehow run some server-side code to hold the state after the client script has expanded or collapsed the panel.

I was thinking I need to fire off a client side call-back, but I can't figure out how to trigger it when the collapsible panel is expanded or collapsed...


Ok, I've figured out how to accomplish this. I already had an image that was the ExpandControlID and CollapseControlID, that the user clicks on to expand or collapse the panel. So I simply added an onclick attribute to that image which calls a javascript that initiates a client side call-back, where I pass the Collapsed status of the panel to the server and set a session variable. My code is below:

<script type="text/javascript" >
function holdSideMenuState(){
holdSideMenuStateInSession(!$find("SideMenuBehavior").get_Collapsed());
}

function sessionNowHoldsSideMenuState(isSideMenuCollapsed, context){
alert(isSideMenuCollapsed);
}
</script>
<table border="0" cellpadding="0" cellspacing="0" class="SideMenu">
<tr>
<td class="SideMenuExpandCollapse" valign="top">
<asp:Image ID="imgExpandCollapse" runat="Server" ImageUrl="~/images/collapse.jpg" CssClass="ExpandCollapseImage" />
</td>
<td>
<asp:Panel ID="pnlSideMenu" runat="Server">
Side Menu Content goes here....
</asp:Panel>
</td>
</tr>
</table
<ajaxToolkit:CollapsiblePanelExtender ID="cpeSideMenu" runat="server"
TargetControlID="pnlSideMenu"
CollapsedSize="0"
Collapsed="False"
ExpandControlID="imgExpandCollapse"
CollapseControlID="imgExpandCollapse"
AutoCollapse="False"
AutoExpand="False"
ScrollContents="False"
ImageControlID="imgExpandCollapse"
ExpandedImage="~/images/collapse.jpg"
CollapsedImage="~/images/expand.jpg"
ExpandDirection="Horizontal"
BehaviorID="SideMenuBehavior">
</ajaxToolkit:CollapsiblePanelExtender>


protected void Page_Load(object sender, EventArgs e)
{
string callBackReference = Page.ClientScript.GetCallbackEventReference(this,"isSideMenuCollapsed","sessionNowHoldsSideMenuState","context");
string callBackScript ="function holdSideMenuStateInSession(isSideMenuCollapsed, context){" + callBackReference +"}";
Page.ClientScript.RegisterClientScriptBlock(this.GetType(),"holdSideMenuStateInSession", callBackScript,true);

imgExpandCollapse.Attributes["onclick"] +="holdSideMenuState();";

if (!IsPostBack)
{
if (Session["IsSideMenuCollapsed"] ==null) Session["IsSideMenuCollapsed"] =false;

cpeMenu.Collapsed = Convert.ToBoolean(Session["IsSideMenuCollapsed"]);
}
}

public void RaiseCallbackEvent(string isSideMenuCollapsed)
{
Session["IsSideMenuCollapsed"] = isSideMenuCollapsed;
}

public string GetCallbackResult()
{
return Session["IsSideMenuCollapsed"].ToString();
}


I have some more work to do because in my real code, I actually have an Accordion inside the collapsible panel, and I need to hold the state of the accordion as well, but I'll save any questions I have with that for another thread...

Wednesday, March 21, 2012

Web Part moves only once with Ajax Update Panel RC1

I uset Web part with Update Panel RC1.

But only once DND possible.

Next time it is not available.....

Can anybody have solution for this.??

Try to specify post back through the triggers of the asp:UpdatePanel.
Here are some sample codes for your reference.
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="upPortal" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:WebPartManager ID="wpmPortal" runat="server" Personalization-Enabled="true">
</asp:WebPartManager>
<div class="wrapper">
<asp:CatalogZone ID="czPortal" runat="server">
</asp:CatalogZone>
</div>
<div class="wrapper">
<div id="wz1">
<asp:WebPartZone ID="WebPartZone2" runat="server" HeaderText="Column 1">
<ZoneTemplate>
<asp:Wizard ID="Wizard1" runat="server">
<WizardSteps>
<asp:WizardStep ID="WizardStep1" runat="server" Title="Step 1">
</asp:WizardStep>
<asp:WizardStep ID="WizardStep2" runat="server" Title="Step 2">
</asp:WizardStep>
</WizardSteps>
</asp:Wizard>
<%--<uc1:ThemeSelector ID="ThemeSelector1" runat="server" EnableTheming="True" />--%>
</ZoneTemplate>
</asp:WebPartZone>
</div>
<div id="wz2">
<asp:WebPartZone ID="WebPartZone3" runat="server" HeaderText="Column 2">
<ZoneTemplate>
<asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="Black"
DayNameFormat="Shortest" Font-Names="Times New Roman" Font-Size="10pt" ForeColor="Black"
Height="220px" NextPrevFormat="FullMonth" TitleFormat="Month" Width="312px">
<SelectedDayStyle BackColor="#CC3333" ForeColor="White" />
<TodayDayStyle BackColor="#CCCC99" />
<SelectorStyle BackColor="#CCCCCC" Font-Bold="True" Font-Names="Verdana" Font-Size="8pt"
ForeColor="#333333" Width="1%" />
<DayStyle Width="14%" />
<OtherMonthDayStyle ForeColor="#999999" />
<NextPrevStyle Font-Size="8pt" ForeColor="White" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" ForeColor="#333333"
Height="10pt" />
<TitleStyle BackColor="Black" Font-Bold="True" Font-Size="13pt" ForeColor="White"
Height="14pt" Font-Names="Arial" />
</asp:Calendar>
</ZoneTemplate>
</asp:WebPartZone>
</div>
<div id="wz3">
<asp:WebPartZone ID="WebPartZone4" runat="server">
<ZoneTemplate>
<asp:Login ID="Login1" runat="server">
</asp:Login>
<asp:Login ID="Login2" runat="server">
</asp:Login>
</ZoneTemplate>
</asp:WebPartZone>
</div>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="czPortal" />
<asp:PostBackTrigger ControlID="WebPartZone2" />
<asp:PostBackTrigger ControlID="WebPartZone3" />
<asp:PostBackTrigger ControlID="WebPartZone4" />
</Triggers>
</asp:UpdatePanel>
</div
Wish the above can help you.

I tried this before only

But the problem is Page get refresh evrytime when u Drag & Drop the webparts.

then whts the use of UpdatePanel?

Give solution for this...

thnxSmile


If you want to drag&drop webparts, you should specify post back foy them.Otherwise they can't work in Ajax RC 1.0 inder asynchronous post back.I am not sure if ajax:DragPanelExtender is suitable to you.If yes,you can refer to the following sample codes.
<div>
<div style="width: 407px; height: 227px; background-image:url(images\airplane.bmp);background-repeat: no-repeat; border: 5px solid gray">
<table style="width: 250px;">
<tr>
<td style="font-family: Gill Sans MT; font-weight: bold; font-size: 12pt; padding-left: 5px;color: white; height: 41px;">? Room View<hr />
</td>
</tr>
<tr>
<td>
<asp:Panel ID="pnl" runat="server">
<div runat="server" id="headerdiv" style="width: 70px; height: 15px; display: block;
background-image: url(images/Graphics.gif); font-size: 7pt; color: Black; font-family: Arial;
text-align: right; padding-right: 5px; border: 1px solid black; cursor: move;
float: left; font-weight: bold; z-index: 200" onmouseover="showDiv()" onmouseout="hideDiv()">
...dragable
</div>
<br />
<div id="MainPicture" runat="server" style="width: 100px; height: 100px; overflow: visible;
background-color: inherit; cursor: move; vertical-align: middle; text-align: center;"
onmouseover="showDiv()" onmouseout="hideDiv()">
<img runat="server" id="picturemain" alt="room view" src="http://pics.10026.com/?src=images/Amazon.gif"
style="width: 250px; height: 150px; border-right: 5px solid black; border-bottom: 5px solid black;
border-top: 1px solid silver; border-left: 1px solid silver" />
</div>
</asp:Panel>
</td>
</tr>
</table>
</div>
<Ajax:DragPanelExtender ID="DragPanelExtender1" runat="server" DragHandleID="MainPicture" TargetControlID="pnl">
</Ajax:DragPanelExtender>
</div
Wish the above can help you.

thnx for replying...Smile

But I can't revert back now....

I have to wait for final release of MS Ajax

Thnx once againSmile


I have the same problem. It is pretty annoying, this was my first try with atlas. I saw demos with webparts without postback.

What is actually the problem? A broken atlas framework has been released?

Would the next version of Atlas fix this problem?

Would an older version of Atlas be useful and where to download it.

This topic is important!


Just forget about it!

Ajax drag and drop will NOT be supported, even in the final release of Atlas.

Only Orcas will support that.


When Oracs will be released??


Hi,

chetan.sarode:

When Oracs will be released??

Last thing I heard was the 3rd quarter of this year. You can already download a CTP:http://www.microsoft.com/downloads/details.aspx?familyid=1ff0b35d-0c4a-40b4-915a-5331e11c39e6&displaylang=en&tm.

Grz, Kris.