Cannot create instance in a partial class
-
(in visual studio 2008, website project) I cant create instance of a partial class in a another partial class, why ???? Please look at below; test.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> test.aspx.vb Partial Class test Inherits System.Web.UI.Page End Class profile.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="profile.aspx.vb" Inherits="profile" %> profile.aspx.vb Partial Class profile Inherits System.Web.UI.Page ' doesnt work Dim _test as new test End Class i couldnt understand what is the problem ?? thanks...
thanks for everything i have...
-
(in visual studio 2008, website project) I cant create instance of a partial class in a another partial class, why ???? Please look at below; test.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="test" %> test.aspx.vb Partial Class test Inherits System.Web.UI.Page End Class profile.aspx <%@ Page Language="VB" AutoEventWireup="false" CodeFile="profile.aspx.vb" Inherits="profile" %> profile.aspx.vb Partial Class profile Inherits System.Web.UI.Page ' doesnt work Dim _test as new test End Class i couldnt understand what is the problem ?? thanks...
thanks for everything i have...
-
Your question is a bit vague. Nothing happens? A (compile-time||run-time) error is thrown? What were your expectations from :
TALHAKOSEN wrote:
Dim _test as new test
I'm really curious.
:) i mean when i wrote Dim _test as new ... i cant reach my test class.
thanks for everything i have...
-
:) i mean when i wrote Dim _test as new ... i cant reach my test class.
thanks for everything i have...
-
That's not an answer Is this a website/web application?? FYI Partial classes are just a VS construct, a class is class.
yes, it is website application, i create it with this way in vs2008 file --> new web site
thanks for everything i have...
-
yes, it is website application, i create it with this way in vs2008 file --> new web site
thanks for everything i have...
-
Please reread my first answer and reply to my question : What did you expect to happen? What were your intentions?
Estys, Thanks for your attention and sorry for my poor english , i couldnt explain what i wanna say excatly. Ok, i try to explain it clearly at this time, I gave a simple sample to tell my problem before, but now i wanna give you my real project's page example. so I want to take a values of a textbox.text or name of a button which are in another page. TariheGore.aspx Imports System Imports System.Globalization Imports System.Threading Imports System.Data.SqlClient Imports System.Data Imports System.Drawing Imports System.Drawing.Color Imports System.Drawing.Font Partial Class TariheGore Inherits System.Web.UI.Page Public fp1 As TariheGoreDuzelt ' there are problem it says "type TariheGoreDuzelt is not defined" Public fp2 As TariheGoreGiris ' there are problem it says "type TariheGoreGiris is not defined" Protected WithEvents Form2 As System.Web.UI.HtmlControls.HtmlForm Public ReadOnly Property GetBtnName() As String ' i will use this in TariheGoreGiris.aspx Get Return ButtonName End Get End Property TariheGoreGiris.aspx Imports System.Data.SqlClient Imports System.Data Imports System Imports System.Globalization Imports System.Threading Partial Class TariheGoreGiris Inherits System.Web.UI.Page Public fpTariheGore As TariheGore Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents CikBtn As System.Web.UI.HtmlControls.HtmlButton Dim utl As New Utils . . . Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Thread.CurrentThread.CurrentCulture = New CultureInfo("tr-TR") if Not IsPostBack Then Try fpTariheGore = CType(Context.Handler, TariheGore) BtnName = fpTariheGore.GetBtnName i hope i could explain my problem :(
thanks for everything i have...
-
Estys, Thanks for your attention and sorry for my poor english , i couldnt explain what i wanna say excatly. Ok, i try to explain it clearly at this time, I gave a simple sample to tell my problem before, but now i wanna give you my real project's page example. so I want to take a values of a textbox.text or name of a button which are in another page. TariheGore.aspx Imports System Imports System.Globalization Imports System.Threading Imports System.Data.SqlClient Imports System.Data Imports System.Drawing Imports System.Drawing.Color Imports System.Drawing.Font Partial Class TariheGore Inherits System.Web.UI.Page Public fp1 As TariheGoreDuzelt ' there are problem it says "type TariheGoreDuzelt is not defined" Public fp2 As TariheGoreGiris ' there are problem it says "type TariheGoreGiris is not defined" Protected WithEvents Form2 As System.Web.UI.HtmlControls.HtmlForm Public ReadOnly Property GetBtnName() As String ' i will use this in TariheGoreGiris.aspx Get Return ButtonName End Get End Property TariheGoreGiris.aspx Imports System.Data.SqlClient Imports System.Data Imports System Imports System.Globalization Imports System.Threading Partial Class TariheGoreGiris Inherits System.Web.UI.Page Public fpTariheGore As TariheGore Protected WithEvents Form1 As System.Web.UI.HtmlControls.HtmlForm Protected WithEvents CikBtn As System.Web.UI.HtmlControls.HtmlButton Dim utl As New Utils . . . Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Thread.CurrentThread.CurrentCulture = New CultureInfo("tr-TR") if Not IsPostBack Then Try fpTariheGore = CType(Context.Handler, TariheGore) BtnName = fpTariheGore.GetBtnName i hope i could explain my problem :(
thanks for everything i have...
-
You are treating your website like a windows form app. Can't be done. I think you should read up on ASP.NET. Have you seen this : Creating ASP.NET Web Sites In your case the lifecycle of the Page-object is something you must know by heart.
Thanks fot giving your time,Estys...
thanks for everything i have...
-
Thanks fot giving your time,Estys...
thanks for everything i have...
-
:-O I was a bit hasty in saying it can't be done, always using sessionstate and querystrings. I found this Don't know exactly how
Context
behaves, but you need to do aServer.Transfer
to make it function Merry Christmas an a Happy New YearYeah i solved my problem with usin session, you are right )) Merry Christmas an a Happy New Year to you , too
thanks for everything i have...