Showing posts with label placed. Show all posts
Showing posts with label placed. Show all posts

Wednesday, March 28, 2012

AJAX Calander Behind other Controls

Hi All,

I am using the Ajax Calander Control, I have it working in all and I have it writing to a textbox. I have this placed on a form where there are dropdown lists. It seems that the Cal. control always appears behind these dropdownlists instead of infront, therefore making it not visible.

Any work arounds?
Thanks in advance!!!
Tim

Hi tbraga,

I do not notice this behavior and I use VS.NET 2005 sp1 / Ajax Extentions 1 / AjaxControlToolkit 10920.

Can you post code that replicates this behavior?

Kind regards,
wim


Hi Tbraga,

As far as I know, this is a common issue. We suggest that you should upgrade your AJAX Control Toolkit to the latest version. If this doesn't work, you can set its zIndex properties. For example, $find("CalendarExtender's BehaviorID")._popupDiv.zIndex = large enough number.

function pageLoad(){
$find("CalendarExtender's BehaviorID").add_shown(resetZIndex);
}

function resetZIndex(){

$find("CalendarExtender's BehaviorID")._popupDiv.zIndex = value.

}

I hope this help.

Best regards,

Jonathan

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.