CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums

ASP.NET Web Hosting
3 Months Free and Free Setup - ASP.NET Web Hosting



Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > microsoft_downloads.css_friendly_control_adapters Tags:
Item Type: NewsGroup Date Entered: 11/9/2006 8:52:36 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 19 Views: 114 Favorited: 0 Favorite
20 Items, 1 Pages 1 |< << Go >> >|
brendan_rice
Asp.Net User
LoginView Login Link Bug11/9/2006 8:52:36 PM

0/0

I think I have found a bug in the LoginView Adapter.  My site uses a LoginView with a LoginButtonType="Link".  When I try to log in the page does not post back.  This is because a false value is being passed to the clientSubmit parameter of the WebForm_PostBackOptions javascript function:

function WebForm_PostBackOptions(eventTarget, eventArgument, validation, validationGroup, actionUrl, trackFocus, clientSubmit) {
      this.eventTarget = eventTarget;
      this.eventArgument = eventArgument;
      this.validation = validation;
      this.validationGroup = validationGroup;
      this.actionUrl = actionUrl;
      this.trackFocus = trackFocus;
      this.clientSubmit = clientSubmit;
}

This looks as though it is set like that for the default LoginButtonType="Button" as this does not require postback as the submit button submits itself. Here is the rendered HTML for the control in button and link mode:

Button
<div class="AspNet-Login-SubmitPanel">
 <input type="submit" value="Log In" class="loginButton" id="ctl00_ContentPlaceHolder1_Login1_LoginButton" name="ctl00$ContentPlaceHolder1$Login1$LoginButton" onclick="WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$Login1$LoginButton&quot;, &quot;&quot;, true, &quot;ctl00$ContentPlaceHolder1$Login1&quot;, &quot;&quot;, false, false))" />
</div>

Link
<div class="AspNet-Login-SubmitPanel">
 <a class="loginButton" id="ctl00_ContentPlaceHolder1_Login1_LoginLinkButton" name="ctl00$ContentPlaceHolder1$Login1$LoginLinkButton" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$Login1$LoginLinkButton&quot;, &quot;&quot;, true, &quot;ctl00$ContentPlaceHolder1$Login1&quot;, &quot;&quot;, false, false))">Log In</a>
</div>

 Now here is the link rendered without the adapters (which works):

Link
<tr>
     <td align="right" colspan="2"><a id="ctl00_ContentPlaceHolder1_Login1_LoginLinkButton" class="loginButton" href="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$Login1$LoginLinkButton&quot;, &quot;&quot;, true, &quot;ctl00$ContentPlaceHolder1$Login1&quot;, &quot;&quot;, false, true))">Log In</a></td>
</tr>

 

Can you spot the difference.  Unfortunatly I am on a tight deadline so cannot afford to spend any more time on this tonight but any fix would be welcome.

 Thanks

Brendan

Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug11/10/2006 4:16:32 AM

0/0

Hi Brendan,

Thanks for finding this problem.  It does, indeed, appear to be a bug.  I'll fix it in the next rev of the kit.

Meanwhile, you (and anyone else using beta 3 of the kit) can fix it locally quite easily.  Look in the adpater code in App_Code\Adapters.  You'll find several adapters that instantiate the PostBackOptions class.

C#
PostBackOptions options = new PostBackOptions(btn, "", "", false, false, false, false, true, changePwd.UniqueID);

VB
Dim options As PostBackOptions = New PostBackOptions(btn, "", "", False, False, False, False, True, changePwd.UniqueID)

Where you find lines like these, you need to change the highlighted parameter from false (False) to true (True).  It is directly responsible for the true/false that you observed in the client-side creation of the WebForm_PostBackOptions object in JavaScript.

I've tested this here but I'd appreciate it if you could reply here to confirm whether or not this fix works for you. Thanks.

Best regards,


Russ Helfand
Groovybits.com
brendan_rice
Asp.Net User
Re: LoginView Login Link Bug11/10/2006 6:12:28 PM

0/0

