Showing posts with label friendsi. Show all posts
Showing posts with label friendsi. Show all posts

Monday, March 26, 2012

My first Ajax use

Hello Friends

I am having a DropDownList "lstTitle" that read its values from SqlDataSourse "DSTitles" and a Label "lblNewTitle" i add a java script to the lblNewTitle like that:

lblNewTitle.Text ="<a href='javascript:window.open(\"AddNewTitle.aspx\",\"window\",\"HEIGHT=272,WIDTH=440,top=250,left=250,toolbar=no,scrollbars=yes,resizable=yes\");%20void(0);'>New Title</a>";

so when press on that label a new window appear that enable the user to enter a new title in to my sql 2000 database.

The problem is how to show this new entered title in the lstTitle without a PostPack action.

Note: i add to my page a ScriptManager and and UpdatePanel and put "DSTitle,lstTitle and lblNewTitle" inside the UpdatePanel and use a Timer with an interval of 1 second but nothing change.

So, where is the problem.

Please help me.

Hi.

Label1.Attributes.Add("onClick", "javascript:window.open('Default.aspx',height=272,width=500)");

This will help you.. sure...Remove your first logic and write this intoyour page load event and test it.

Thanks


I just have a script error "Error: 'Sys' is undefined i think the problem is in the following includes:

<%@. Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>

Hello,

not answering question, but just throwing an idea out: how about using the modalpopupextender instead of a popup window?


Thanks i found the solution.

I create a new website AJAXEnabledWebsite and but a script manager, UpdatePanel "and but the control inseide" and a Timer with an interval of 9 sec and a Tick event.

Inside Timer event handler i put:

lstTitle.DataBind();

lstTitle.SelectedValue = selected;

Wednesday, March 21, 2012

need help on drag and drop

Hi Friends!

I need a solution to Drag and Drop functionality --
Actually I am able to move the objects/or lets say containers
but main problem is how I will know which Item is being dragged
or how I will get the ID of item being dragged...

after that I have to save that item to database.

Please see to my problem

EDITED by Longhorn2005

The answer to that question depends a great deal on how you implemented the drag and drop behavior. Generally, though, you would expect that you can register to listen for an 'onDrag' or 'onStartDrag' event, and respond to it by capturing the relevant element, and its id for sending to the server via a webservice call or a pagemethod call or a raw webrequest.