AJAX :: Server Know Dragged A Panel With DragPanel?
Oct 21, 2010I want to save the location of the panel after i drag it ,so how do i know it have been dragged?
View 2 RepliesI want to save the location of the panel after i drag it ,so how do i know it have been dragged?
View 2 RepliesI have the same problem as Simon in this post. He found out some sort of a solution, but it does not work for me. Please, could someone explain me what is going on in this answer or advice me something else. PS: there is an example on the asp.net site whh doesn't work exactly the same way as my reorder list... (click view a demo) The solution that is suggested here adds these few lines to web.config:
<httpHandlers>
<add path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
Perhaps I just need to change something to make it work... but I don't know what. For example I have no idea what the ScriptResource.axd is supposed to be. My code: .aspx file
<%@ Page Title="" Language="C#" MasterPageFile="~/editor/editor_template.Master" AutoEventWireup="true" CodeBehind="menuEditor.aspx.cs" Inherits="WebPageEditor.editor.menuEditor" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
DeleteMethod="DeleteMenu" InsertMethod="InsertMenu" SelectMethod="SelectMenu"
TypeName="WebPageEditor.editor.MenuSourceManager" UpdateMethod="UpdateMenu"
>
<DeleteParameters>
<asp:Parameter Name="ID" Type="Int32" />
</DeleteParameters>
<InsertParameters>
<asp:Parameter Name="name" Type="String" />
<asp:Parameter Name="url" Type="String" />
<asp:Parameter Name="order" Type="Int32" />
</InsertParameters>
<UpdateParameters>
<asp:Parameter Name="ID" Type="Int32" />
<asp:Parameter Name="name" Type="String" />
<asp:Parameter Name="url" Type="String" />
<asp:Parameter Name="order" Type="Int32" />
</UpdateParameters>
</asp:ObjectDataSource>
<asp:ReorderList ID="ReorderList1" runat="server" AllowReorder="True"
DataSourceID="ObjectDataSource1" PostBackOnReorder="False"
ShowInsertItem="True" SortOrderField="order" DataKeyField="ID"
ItemInsertLocation="Beginning">
<ItemTemplate>
<div class="menuEditor">
» <%# Eval("name") %>
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Edit">LinkButton</asp:LinkButton>
</div>
</ItemTemplate>
<DragHandleTemplate>
<img src="ico/moveHandle_ico.gif"
alt='<asp:Literal ID="Literal1" runat="server" Text="<%$ Resources: editorLocalization, ME_moveHandleTT %>" />'
style="cursor:move; width:35px;" />
</DragHandleTemplate>
<ReorderTemplate>
<asp:Panel runat="server" />
</ReorderTemplate>
<InsertItemTemplate>
<asp:Panel ID="panel1" runat="server" DefaultButton="Button1">
<asp:TextBox ID="TextBox1" runat="server" Text=' <%# Bind("name") %>' ValidationGroup="add" />
<asp:Button ID="Button1" runat="server" CommandName="Insert" Text="Add" ValidationGroup="add" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="add"
ErrorMessage="Please enter some text" ControlToValidate="TextBox1" />
</asp:Panel>
</InsertItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("name") %>' ValidationGroup="edit" />
<asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("url") %>' ValidationGroup="edit" />
<asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("order") %>' ValidationGroup="edit" />
<asp:LinkButton ID="LinkButton1" runat="server" CommandName="Update">LinkButton</asp:LinkButton>
</EditItemTemplate>
</asp:ReorderList>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Content>
and the code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace WebPageEditor.editor
{
public class MenuSourceManager
{
public static List<MenuItem> menuItems;
#region DataBindMethods
//[System.ComponentModel.DataObjectMethod(System.ComponentModel.DataObjectMethodType.Select)]
public List<MenuItem> SelectMenu()
{
return menuItems;
}
public void UpdateMenu(int ID, string name, string url, int order)
{
menuItems[ID].Name = name;
menuItems[ID].Url = url;
menuItems[ID].Order = order;
}
public void InsertMenu(string name, string url, int order)
{
menuItems.Add(new MenuItem(name, url, order, menuItems.Count));
}
public void DeleteMenu(int ID)
{
menuItems.RemoveAt(ID);
}
#endregion
}
public class MenuItem
{
public MenuItem(string name, string url, int order, int ID)
{
Name = name; Url = url; Order = order; this.ID = ID;
}
public string Name { get; set; }
public string Url { get; set; }
public int Order { get; set; }
public int ID { get; set; }
}
}
I load the data to the List collection from the page_load event but that works fine. The data binding works as well. The problem is in that the items cannot be reordered -- during the reordering, the sort value doesn't change and the list doesn't update.
I want to save the position of dropped items to database[aspx,javascript]. The user can drop any number of item,resize and delete[hide] and finally when they hit 'save' button ,it should be saved to database. I have code to do this in drop /stop but it will save all the dropped items i want to save only at final stage.
$(function() {
$('#frame img').live('mousemove', function(event) {
$('#frame img').resizable().parent().draggable();
});
});
$(function() {
[Code]....
At first, I should confess that I am not sure if it is a good practice or not. I have came out with the idea due to my practice of jQuery.ajax().
What I want to achieve is depended on this design:
//Server Side; an .asmx file contains a method like this:
[WebMethod]
public string NewContent(string parameter)
{
string renderedHTML = string.Empty();
switch(parameter)
{
case ("person"):
// create an asp.net panel with
// some controls in it that has form elements to enter person data
// render control and assign its html to renderedHTML
break;
case ("department"):
// create an asp.net panel with
// some controls in it that has form elements to enter department data
// render control and assign its html to renderedHTML
break;
}
}
And from the client I want to do this:
// Some html in the page
<script type="text/JavaScript">
jQuery.post('ajax/myWebServices.asmx/NewContent'
function(returnedPanelContent) {
$('.result').html(returnedPanelContent);
});
</script>
Question is:
How can I make it work? Briefly to have a webservice method that returns different asp.net Panel control content created programmatically so that I can get this control rendered as HTML in my client-side and insert it to my web page?
I have a panel bar..each time I press panel bar item I display ascx control with in update panel..but it lakes update panel loading time lot..how I can decrease that loading time?
View 2 RepliesI have an AJAX Modal Popup panel that contains a RadioButtonList, 2 labels and 2 DropDowns. I want to update the Labels and DropDowns when a radio button is selected. My attempt at this posts back which causes the ajax popup to disappear.
aspx called on image click:
<asp:Panel ID="pnlModalContainer" runat="server">
<asp:RadioButtonList ID="rblTest" runat="server" RepeatDirection="Horizontal" OnSelectedIndexChanged="rblTest_SelectedIndexChanged">
[code]...
I am having trouble wiht my AJAX collapsible Panel Extender. I have the CPE opening a panel that contains the Table of Contents of a document being displayed on the page. A user clicks on the link for a certain part of the document, the event triggers a C# function that gets the file that particular section is contained in an displays the section. Right now you have to, of course, click on the TitlePanel to open and to close the CPE. What I want to do is have it close automatically whenever a link inside the content panel has been clicked. I have tried placing this.cpeTOC.Collapsed=true; in the functiion that gets the files but it does not work. I have also tried the autocollapse property of the CPE and it just collapses whenever someone moves thier mouse from the titlepanel.
View 1 RepliesI am using Ajax Control ToolKit's Accordian Control with 5 Accordian Panel. Contents of Accordian Panel are UserControl. Currently I have added all in the design mode, But it making my page slow because it loads all the content at a time. So, I want this to be dynamic. When User Click on Header of Accordian Panel, It loads the user control dynamically and also asynchronously.
I tried to put the user control under UpdatePanel which I placed under Accordian Content Panel but this is not working. Also I want to display loading images if getting slow response from server. how can I achieve it. It will be better if you provide an example.
I need to update datalist in image gallery when fileupload has been completed.
<div style="display: block;">
<div>
<div style="padding-left: 15px; padding-right: 15px;">
<div>
<uc1:ctrlFileUpload ID="ctrlFileUpload1" runat="server" />
<uc2:ctrlImageGallery ID="ctrlImageGallery1" runat="server" />
</div>
<div>
</div>
</div>
</div>
</div>
In the Control File Upload I need to fire the the other ctrl to refresh the page.
<asp:UpdatePanel ID="UpdatePanelUploadArea" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<span>
<asp:FileUpload ID="FileUpload1" runat="server" />
<br />
<asp:Button ID="UploadButton" runat="server" Text="Upload Now" OnClick="UploadButton_Click" />
<asp:Label ID="lblResult" runat="server" ForeColor="#0066FF"></asp:Label>
<br />
</span>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="UploadButton" />
</Triggers>
</asp:UpdatePanel>...........
I'm new to the world of Update Panels and i'm having a hard time figuring out how to use them properly.
I have a form that has a table(TABLE1)...and inside TABLE1 i am linking to a sql data source....at the bottom of the table i have a 'Add' button.
When the user clicks the add button...a modal popup appears (POPUP1) and inside the POPUP1 the user can click a link that can add a user...when the link button is clicked...a panel within POPUP1 is set to visible = true.
I have one update panel around the whole table and the add button...when i click add and then click the link to add a user....the modal popup disappears.
i have a panel out of update panel.i have to make it hidden while navigating through different tabs,i tried these codes
Panel1.Attributes["style"] = "display: 'none';";
Panel1.Attributes.Add("style", "DISPLAY:none;");
three div tag having three button i have clicked a button i want to find which button clicked on which tag in asp.net
View 1 RepliesHow to Make an Opacity Panel Over Other Panel has Pictures
View 5 RepliesI have an UpdatePanel and inside that I have an Accordion and several panes. From the first pane i can push three ImageButtons. Each imagebutton will load a control into a Placeholder in another Pan - still in the same accordion though.
The problem accur when I push the buttons. After two or three push the buttons will stop responding and nothing gets loaded into the Placeholder.
[Code]....
I've the Javascript code to do a confirmation before deletion of some records
function confirmDelete()
{
if(confirm('Delete all?'))
{
return true;
}
else
{
return false;
}
}
I've the button code here
<asp:Button ID="btnDelete" runat="server" onClientClick="return confirmDelete();" onClick="btnDelete_click" />
If i've the button outside an update panel (basically i'm using RadAjaxPanel by Telerik) it is working fine. But when the button is inside an ajax panel, even if i click OK for deleting the records the server side code is not called.
How to assign one tab panel to another tab panel in ajax in asp.net 2.0 ....
View 1 RepliesI have a web page that I have a media control player on along with other controls in a table.It's a training video, so the controls are not visible.So the user can advance to the next web page,I thought I would have a button control inside an update panel with a time control so that the user had to watch the video and then the button control would appear after the video completed.I'm setting the button update panel to NOT visible and then turning it one when the time control elapses the same amount of time that the video runs.My problem is that when I set the visible property of the update panel to NOT visible it also makes the media player's panel NOT visible too.They are in two different panels.The medial player in a standard panel and the timer control connected witha separate panel that contains the button for the user to proceed. When I set the visible property to "true" the media player runs but the update panel with the button is visible also.
[Code]....
This is the code for the update panel and continue button that is in a separate table cell.I even split the table and so this is in a completely separate table but I still get the same behavior.
I have a panel withitn an updatepanel with some buttons.
When one of the buttons is pressed, I'm updating a different update panel.
The problem is that when I click the button, nothing seems to happen.
If I click the button again , then I see the first update. If I click it again, I see the second update and so on..
I have one update panel inside updatepanel i have one dropdownlist .When i change dropdownlist value so as per value button1 which is out of updatepanel not visible =true or false as per dropdownlist value.
View 2 RepliesIn my application I am using ajax updatepannel in which there is a tab container tool having 4 tabs, in the third third tab I used ajax accordian control which has 2 panel each pannel have one gridview control a Remove button. Here what I want to give delete facility to the user upon the selection of checkbox corresponding to the particular record. But when I click the button it doesnot triger the button click event of the remove button.
sorce code :
[code].....
i found that for X & Y co-ordinates value of the Ajax toolkit dragPanel is very easily calculated from this article
Retain position of a DragPanel Extender after postback using ASP.NET AJAX
but i need to store the value in database and while page_load() i need to render the control as per the Co-ordinate values from the database .
From the above solution everything is fine except that i need to do it with code behind(from server side).
and i don't know a JavaScript a lot .
I want to create an ajax panel (correct terminology?) in my webpage that updates just part of the page instead of updating the whole page.Can I do this while using ASP.net and Visual Basic.net? I do not use C#.If this is possible using VB.net, can someone point me to a few documents that will help me get started?
On a 1 to 10 scale, I would rate my technical knowledge at only about 5 or 6.
I know everyone has heard this a million times, but I need help with the back button and the AJAX update panel.I essentially have a form, that has 5 fields:Vehicle Make (In update panel #1) Model (In update panel #1) Trim (In update panel #1) Ownership Status Zip Vehicle model gets populated depending on what you put in make, same with trim. Now once the user hits next, I do a response.redirect. When I hit the back button, the possible values, and the current index is wiped for Vehicle Make, Model, Trim. I cannot
figure out a way around this.I have read about that history management feature, but seems uselesss since I need to somehow update the make, model, and trim possible values. Isn't there any way for me to get these values in the viewstate before I post the page?
We have two update panels on our webpage. Now first update panel is having button cancel. While second update panel is having a file upload control.
Now if the user uploads a file that is going to upload in about 2 mins, and in between, say after 30 seconds the user clicks the cancel button, the upload taking place in update panel 2 should stop.
How do we achieve this ?
i have my master page with one update panel working like a banner, so when the timer do tick every 5 sec
the image change. That works fine, but i have an update panel in my index page, this update panel works with some buttons that change the text inside the panel when click.
Now, the problem.
When i click one button to change the text and the banner change, the text returns to his default text. The update in master page is affecting the update on index page.