You quick fix worked Big Smile

 Everything looks good but when I hit enter when focus is on one of the text boxes no posback happens this is probably by design but it would be nice if a postback happened.

 Can you magic this for me please? Or give me pointers to magic it for myself?

 

Thanks

 Brendan

Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug11/10/2006 7:09:59 PM

0/0

Hmmmmm... talk about pressing your luck... Ha ha.

OK, I'll give it a go.  Try setting the 4th parameter to true when you construct your PostBackOptions object (see code above). I'm not sure that I want to put that change into the kit, though.  It seems like you could end up trying to submit the page before it is filled out because lots of users inadvertantly hit ENTER rather than TAB.  Though, maybe you disagree with that.  Thoughts?


Russ Helfand
Groovybits.com
brendan_rice
Asp.Net User
Re: LoginView Login Link Bug11/10/2006 9:45:43 PM

0/0

Completely from a usability point of view I think it is a must.  I am developing an application and the two users I tested it on both thought they could not log in as they are that used to being on login forms that when you press enter in the password field you get logged in.  To be honest it even threw me for a few seconds and I must admit I was kinda peaved that I had to click on the login button for it to work. 

That said I do get your point about the tab but if this functionality only lies on the password field they should be ready to login anyway.

What you think?

 

 

Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug11/10/2006 9:59:43 PM

0/0

OK, I can respect that. It's great info, direct from the trenches, so to speak.

Let's turn this around and put you in the hot seat.  I could do the autopostback on just the password field... but then we need to decide how to handle this on the other membership controls.  Do we need to do the autopostback on the last textbox in each of these forms?

Or, do we simply make autopostback true for all textboxes in all forms rendered by the membership control adapters?

Thougts? You're talkin' to the guy who writes the code so you and I can decide right now how to change it for the next rev.  Other readers are, of course, also welcome to chip in on this thread.


Russ Helfand
Groovybits.com
brendan_rice
Asp.Net User
Re: LoginView Login Link Bug11/11/2006 12:33:07 PM

0/0

Hi Russ,

thanks for getting back to me.  I cannot comment on the other controls as I have not really looked at them much, all I can do is pass on my experience and my clients opinions of the login control.  A lot of sites these days have you logging in when the enter key is pressed in the password field.  Just look at Microsoft and hotmail.

 I think it would be a good feature as to be honest it is confusing if you can autopostback when the button is present but not when the link is there.  It sends out mixed messages.  I know the underlying reasons that it is like it is but it could always be better.

 Any thoughts?

 Brendan

Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug11/12/2006 3:46:31 PM

0/0

That's fair, Brendan.  Thanks for engaging in this discussion. I'll definitely add the autopostback for at least the password.  I'll look over the other controls on this and other form-producing adapters in the kit... and I'll use my best judgement, for now, to decide which (or if all) should have autopostback.  Look for improvements in the next rev.

Best regards,


Russ Helfand
Groovybits.com
brendan_rice
Asp.Net User
Re: LoginView Login Link Bug11/12/2006 3:56:19 PM

0/0

Hey Russ thanks for listening I appreciate that my comments have been heard and are actually gonna be used to improve the adapters, it is nice to know you are listening.

 I will be using the adapters a lot more in the future and will leave feedback whenever I can.

 

Thanks again

Brendan

pnmcosta
Asp.Net User
Re: LoginView Login Link Bug12/5/2006 1:42:05 PM

0/0

Hya,

I'm having problems with this, I'm using buttons and now they submit twice, i've the latest version... All of them are true, and all submit buttons are being submitted twice... I've tested both options on the login button and realized that image and buttons don't need clientSubmit but link does, i've just put a verification on the type of button...

Regards,

Pedro 

brendan_rice
Asp.Net User
Re: LoginView Login Link Bug12/5/2006 1:46:49 PM

0/0

I would not use links for the submit button as it completely stops working in FireFox.  It seems FireFox does not support links submitting a page via javascript. So in the login control when FireFox user visits your login page they will not be able to log in.
pnmcosta
Asp.Net User
Re: LoginView Login Link Bug12/5/2006 1:54:52 PM

