Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Progrematically change css id propertyProgrematically change css id property
Previous
 
Next
New Post
3/20/2008 4:34 AM
 

Hi,

I put up a container that holds the login module and uses in its title a java script to change the content pane  css attribute "visibility: hidden" to "visibility: visible" when the user clicks on it (The content pane is not shown before the click).

Here is the relevant code:

onmousedown="document.getElementById('contnetPane').style.visibility='visible'; document.getElementById(' contnetPane ').style.height='240px';" onmouseclick="document.getElementById(' contnetPane ').style.visibility='visible';document.getElementById('contnetPane ').style.height='22px';" >LOGIN</a>

 

 

My problem is that if the user failed to login and the page is refreshed in order to show the message of failed login, the module is again hidden and the user is not aware of the failure.

I want to put some conditional code in the ascx skin code that will change the attribute visibility of the element ' contnetPane' to 'visible' in that case.

I saw that the UserLoginStatus.loginFailure is indicating a login failure and may be it can do the trick but I do not see how to use it in the ascx skin.

 

Here is what I have so far in the skin:

(This code works and writes the string I put there but I do not know how to replace the code in the response to something that will change the attribute 'visibility' of the element ' contnetPane' to 'visible')

<script runat="server">

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

If Page.IsPostBack Then

Dim MyloginStatus As New DotNetNuke.Security.Membership.UserLoginStatus()

            'Check the Login Status

            Select Case MyloginStatus

                Case MyloginStatus.LOGIN_USERNOTAPPROVED

                                Response.Write("MyloginStatus.LOGIN_USERNOTAPPROVED")

                Case MyloginStatus.LOGIN_USERLOCKEDOUT

                                Response.Write("MyloginStatus.LOGIN_USERLOCKEDOUT")

                Case MyloginStatus.LOGIN_FAILURE

                                Response.Write("MyloginStatus.LOGIN_FAILURE<br>")

                Case Else

                                Response.Write("Something")

 

            End Select

 end if

End Sub

</script>

 

Any help will be appreciated.

Yehuda


Yehuda Tiram
AtarimTR
AtarimTR
972-2-5700114   |   972-54-4525492   |    http://www.atarimtr.co.il
 
New Post
3/21/2008 4:28 AM
 

You mean how to get the value of a server side VisualBasic variable to a client side JavaScript variable? Basically this is done with
     var JavaScriptVariable = <%= VisualBasicVariable %>
inside a JavaScript block of an .ascx file.

In your case, without touching much of your code, you could do in your VB page load handler something like
     DIM ContentPaneVisibility
     Select Case MyloginStatus
          Case MyloginStatus.LOGIN_USERNOTAPPROVED   ContentPaneVisibility = "Visible"
          Case MyloginStatus.LOGIN_USERLOCKEDOUT     ContentPaneVisibility = "Hidden"

And in your JavaScript code:
     document.getElementById('contnetPane').style.visibility='<%= ContentPaneVisibility %>'

 
New Post
3/31/2008 5:35 PM
 

Hi Michael,

Sorry I did not respond earlier, I did not get the mail notice from the forum.

Thank you for this solution, it looks very reasonable, I'll try it and post the results here.

Thanks,

Yehuda.


Yehuda Tiram
AtarimTR
AtarimTR
972-2-5700114   |   972-54-4525492   |    http://www.atarimtr.co.il
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Progrematically change css id propertyProgrematically change css id property


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out