CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.visual_web_developer_2005_express Tags:
Item Type: NewsGroup Date Entered: 6/4/2007 4:12:27 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 7 Views: 28 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
8 Items, 1 Pages 1 |< << Go >> >|
Jeevi
Asp.Net User
cannot access public variable in one page from another?6/4/2007 4:12:27 AM

0/0

hi,

   let me explain my question briefly. i've two webforms called webForm1 and webForm2.  i would like to add the following line in webForm2.aspx.vb page.

ie.  Dim myPage as New webForm1
     myPage.PublicVariable = myValue .(something like that) but it shows error that is "Type webForm1 not defined" and the intellisence also doesnt show this page. that means, i need to add these file into AppCode Directory? or i cant initialize one webform from another? Pls help me in this issue.

Any help would be greately appreciated!

 

 

Javier Luna
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 7:15:12 AM

0/0

You should have to use Session variables.
from Villa El Salvador for world!
satish_nagdev
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 7:35:38 AM

0/0

Other option apart from Session variable could be use of viewstate, cookies, QueryString and hidden fields.

but more better option which i could think of is using HttpContext, the link http://www.awprofessional.com/articles/article.asp?p=382852&seqNum=5&rl=1 is easy to understand, go through it, if you get any problem lets know.

thanks,

satish.


Kind Attn: If a reply to your post helped you, kindly mark it as Answered.
__________________________________________________
Please save Animals Help World Society For Protection Of Animals
Jeevi
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 8:12:18 AM

0/0

Thanks for ur reply.

what am i really trying to do is, from the child page trying to change the visiblity of the particular control which is in the Master Page.

is this possible? any idea?

kipo
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 8:28:53 AM

0/0

You can do it like this (in this example you will change visibility of the label "Label1" which is in master page from child page):

Label lbl1 = (Label)Master.FindControl("Label1");
lbl1.Visible = false;

Jeevi
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 8:52:07 AM

0/0

hi

i tried this before, but i've received the following error "[NullReferenceException: Object reference not set to an instance of an object.]".

here is the code i've used,

Dim myPage As myMasterPage
myPage =
New myMasterPage
Dim myPanel As New System.Web.UI.WebControls.Panel
myPanel = myPage.FindControl("LoginPanel")
myPanel.Visible = False        'error in this line

i've placed  this code under ChildPage's Load Event and i even tried placing this under "Page_Init / Page_PreInit / Page_PreLoad" events... but nothing seems to be working.        I turned on the Page Trace property. so that, i can check  whether the ctl "LoginPanel" is loading or not.

i can see this line in Page Trace - Control Tree area

ctl00$LoginPanel System.Web.UI.WebControls.Panel

what am i really missing? i've no idea.

Thanks.

kipo
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 8:59:59 AM

0/0

Try with this:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  Dim myPanel As Panel = CType(Master.FindControl("LoginPanel"), Panel)
  myPanel.Visible = False
End Sub

Jeevi
Asp.Net User
Re: cannot access public variable in one page from another?6/4/2007 9:15:54 AM

0/0

Waav! its great. Thank you so much. It really works.

Thanks again.

8 Items, 1 Pages 1 |< << Go >> >|


Free Download:

Books:
Visual Basic 2005 Programmer's Reference Authors: Rod Stephens, Pages: 1022, Published: 2005
Java: The Complete Reference Authors: Herbert Schildt, Pages: 1024, Published: 2006
A Guide to MATLAB Object-oriented Programming Authors: Andy H. Register, Pages: 354, Published: 2007
Beginning VB 2008: From Novice to Professional Authors: Christian Gross, Pages: 450, Published: 2008
Visual Basic .Net: A Laboratory Course Authors: Nell B. Dale, Michael McMillan, Pages: 269, Published: 2002
SCJP Exam for J2SE 5: A Concise and Comprehensive Study Guide for the Sun Certified Java Programmer Exam Authors: Paul Sanghera, Pages: 396, Published: 2006
Visual Basic 2005 with .NET 3.0 Programmer's Reference: Programmer's Reference Authors: Rod Stephens, Pages: 1200, Published: 2007
Access 2007 Bible Authors: Michael R. Groh, Joseph C. Stockman, Cary N. Prague, Gavin Powell, Jennifer Reardon, Michael R. Irwin, Pages: 1356, Published: 2007
The Java Tutorial: Object-oriented Programming for the Internet Authors: Mary Campione, Kathy Walrath, Pages: 831, Published: 1996
Introduction to Graphical User Interfaces with Java Swing Authors: Paul Fischer, Pages: 306, Published: 2005