0/0

I'm actually using buttons, and for some reason all postbacks from login controls are coming back twice, e.g. when one finishes it is raised again. I've changed the code so that if it is a link it will set clientsubmit true and image or button false, but still having problems with the ChangePassword button... This is really frustrating!..
Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug12/18/2006 10:33:25 PM

0/0

Is this still a problem?  Can someone post markup/code that would allow me to reproduce the problem here?
Russ Helfand
Groovybits.com
m_judd
Asp.Net User
Re: LoginView Login Link Bug2/8/2007 11:04:14 AM

0/0

Hi,

I downloaded the source this week (5th Feb) and I'm having the double submit problem as well. To try and validate whether it was the adapters causing the problem I built and ran the tutorial and saw the same problem in there.

If you build the tutorial, stick a breakpoint in the Page_Init() method then run the project, when you use the Login example and log in, you will see that Page_Init() is called twice after you click the Login button. The IsPostBack property of the page is true each time.

As a quick fix similar to the one you mentioned in this thread, I changed a line in LoginAdapter.cs (252) from:

PostBackOptions options = new PostBackOptions(btn, "", "", false, false, false, true, true, login.UniqueID);  

to:

PostBackOptions options = new PostBackOptions(btn, "", "", false, false, false, false, true, login.UniqueID);

 (i.e. changed the clientSubmit parameter to false).

This produces an 'onclick' event for the login submit button which matches the one produced by the vanilla Login control (i.e. without the adapters).

This is obviously a different fix to the one you mention for the case when the LoginButtonType is a link - maybe the PostBackOptions specified need to be conditional on the value of LoginButtonType??

Thanks. 

Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug2/10/2007 12:41:27 AM

0/0

Hi M_Judd, I'm very interested in looking into your issue (noted in this thread on 2-8-2007 at 3:04am). Unfortunately, I can't seem to duplicate the problem. Please help me understand what I've done incorrectly.

As you suggested, I did a fresh installation of the CSS Friendly adapter kit.  Using VWD I created a new C# web site based on the full (tutorial) template from the kit. In the code behind file for the Login example (i.e., in membership\login.aspx.cs) I put a breakpoint in the Page_Init method. I fired up the Login.aspx sample page in the debugger and saw that my breakpoint was hit once. I filled in the username (fred) and password (css!) and pressed the Login button in the form.  That cause my breakpoint in Page_Init to be hit... but just once. I'm not seeing the redundant call to Page_Init that you mentioned.

I'm using Windows Vista (RTM) Business Edition and Visual Web Developer Express SP1. I running using the built-in web server (Cassini).

Any ideas what you and I are doing differently? It looks like you, too, are using the C# version so I don't think the problem is due to differences with C# and VB.  I wonder what else might be going on.

If we can figure out how I can repro the problem I can look at possible fixes. And, even more importantly, I can consider fixing this in a future rev of the kit. However, I can't fix things that I can't verify as being broken... as I'm sure you can appreciate!

Sorry about being dense about this. Please try to be patient and help me figure out what I'm missing. THANKS.


Russ Helfand
Groovybits.com
m_judd
Asp.Net User
Re: LoginView Login Link Bug2/11/2007 8:53:04 PM

0/0

Hi Russ,

How weird! I just performed the same steps and I still get the Page_Init() called twice on post-back from the login form.

My system details:

OS: Windows XP Tablet PC Edition, with SP 2
Dev Env: Visual Studio 2005 Professional
.Net Framework: version 2.0.50727
Browser: IE 7 (version 7.0.5730.11)

I performed the following steps:

