C# - How To Save Position Of Dragged Items
Sep 27, 2010
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]....
View 6 Replies
Similar Messages:
May 7, 2015
below is the code I have but I want to change the ddl.Deal(dropdownlist) to cbl.Deal(checkboxlist).. How can I loop throught each items if checked. and if all items are checked. to filter my data and show in gridview..
protected void btn_Click(object sender, EventArgs e)
{
myAPI.myWeb myAPI = new myAPI.myWeb();
myAPI.SearchParameters sSearchParameters = new myAPI.SearchParameters();
[Code].....
View 1 Replies
Mar 13, 2011
I was wondering if there is a way to place items on yoursite on top of each other, so when visible, they are not scattered thoughout the page.
View 4 Replies
Jan 24, 2010
I have a sample in the attach. Why accordion not save a position if click on "MAcK2"?
It is link (I cannot use "Insert/Edit link", show blank window)
[URL]
View 3 Replies
Sep 14, 2010
iam using 2 radio buttonlist controls in web application
they are
FIRST Yes No
SECOND Yes No
Initially SECOND radio button list is in disable position.
when i was click on yes of FIRST radio button list, then SECOND radio button list is enables otherwise it is in disable mode only.
here my problem is when i am inserting data into the database the disable radio button list gives error as
System.NullReferenceException: Object reference not set to an instance of an object.
code written for inserting is
protected void Button1_Click(object sender, EventArgs e)
{
SqlConnection con = new SqlConnection(@"Data Source=STS2SQLEXPRESS;Initial Catalog=STS;Integrated Security=True");
string sql;
sql = "insert into Table1(";
[Code]....
i want NULL value if i am not select SECOND radio button list
View 6 Replies
Oct 22, 2010
i'm using dragpanelextender,and,i want to save the position of the panel to the profile after user drop it,but i'm wondering which event should i use to do the savingi tried onmouseup,but it doesn't work in IE--user triggers the onmouseup event only if they didn't move it!this post,http://forums.asp.net/p/1188549/4134284.aspx#4134284,tells that there's a event called "ondrop"but my vs and browser told that there's no such thing.
View 2 Replies
Sep 29, 2010
I 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.
View 2 Replies
Feb 26, 2010
Can I save a page position in browser after clicking button or some other actions (after PostBack)
I need it on Page Change event in my DBGrid like on msdn.microsoft.com - when I change Tab C# -> C++ for example it doesn't refresh whole page and I still being on same position in browser.
View 1 Replies
Oct 21, 2010
I want to save the location of the panel after i drag it ,so how do i know it have been dragged?
View 2 Replies
May 11, 2010
Controller:
public ActionResult Create(int id)
{
ViewData["ProductId"] = _repository.getLaborId(id);
ViewData["OperationOrderList"] = _repository.List<OperationOrder>();
return View();
}
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(OperationOrder operationOrder,OperationProduct operationProduct)
{
try
{
foreach (var R in ViewData["ProductId"]as SelectList)
{
_repository.Create<OperationProduct> (operationProduct);
}
_repository.Create<OperationOrder > (operationOrder);
return RedirectToAction("Index");
}
catch
{
return View();
}
}
View:
<%: Html.ListBox("ProductId")%>
Q:How can I save all itmes from listbox to another table, Have I use "foreach" to save ?
View 3 Replies
Apr 1, 2011
I was following this sample but can't figure out how to add data to another column in the table at the same time:
Ex.
col#1 -id col#2 Employees col#3 Division
[URL]
View 4 Replies
Feb 1, 2011
I am using a multi-select listbox to show a date. I want to process all selected values and store them in my database.
How do I process all the selected dates and save them in a database?
Is it possible to store all the selected dates in a single row?
Is there an alternative for storing the value?
View 1 Replies
Aug 15, 2010
How can i save a list box items in view state?
View 1 Replies
Oct 29, 2010
I have a page that displays information about a patient's case. The page has some textboxes, labels, etc., and it also has a FormView. The FormView displays details for a particular TEST for this case. The user can page through the different tests, and change some of the data.
There is a button on the page to save all of the case information. I need to save ALL of the tests bound in the FormView.
The two issues are:
I can't save the Test until the user clicks the "Save Case" button (because this is when the case is first inserted into the DB).I would like to avoid have a "save test" button inside of the FormView (because then the user has to page through all tests and save each one manually)How would I do this? I thought about saving the test info in Session somehow.
I have a page with some TextBox controls and also a FormView control that displays details for a particular version of a test. The user can page through the different versions. The user can edit some of the fields in the FormView.
View 3 Replies
Jan 4, 2010
I've this checkboxlist with different sports items inside (Example Swimming, Floorball, Basketball and etc). Users are able to check/tick more than one item as they may be interested in lots of different sports. However, I realised that I'm not able to save all the items that the user has checked into the database; only an item will be saved. How can I save all the items that the user has checked into the database?The codes I'm implementing now:cblSportsInterest.SelectedValue (to save the value into the database)
View 4 Replies
Nov 24, 2013
I've 2 listboxes i want to transfer items from listbox1 to listbox2 and then save the items on listbox2 (transfered items) on database.
View 1 Replies
May 7, 2015
I have a DropDownList shows the company names and a ListBox shows the products of the company I selected in the DropDownList and I can select many products from ListBox:
in sql I have these tables:
1.company: comp_id,comp_name
2.product: prod_id,prod_name
3.Pro_Comp_details:Pro_Comp_ID,Pro_ID,Comp_ID (bridge table)
In .net I have a page with a button to add to bridge table to add a company and many products to it
this is my code but there is something missing
protected void btn_save_add_Click(object sender, EventArgs e) {
poc.Pro_Comp_ID = Convert.ToInt32(txt_prod_of_compID_add.Text);
int id1 = Convert.ToInt32(String.Format("select Comp_ID from Company where Comp_Name = '{0}'", ddl_choose_companyName.SelectedValue));
int[] id2 = new int[ListBox1.Items.Count];
[Code] ...
View 1 Replies
Feb 20, 2011
I have a gridview(gridview_1) in my website.Columns of this gridview includes label and dropdownlist.No.of rows may change each time.This gridview is to enter one survey.Once user selected values from dropdownlist,I have to save these values into database.How to do this?I have another gridview(gridview_2) which shows id,user and date of each saved survey (details of first gridview).There is no edit button in second gridview.When user double click on any items in second grid view,a page with first gridview will be loaded where selected values of dropdownlist will bethe saved values of corresponding survey.How to do this save and edit functions for a gridview?Please note there is no edit button in gridview_2 and number of rows in gridview_1 is not constant
View 2 Replies
May 7, 2015
Add and Remove Textbox to ListBox Items in JavaScript and than How to store each list box items to array list
without server postback how to store Textbox to ListBox Items in JavaScript and than How to store each list box items to array list
View 1 Replies
Mar 19, 2013
i am making use of two listboxes. the data from one listbox is transfered to other listbox on button click, bt teh the data which is selected must be added to the table in the sql server. but it is not storing values it is throwing execption...Â
private void InsertRecords(StringCollection sc)
{
SqlConnection conn = new SqlConnection("Data Source=ABCD;Integrated Security=True");
StringBuilder sb = new StringBuilder(string.Empty);
[Code].....
View 1 Replies
Jan 13, 2010
i have a div in my page, with position absolute i want change the position TOP if i write;
div.style.remove("top")
style.add("Top","300")
does not happen nothing.
do you know how can i do it?
View 4 Replies
May 7, 2015
Two ListBox Items  Compare and  Distinct  Values  Insert  Into  Third  ListBox
View 1 Replies
Aug 25, 2010
I have a few tables, Listings, ListingImages and a few others related to Listings. ListingImages is related to Listings so that you can have many ListingImages per Listing.
When I query this table I do;
[code].....
Now this is fine. However, I now want to sort the ListingImages independently within each Listing (by an ImageOrder column I have in that table).
How can I do this and pass all my Includes(...). Would it be bad form to sort the ListingImages within the View as this solution seems to work?
View 1 Replies
Sep 16, 2010
I am using Microsoft Visual Studio 2008 Professional Edition on Windows Vista Home Basic SP2 and when I am editing Visual Basic and want to add an item to the toolbox I click on Choose Items... and from that point I can't find important controls (items) like Windows Media Player or Adobe PDF Viewer. I have tried to reinstall and reset the toolbox and program. I can't find this problem anywhere in the web
View 10 Replies
Mar 5, 2010
I have 4 Checkboxlists, if i check 1st item of checkboxlist1 -- > populate items in checkboxlist2 if i check 2nd item in checkboxlist1 -- >populate items in checkboxlist2 with last selection as well as 1st checkboxlist items. So I need to Append items in Checkboxlist with existing items and also with previously selected Checkox. Is it any way except DataTable ?
View 2 Replies