Web:
php-gtk2 Cookbook by kksou - Re:passing variables from one page to ... Re:passing variables from one page to another 1 Month, 1 Week ago, Karma: 0. Hi, Checked that and Access level is Public...tested through all three and ...
Passing variables from one html page to another... - Codewalkers Passing variables from one html page to another. ... i am getting the same errors only there is so much code that i cannot figure it out! ...
how to use a variable of one method in another method - Java Forums If the variable a is local to a method, then you can not access it from another ... else return sumDoisAmig (u,b) + sumAmigosr (n,b+1); } public static int ...
Pass variables from one page to another to JS - Dev Shed Sep 26, 2008 ... Pass variables from one page to another to JS- JavaScript Development. ... What I can't figure out is how to get the price to the cart. ...
how to use the variable of one partial class into another partial ... how to use the variable of one partial class into another partial class ... You cannot access an arbitrary other Page from within a Page. ...
Controlling Access to Member Variables Objects of the same type have access to one another's private variables. ... Any class, in any package, has access to a class's public variables. ...
can we pass one session variable from one https page to another ... can we pass one session variable from one https page to another https ... I've never found a use for it but you could use it to access the ...
How to send a value stored in a variable from one page to another ... How to send a value stored in a variable from one page to another page in How to send a value stored in a variable from one page to another ...
passing variable from one swf to another swf - ActionScript.org Forums Reload this Page passing variable from one swf to another swf .... in .. hence the reason why you can't access the xml when using _parent. ...
pass variable from an applet to another one Reload this Page pass variable from an applet to another one .... How can I access public methods of first applet from second, ...

Videos:
Core Patterns for Web Permissions Google TechTalks July 19, 2006 Tyler Close Visiting Scientist Hewlett-Packard Laboratories Mr. Close is a researcher and developer, working in the...
Full Focus: Navy-Broadway Complex 6-21-06 Housing prices are falling in San Diego and The uncertainty surrounding San Diego's valuable waterfront continues. Developer Doug Manchester is chang...
Charlie Rose - Frere-Jones, Pareles, Valdes, Michael, Ivory, Fiennes, Eldrege Segment 1: The year in music with four critics: Sasha Frere-Jones of The New Yorker, Jon Pareles of The New York Times, Mimi Valdes of Vibe, and Sia...
django: Web Development for Perfectionists with Deadlines Google TechTalks April 26, 2006 Jacob Kaplan-Moss ABSTRACT Django is one of the premier web frameworks for Python, and is often compared to Ruby-on...
Affiliate Summit 2006 East -- Blogging Best Practices: Maximizing Your Success Blogging guru Dave Taylor will take you on a controversial and entertaining tour of blog technologies, explain which are considered "critical" by the...
Literate functional testing Google London Test Automation Conference (LTAC) Google Tech Talks September 7th, 2006 Presenters: Robert Chatley and Tom White
Zeitgeist 2 : Addendum - Subtitles English / French Zeitgeist: Addendum, by Peter Joseph 2008 English Subtitles ! French See ya later on thezeitgeistmovement.com You can Download Srt file here : EN:...
Robert Caret's presentation on the Metropolitan Mission Towson University president Robert Caret's presentation on the Metropolitan Mission.
Charlie Rose - David Margolick / Charles Peters / Steven Johnson Segment 1: David Margolick, author of "Beyond Glory: Joe Louis vs. Max Schmeling, and a World on the Brink". Segment 2: Charles Peters, Founder & ...
www.moldytoaster.com ow the incline would not conduct him to his goal. If he were to reach another outlet, he would find it obstructed by a plug or a grating. Every outle...




Search This Site:










backup / restore of dnn portal

sample code needed to view

is url encoding safe to use for user confirmation?

dataset questions...

system.unauthorizedaccessexception

how to protect the master page

master page error

treeview + sitemap provider + web.sitemap

user registration module

can someone please help??

3.0.12 install permissions

how to precompile pages ?

how to hide an webpart title bar

need help with new error "security exception" after dnn 2.x update

trying to send mail from password recovery

a light weight ecommerce module

another (an error was encountered. please return to the previous page and try again. )

why are these fonts so small?

why does aspx page weights so much?

using flash inside control

manage member (asp.net 2.0)

website

setting cookieless against performance issue

ftb insert image button not available

need good help documents and tutorials for dnn.

transition questions

realestate module for ibs

linking to the middle of a web form

iss and vs2005

trends in source code availability for commercial modules

 
All Times Are GMT