1.) Downloaded the VSI for the CSS Adapters and installed it (choosing to overwrite the existing files downloaded on 5th Feb 2007).
2.) Opened Visual Studio 2005 and selected File->New->Web Site...
3.) Selected ?Tutorial on ASP.NET CSS Friendly...' and chose C# as the language.
4.) Clicked OK and the webite was created.
5.) Added a breakpoint to ?\Membership\Login.aspx.cs' in the Page_Init() method.
6.) Pressed F5 to run the web site. I was prompted to enable debugging in web.config which I accepted. The web site was running in the ASP.Net Development Server.
7.) The site loaded the Login.aspx page and my breakpoint was hit. I pressed F5 to continue.
8.) I completed the login form using ?fred' and ?css!' then clicked the Login button.
9.) The breakpoint I set in Page_Init() was hit twice. Each time the IsPostBack property was ?true'.
10.) I could log out and log in as many times as I liked and the breakpoint was hit twice each time.

I hope this helps you reproduce this issue. If I can provide any more info, please let me know.

Thanks,

Martin

Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug2/13/2007 4:46:53 AM

0/0

Hi Martin,

I hate to admit it but... I just tried the recipe and now I see the redundant call to Page_Init, too. I must have been sniffing glue before, or something. Now that I've repro'ed it I can do a better job of figuring out how to fix it. I suspect that we will need to do some sort of "if" check to see what kind of button is being built and set the true/false value (of the parameter we've been discussing) accordingly. I can certainly try to fix this in a future rev of the kit. Thanks for pointing out the problem and being patient with me as I bumble along here.


Russ Helfand
Groovybits.com
Erik4271
Asp.Net User
Re: LoginView Login Link Bug4/2/2007 3:43:58 PM

0/0

Russ,

When you check the type of button being created, do you mean the variable btn that is assigned the results of "findcontrol" prior to creating the new postbackoptions? I am testing btn to see if it is a "LinkButton" in which case I create postbackoptions with a client submit of true, otherwise I always give it a client submit of false. Does this sound correct to you?

Thank you,

Erik

 

kenpo
Asp.Net User
Re: LoginView Login Link Bug6/19/2007 4:28:12 PM

0/0

Russ,

I wanted to see if any headway has been made on fixing this bug. I have the latest release and it is still present.

The standard login control produces a false as the last param, the adapter control produces a true.

Standard Control = WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$rightcontent$lgnPortal$LoginButton&quot;, &quot;&quot;, true, &quot;ctl00$rightcontent$lgnPortal&quot;, &quot;&quot;, false, false))
CSSFriendly control = WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$rightcontent$lgnPortal$LoginButton&quot;, &quot;&quot;, true, &quot;ctl00$rightcontent$lgnPortal&quot;, &quot;&quot;, false, true))

This creates double events on all events after submit, not just the Page_Init. In our case, we extend the login to see if it is a users first login and force a password change. In the OnLoggedIn event handler, we check the bit to see if it is a first log in. If it is we redirect to a new page and reset the bit in the DB to false.

When we added the adapter, this functionality stopped working. The redirect is ignored and the bit is set to false, the second even comes in and the bit is now set to false and the user is passed in as authorized without being forced to change their password.

Anyone extending the basic functionality based on events is going to have problems with this bug. It is not the easiest one to track down either, I Googled it before giving up and debugging the issue myself. After that I noticed this entry on the forum, but the time had already been spent.

I know it is easy enough to update this in code ourselves, but if we want to grab the lates versions of controls as they are released it is something that has to be checked each time or a bug will get introduced. In my opinion, this is not a great solution to fixing the problem.

Thanks,

Randy Jones  

 


Randy (Kenpo) Jones
Russ Helfand
Asp.Net User
Re: LoginView Login Link Bug7/4/2007 4:58:12 PM

0/0

Hi Randy, sorry about the long delay in answer your question. Yeah, this bug is a real bummer for folks who happen to run into it. I appreciate that it's hard to track down.

I think the problem you found is the same as what is being discussed in http://forums.asp.net/p/1100637/1676119.aspx#1676119. If so, it has been addressed in the latest version of the adapters being maintained by the community at CodePlex, http://www.codeplex.com/cssfriendly/WorkItem/View.aspx?WorkItemId=234.

Microsoft isn't maintaining or enhancing these adapters now; the community is. This transition was announced in the forum posting that is "pinned" in the box of special forum postings when you visit this forum's landing page, http://forums.asp.net/1018.aspx. The specific posting I'm talking about is http://forums.asp.net/t/1083997.aspx.

