Click here to Skip to main content
15,867,568 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: From address problem in Sending Mail Pin
K V Sekhar10-Mar-10 23:36
K V Sekhar10-Mar-10 23:36 
GeneralRe: From address problem in Sending Mail Pin
Abhijit Jana10-Mar-10 23:48
professionalAbhijit Jana10-Mar-10 23:48 
GeneralRe: From address problem in Sending Mail Pin
K V Sekhar11-Mar-10 0:28
K V Sekhar11-Mar-10 0:28 
QuestionOPENOFFICE TOOL PROBLEM Pin
srinivaskalagara10-Mar-10 17:21
srinivaskalagara10-Mar-10 17:21 
QuestionHosting an asp web site Pin
coding freaks10-Mar-10 16:36
coding freaks10-Mar-10 16:36 
AnswerRe: Hosting an asp web site Pin
Not Active10-Mar-10 16:41
mentorNot Active10-Mar-10 16:41 
GeneralRe: Hosting an asp web site Pin
coding freaks10-Mar-10 17:49
coding freaks10-Mar-10 17:49 
QuestionWhere is the difference between inheriting inline and code-behind Pin
Gregory Gadow10-Mar-10 10:48
Gregory Gadow10-Mar-10 10:48 
Two test pages.

Test 1: Test1.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Test1.aspx.vb" Inherits="Test1" %>

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

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <p>Test 1 - With codebehind.</p>
   
    <p><asp:Literal runat="server" ID="Output" /></p>
    </div>
    </form>
</body>
</html>
Test1.aspx.vb
VB
Partial Class Test1
    Inherits MyCompany.Web.BasePage

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        Output.Text = MyUser.UserName
    End Sub
End Class


----------------------

Test 2: Test2.aspx
<%@ Page Language="VB" Inherits="MyCompany.Web.BasePage" %>

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

<script runat="server">

    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs)
        Output.Text = MyUser.UserName
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <p>Test 2 - With inline.</p>
   
    <p><asp:Literal runat="server" ID="Output" /></p>
    </div>
    </form>
</body>
</html>


----------------------

Both pages inherit from a custom class, MyCompany.Web.BasePage, which itself is based on System.Web.UI.Page. The property MyUser is defined in BasePage and contains data about the user accessing the page.

Both pages work just fine when accessed. The difference is when editing the pages: with Test1, MyUser shows up in IntelliSense, I can access the object's properties and everything works exactly as I would expect. With Test2, the use of MyUser is flagged as a "not declared" error, and IntelliSense does not detect any properties on the object.

What is so frustrating is that on my previous development machine, Test2 worked as desired in the IDE. It is only now, after my primary machine had to be replaced (damned hard drive) that this problem has cropped up. Replacing inline code with codebehind is not feasable, as there are hundreds of pages that would have to be rewritten, not to mention overhead from doubling the number of files.

I have no idea why the two different coding styles should suddenly be acting differently. Is there an option checkbox that needs to be marked? Please, help me out!
AnswerRe: Where is the difference between inheriting inline and code-behind Pin
Not Active10-Mar-10 15:13
mentorNot Active10-Mar-10 15:13 
AnswerRe: Where is the difference between inheriting inline and code-behind Pin
Pranay Rana10-Mar-10 19:03
professionalPranay Rana10-Mar-10 19:03 
QuestionHow to get handle to webpart in WebPartZone? Pin
mittalpa10-Mar-10 10:38
mittalpa10-Mar-10 10:38 
AnswerRe: How to get handle to webpart in WebPartZone? Pin
Not Active10-Mar-10 15:11
mentorNot Active10-Mar-10 15:11 
QuestionHow can I display an image onclick after displaying all images in a folder Pin
soshdf10-Mar-10 10:37
soshdf10-Mar-10 10:37 
QuestionProblem saving Panel Scroll Position on Post Back Pin
AndyASPVB10-Mar-10 9:46
AndyASPVB10-Mar-10 9:46 
AnswerRe: Problem saving Panel Scroll Position on Post Back Pin
RCoate10-Mar-10 13:49
RCoate10-Mar-10 13:49 
GeneralRe: Problem saving Panel Scroll Position on Post Back Pin
AndyASPVB10-Mar-10 21:41
AndyASPVB10-Mar-10 21:41 
Questiondisabling an list item not working in Firefox Pin
KittyKit10-Mar-10 9:40
KittyKit10-Mar-10 9:40 
Questionmy new website Pin
tunsten10-Mar-10 9:35
tunsten10-Mar-10 9:35 
AnswerRe: my new website Pin
Not Active10-Mar-10 15:09
mentorNot Active10-Mar-10 15:09 
AnswerRe: my new website Pin
Pranay Rana10-Mar-10 19:25
professionalPranay Rana10-Mar-10 19:25 
GeneralRe: my new website Pin
tunsten10-Mar-10 21:02
tunsten10-Mar-10 21:02 
QuestionHome screen design for a website Pin
Member 335536610-Mar-10 9:25
Member 335536610-Mar-10 9:25 
AnswerRe: Home screen design for a website Pin
KittyKit10-Mar-10 21:47
KittyKit10-Mar-10 21:47 
Questionpage load Pin
AndyInUK10-Mar-10 7:06
AndyInUK10-Mar-10 7:06 
AnswerRe: page load Pin
Abhijit Jana10-Mar-10 7:17
professionalAbhijit Jana10-Mar-10 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.