Showing posts with label view. Show all posts
Showing posts with label view. Show all posts

Wednesday, March 28, 2012

AJAX BETA 1: cascadong dropdwon list

my cascading drop down list is not working in the AJAX BETA 1 RELEASE,

if i have the cascading drop down list in side a form view then it is not working ,else it is working perfectly.

still not sure

oes any body has same problem????

Maybe:http://forums.asp.net/thread/1441672.aspx

Monday, March 26, 2012

Ajax Approach

Hi all,

Well my query is regarding the optimal use of ajax,I have to build a user control that is functioning of tree view .example

There are three pane

1.In fist pane there is a tree view

2 In 2nd pane ,contain the list that is populated on click of a node(on text click)

3 In third pane when i double click the item of second pane it should moved into 3rd pane.

4.when i clicked on the node of the tree its child should filled from the database (this is imp one as no whole page should be post back only that node part should generated here i take a help of ajax)

Any any kind of help will contribute to me.

thanks

My suggested approach will be this:

1. Send requests for data to server side via SriptMethod on page or WebMethod on ScriptService .

2. Get the data as objects to client side (It will be if you're working with JSON)

3. Handle all UI changes in client side (Fore example: expand node on callback function - after you've received data from server)


Thanks its good and will work fine i hope iam still searching for good .

what approach is better ie use a .net treeview control in update panel or make a ajax call on clicking on each node i know the 2nd one is good but i need some more facts like if i used ist one and when a node clicked event is generated then whole tree view is posted but in second one there is on demand loading

please send some more views

thanks

Saturday, March 24, 2012

Ajax and Web custom Control

Hi all ,

Can any budy tell the approach for building a treeview web custom control using ajax

I cant getting the idea of rendring the tree view(HTML for Tree view ie using ajax)

Any help

Hi

Have you tried nested Datalists?

Thanks


No Jin

Nerver Header give some hint...

Another thing ,i start to build the tree using ul and li of html tag and rendering in the following manner

protected void BuildDivContainingTree(HtmlTextWriter output)
{

// Start building the HTML
output.Write("<div><ul><li>");
output.Write("<table><tr><td><IMG src='../../images/minus.gif'></td><td style='cursor:hand' onclick='onTextClicked(0,0);'>");
output.Write("<font color=red>");
output.Write(this.BaseNodeText + "</font></td></tr></table>");
output.Write("<div id='treeview_0'></div><div id='DivInPage'></div>");
output.Write("</li></ui>");

output.Write("<script>document.onreadystatechange=StartLoading('" + this.Type + "')</script>");

}

now i want to send a ajax cal for filling the node of the tree...

what should i do ?

as i created in the custom control i send a request to a aspx page and execute server function and place the out as response text as xml dox and render it in <li> inner text .

any suggestions

AJAX and using the onbeforeunload event

When my form loads I set a variable in the database to lock the form. Only one user at a time can edit/view the form. When they click the Save button I remove the flag via a database query and the form is no longer locked. This works great when the user clicks the Save button. But what do you think happens when they do not click the Save button and they leave the page? Since no button on the form was pushed I cannot update the database to unlock the form. So I thought of using the onbeforeunload event. I am using it now to tell the user that if they leave the form before they click the Save button their data will be lost. What I would like to be able to do is when the user does click the OK button on the alert box and they do leave the form I would like to run a sql statement to update the database and to unlock the form. Is this do-able? With or without AJAX?

Just theorizing... but since you succesfully have the alert box going - on the unload event.. can you tie up an asynchpostback event in javascript to handle this - once the request is fired all should be good (the migration guide has some examples of this I believe...) or as an alternative you can popup a modal (however at that point the user can just hit the back button again anyways)...

For a double measure - either use an event timer in the global.asax that call the stored procedure. One additional field in the database would be needed "TimeofRecordLock"... and modify the sp to search for all records that time expired from initial lock that excedes your lock time... get reset... Any postbacks that occur just have the sp that does whatever or the code behind itself to update the new time value... - then you could have a special updatepanel that is set to refresh on a timer - "Record is locked" kinda of deal - when timer expires and no updates have been made - it provides another option - "re-lock record"... if it trys to and another user grabbed it then it reverts to a option - notify me when record is unlocked... The cool thing about ajax you can make that happen and the user really needs to not do anything...

You could also create a cache that that stores the time and you update the time in cache and map it to the session of the user ...and on clearing the cache entry you run through all sessions tied to records and perform a batch sql to reset those values in the db...

Just some thoughts as you have multiple scenarios - not only in the ajax enviroment - to consider...


Thanks for all the suggestions Jody. I am most interested in the asynchpostback on the unload event. Seems that this would be the best way to go. Where is the migration guide?

Ajax and UserControl from scratch

Hi all,

Iam building a web custom control from scratch ir no server control is used ..so how i implement ajax in this.

Example:i created a tree view using <ul><li> and when i clicked the node i call a javascript function for filling the data now where i write this function so that every call to this function is asynchronous

please help me out

Hi Spanco,

Partial Update Treeview is a complex and big project, so sorry we cannot provide a working sample as what you want to get.However, in my opnion, I think you may use Ajax + Div + WebService. Fortunately, I have found some urls related what you are concerning. Here they are:

1.http://www.codeproject.com/useritems/TreeViewAjax.asp

2.http://www.codeproject.com/Ajax/IntroAjaxASPNET.asp

3. http://ajaxaspects.blogspot.com/2006/01/tree-view-ajax-control.html The sample url:http://www.mathertel.de/AjaxEngine/S03_AJAXControls/TreeView.aspx . You can get the source code here and I hope that you can benefit from it. This sample is using Ajax + XML +WebService.

This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

I hope this help.

Best regards,

Jonathan

Ajax and querystring parameter

Hi,

I am developing a new application with Ajax.

I must create a new aspx page that have two mode: "view" or "modify" and show some products based on their ID.

In not Ajax context I use the query string with parameters to change the mode and the ID of products and it is very simple. I change the query string using Response.Redirect("same page + new paramaters")

With Ajax I think to use some session variables to manage the mode of page and ID of products...

Is the correct solution?

Since the view/modify is likely tied to the authenticated user, I'd suggest use encrypted ViewState variables to store the productid and page mode. It won't expire compared to the SessionState.


Ok, but I have the necessity to pass some values (modify/view, productId) to this page.

Is the viewstate accessible between pages?

If I store an object in viewstate and then there is a redirect to a new page, is the object value accessible from new page?

Thank you.


I am using the session to tranfer object between pages and then I use the viewstate for postpack in the same page.

I have a problem.

I click in a button and in onclick method I change viewstate "mode" value from "view" to "modify"...

When in the Page_Load event I test the value of viewstate mode, it is still "view" instead of "modify". The viewState value change only on next postback...i must click two times to change page modality from view to modifiy.

How can I resolve this problem?


Ok, I have inserted the check in the Page_PreRender method and now it is working fine.

I did not remember that any code that is dependent on a control event should be put into PreRender method.


If you need to keep variable value between pages, using sessionstate is one solution, keep in mind that session will expire. You can also use database to handle temporary data storage. A new feature in ASP.NET 2.0 is the postback to another page, read this article to see if it fits what you wanted:http://msdn2.microsoft.com/en-us/library/6c3yckfw.aspx

For viewstate, it only belong to the current page. The value will not be carried over to another page.

AJAX and Map

Hi,

I want to develop a Web site in cartography using AJAX.

I want to view the map of the world and when the mouse survive Europe, the corresponding zone on the map changes colours(like tooltipText) and when I click above, the map of Europe appears.

Is it possible to do this with AJAX and DOTNET ?

Best Regards

If i may suggest checking out this blog post and it's repecting power point slides and code

http://blogs.interfacett.com/dan-wahlins-blog/2006/11/12/video-aspnet-ajax-xml-and-web-services-with-a-little-virtual-earth.html

it's good stuff :)