Please write back if you want to discuss this more. Again, I wish this bug hadn't made it's way past all of the testing that preceded the release of v1.0 of the adapters. At this point, fixing such problems in CodePlex is the sanctioned way to deal with such issues when they are discovered.


Russ Helfand
Groovybits.com
20 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
ASP.NET 2.0 Website Programming: Problem-design-solution Authors: Marco Bellinaso, Pages: 576, Published: 2006
Visual Web Developer 2005 Express Edition For Dummies Authors: Alan Simpson, Pages: 358, Published: 2005
ASP.NET 2.0 Instant Results Authors: Imar Spaanjaars, Paul Wilton, Shawn Livermore, Pages: 456, Published: 2006
Learning ASP.NET 3.5 Authors: Jesse Liberty, Dan Hurwitz, Brian MacDonald, Pages: 576, Published: 2008

Web:
LoginView Login Link Bug - ASP.NET Forums I think I have found a bug in the LoginView Adapter. My site uses a LoginView with a LoginButtonType="Link". When I try to log in the page ...
2nd LoginView loses LoggedIn Status when Member clicks non-member ... Login.aspx"> for Anonymous pages, I can click those links and they work ONCE. ... I chose the 2nd LoginView control to solve my problem of ...
Microsoft Expression Expression Web LoginView not showing ... LoginView not showing databound controls. ... i.e. without the link to the reserved page. Is there any setting that I am missing, or is it a bug in EW? ...
LoginView Control, asp:LoginView Control How to use LoginView control in asp.net? Working with LoginView control in ASP. NET. ... Login into DotNetFunda.com, Close Window ...
I have a problem with refreshing login membership page on the ... Now I see you complete login code. I think there is a mixed up with asp .net form loginView with ajax authentication service. If you want to use a client ...
LoginStatus control not rendered - ng.asp-net-forum.security - Fix ... LoginView Login Link Bug - microsoft_downloads ... Here is the rendered HTML for the control in button and link mode: Button ... the login control when ...
eZ Issue Tracker: Issue #012518: Problem with LastPostVars for ... ... is redirected to the user/login view for login, but after successful login he should ... #255718 by Piotrek Karaś on February 8th, 2008 [Permanent Link] ...
TheMSsForum.com >> Asp >> VS2008 Design view doesn't like ... I want to add the following text in a FormView for adding links .... To reproduce the problem simply place a LoginView control on a master ...
WinForms Closing problem - .NET C# LoginView login = new LoginView(); login.ShowDialog(this); // Do somethin to check if login ... You can read about DialogResult on this link ...
phpBB Academy at StarTrekGuide • OpenID passwordless login - View ... The .htaccess code that you sent me was the missing link I needed. .... It can be used only to log in with OpenID, and doesn't provide such ...












vertical align

is css control adapters compatible with webpart and webpartzone controls?

adding menu css classe

atlas and gridview css control adapter doesn't work together

.browser file is not read anymore (iis broke?)

web.config - adding css friendly adapters to existing website

asp menu shows over text in ie 7

turn of css adapter for selected controls

problems with css adapters - tables are generated for login control

detailsview bound to gridview selectedindex behaving differently when using css adapters and selectedindex = -1

introduction to this forum

css height

problem centering menu control using adpaters

ie 6 problem - search results are pushed down in the content area

problem with formviewadapter

detailsview adapter css to allow multiline name spans

use cssadapters in library

how do not apply adapter to derived controls or call original render method?

menu control - how to display 2nd level menu items horizontaly ?

css friendly control adapters is not running with update panel of atlas

adding controls to existing site

problem with sitemap content

cleint-side support

treeview cssadapter theme does not work with function log out anymore

ok,i'm trying to replicate the enhanced horizontal menu example

stylesheet question

loginstatus - always says login

css menu adapter and ie6

staticdisplaylevels is very important

selected | alternate row deon't work: fix

  Privacy | Contact Us
All Times Are GMT