Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 3rd, 2008, 12:35 PM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Antilles128 Send a message via Yahoo to Antilles128
Default ManageUsers Repeater issue

I'm having a strange issue on my ManageUsers.aspx page. I've already incorporated the membership module into one of my sites, and everything works fine. Now, as I'm trying to integrate it into another site, using the same code and configuration, the two Literals for Total Users and Users online, as well as the Alphabet Repeater do not show up. I first assumed this was a web.config issue, I don't think it is now. I'm thinking now that it's a PageLoad issue, but I don't know how to go about troubleshooting it beyond what I have. Any help would be greatly appreciated.

Thanks

 
Old March 3rd, 2008, 01:04 PM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Antilles128 Send a message via Yahoo to Antilles128
Default

As it turns out, using Literals anywhere on my site do not work, so I'm totally lost now. The EditUsers.aspx page doesn't display anything in the Literals; I'm beginning to think this is a site configuration issue, but again, I don't know where to start looking.

 
Old March 3rd, 2008, 02:36 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

That is certainly weird. There is nothing "magic" about literals. They basically render text unchanged to the page wherever they appear.

Have you tried making the simplest possible page with a literal as a test? Like the following:

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Literal Test</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Literal ID="Literal1" runat="server" Text="This is a literal" />
    </form>
</body>
</html>

Try that and see what happens.

 
Old March 3rd, 2008, 03:41 PM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Antilles128 Send a message via Yahoo to Antilles128
Default

Yeah, that works; it seems, for whatever reason, to not be executing the code behind I have attached to it anywhere on the site, whether it's a literal or a label. This would presumably account for why it's not loading the rptAlphabet at the same time it would load the values for the literals.

So, to summarize: literals and labels work fine when their values are not loaded from code behind files, and I'm suspecting for some reason, the Page_Load event is being fired correctly.

PS: I'm using the VB.NET code created by MythicalMe, which, as I said, works terrific on the site I've done.

 
Old March 3rd, 2008, 06:23 PM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Antilles128 Send a message via Yahoo to Antilles128
Default

Well, it turns out that I'm just an idiot. Apparently, putting a OnLoad Override in the BasePage to load the page title automatically OVERRIDES the page_load calls on the page. Yep, getting rid of that override fixed ALL the problems I was having, and further reduced me to a fuming mess. Ah well, I'll know NEVER to do that again!

 
Old March 3rd, 2008, 06:33 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

If you need to override the OnLoad event in the BasePage, you should call the OnLoad method on the base object, so that this won't happen...

protected override void OnLoad(EventArgs e)
      {
         // do whatever you need to do here
         ...blah blah blah...

         base.OnLoad(e);
      }

 
Old March 3rd, 2008, 06:54 PM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Antilles128 Send a message via Yahoo to Antilles128
Default

How would that translate to VB.NET?

        Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
            Page.Title = "Peach Vintage & Antiques - Your online source for North Georgia Antiques and Collectibles"
        End Sub

That's the override I had in the BasePage.vb . I guess basically my question is what is base.Onload(e) doing, so I can figure out how to do it in VB XD

By the way, thanks for all your help!

 
Old March 3rd, 2008, 07:54 PM
Lee Dumond's Avatar
Wrox Author
 
Join Date: Jan 2008
Posts: 923
Thanks: 12
Thanked 166 Times in 162 Posts
Default

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
    ' do whatever you need to do here
         ...blah blah blah...

    MyBase.OnLoad(e)
End Sub

MyBase.OnLoad(e) passes the eventargs through to the page and runs its OnLoad method.

 
Old March 3rd, 2008, 11:47 PM
Authorized User
 
Join Date: Dec 2007
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Antilles128 Send a message via Yahoo to Antilles128
Default

Awesome! Just when I think I'm getting the hang of this stuff, something little like this comes around and humbles me. Thanks again for your help!







Similar Threads
Thread Thread Starter Forum Replies Last Post
mailto: in ManageUsers.aspx spardoe BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 7 August 12th, 2009 10:48 AM
ManageUsers GameGorilla BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 10 April 16th, 2008 04:17 AM
Ajax in ManageUsers mesdouri BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 July 2nd, 2007 08:21 AM
Repeater collie VB.NET 2002/2003 Basics 1 December 2nd, 2003 05:30 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.