Showing posts with label build. Show all posts
Showing posts with label build. Show all posts

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 Membership API

Hi All,

I have grown fed up with the restrictions placed on using the Login Controls provided by VWD, so I've decided to build my own controls and then call on the membership API class to insert records. I mainly did this to allow my application to use AJAX on the login features, but I have run into a problem.

Here is the code for my problem:

 
"ScriptManager1" runat="server" /> "UpdatePanel1" runat="server"> "Button1" runat="server" Text="Button" OnClick="Button1_Click" /> "LoginName1" runat="server" /> "msg" runat="server" Text="Label"> "LoginStatus1" runat="server" />

It is a simple page that has a login button, and when you click the button it runs this code:
protected void Button1_Click(object sender, EventArgs e) {if (Membership.ValidateUser("Brainify","BrainifyPassword")) { FormsAuthentication.SetAuthCookie("Brainify",true); msg.Text ="Login success!!!. Please check your user name and password and try again."; }else { msg.Text ="failed"; } } }

The code will try to validate a user (hardcoded) that I've put into the database. And if successful it will cause the msg label to change text. That works fine. But I would also like it change the the loginname control. This is all done through AJAX.

The problem is when I click on the button once, it validates and it changes the msg label to what I want. How the login name control never appears. I actually have to click on the button ONE more time to get the login name control to display the username! I have NO Idea what is going on...it appears AJAX is working, but I don't know why I have to click the button twice for everything to appear.

Any help would be greatly appreciated.Hi,

This is because the LoginName is determined by the current request's?user identity. When you click the button to login, the request?still doesn't contain a valid UserName.
The value can only be retrieved in the requests after this. So that an additional click is required.

You can use?Sys.Services.AuthenticationService to authenticate on the client before a postback happens.
Like this:

<"Button1" runat="server" Text="Button"?OnClientClick="javascript function that invokes Sys.Services.AuthenticationService" OnClick="Button1_Click" /
Hope this helps.

Wednesday, March 21, 2012

Ajax and Embedded Linux

Hi,

I want to build an AJAX application that will run both on Windows XP/Vista using IE and FireFox and on Linux Embedded machines using Mozilla.

Are you familiar with such a solution?

Thanks,

Janiv Ratson.

Microsoft Ajax 1.0 supports both IE and Firefox.