Expression > Forums Home > Expression Studio Forums > Expression Web and SuperPreview > LoginView not showing databound controls

Answered LoginView not showing databound controls

  • Wednesday, March 19, 2008 7:33 PM
     
     
    Hi,
    I created a page with a formview linked to a database.
    Because I dont want all the information of a record to be displayed to all users, I put some fields inside a LoginView, available only for users with a specific role.
    When the page is open by "Anonymous" users, the fields in the loginView are not showed. So far so good! When a user with the required role logs in, he can see the fields the first time the page is open, but after an edit command to modify data, going back to the formView the fields in the loginView disappear! You can still see the fields labels, but not the fields themselves with data.

    I had a similar problem once when I tryed to put an hyperlink in a loginView to jump on a reserved page. Only the first time the page was open, could I use the hyperlink. After any operation on the formview data (Ex. edit, insert, ...) coming back to the page, the hyperlink was "transformed" in a simple label, i.e. without the link to the reserved page.

    Is there any setting that I am missing, or is it a bug in EW? Has EW2 the same problem?


Answers

  • Monday, March 24, 2008 7:46 PM
     
     Answered
    The normal cause of the databound control not displaying is that there was no data available to render the control.

    Mike - FrontPage MVP '97 - '02
    Expression Tools & Addin
    http://www.j-moves.com
    http://www.panemanager.com
    FrontPage Tools & Addin
    http://www.jbots.com
    E-Commerce
    http://www.candypress.com

    Archet said:

    Hi,
    I created a page with a formview linked to a database.
    Because I dont want all the information of a record to be displayed to all users, I put some fields inside a LoginView, available only for users with a specific role.
    When the page is open by "Anonymous" users, the fields in the loginView are not showed. So far so good! When a user with the required role logs in, he can see the fields the first time the page is open, but after an edit command to modify data, going back to the formView the fields in the loginView disappear! You can still see the fields labels, but not the fields themselves with data.

    I had a similar problem once when I tryed to put an hyperlink in a loginView to jump on a reserved page. Only the first time the page was open, could I use the hyperlink. After any operation on the formview data (Ex. edit, insert, ...) coming back to the page, the hyperlink was "transformed" in a simple label, i.e. without the link to the reserved page.

    Is there any setting that I am missing, or is it a bug in EW? Has EW2 the same problem?




All Replies

  • Monday, March 24, 2008 7:46 PM
     
     Answered
    The normal cause of the databound control not displaying is that there was no data available to render the control.

    Mike - FrontPage MVP '97 - '02
    Expression Tools & Addin
    http://www.j-moves.com
    http://www.panemanager.com
    FrontPage Tools & Addin
    http://www.jbots.com
    E-Commerce
    http://www.candypress.com

    Archet said:

    Hi,
    I created a page with a formview linked to a database.
    Because I dont want all the information of a record to be displayed to all users, I put some fields inside a LoginView, available only for users with a specific role.
    When the page is open by "Anonymous" users, the fields in the loginView are not showed. So far so good! When a user with the required role logs in, he can see the fields the first time the page is open, but after an edit command to modify data, going back to the formView the fields in the loginView disappear! You can still see the fields labels, but not the fields themselves with data.

    I had a similar problem once when I tryed to put an hyperlink in a loginView to jump on a reserved page. Only the first time the page was open, could I use the hyperlink. After any operation on the formview data (Ex. edit, insert, ...) coming back to the page, the hyperlink was "transformed" in a simple label, i.e. without the link to the reserved page.

    Is there any setting that I am missing, or is it a bug in EW? Has EW2 the same problem?




  • Tuesday, March 25, 2008 4:19 PM
     
     

    Unfortunately that is not my case. The fields do have data to display, and they are displayed if I take them out of the loginview.

    As I say in the first message, this also happens with Hyperlinks used to jump to another page using a databound value for the NavigateUrl property (Example: Bind("ID_Docente","~/Secretaria/presencas_professor.aspx?CodigoDocente={0}")).
    The first time the page is loaded, this hyperlink works fine but if, for instance, I use the edit command to modify data in the formview and then go back (update or cancel) to the page, the hyperlink is no more an "Hyperlink", i.e. it looses its databound value of the NavigateUrl property.

    So definitely what happens is that any control in a loginview, bound to data, looses the binding after any operation of edit, delete or insert on the formview containing the loginview.

    Regards

  • Tuesday, November 17, 2009 3:38 PM
     
     
    Have you found any solution for this?
  • Tuesday, November 17, 2009 3:54 PM
     
     
    This is a question that would be best asked in the asp.net forum, http://forums.asp.net/
  • Tuesday, November 17, 2009 4:42 PM
     
     
    I'm not entirely clear on what you are trying to do (do you mean gridview when you say loginview?), but it sounds like you need a databind() when an edit is done.

    The ideal tool for doing this is Visual Web Developer Express (it's free)

    I am currently traveling and dont have access to Expression / VWD at the moment, but what you would do is open your web using VWD, then double-click on the updating link, which would take you the the VB code, and set you up at the point where you would enter your code, which would look something like

    yourgridview.databind() 
    ClarkNK, A.K.A. HomePage Doctor
    HomePageDoctor.com -- Expression Web database tutorials
    Ownertrades.com -- Created with FP, Access, Bots and Wizards
    MyNumbersTracker.com -- Created with Expression, VWDExress, SQL Express, and ASP.NET.
  • Wednesday, November 18, 2009 2:47 AM
     
     
    I'm sure he means to say LoginView. Also, according to the code he's posted, he's talking about declarative data binding. However, I agree that there's not enough information here to fully understand what's going on.

    Jim Cheshire
    Jimco Software and Books
    jimcosoftware.com
    jimcobooks.com

    Author of:
    Microsoft Expression Web 3 In Depth and many other books on Web design, ASP.NET, and the Amazon Kindle.