Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Accessing members of a user control from the aspx page.

Reply
Thread Tools

Accessing members of a user control from the aspx page.

 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-29-2004
do you have this compiling. i swear mine compiled a while ago. now it will
not compile at this line
control.txtFirstName.Text = "This won't work";

rightfully stating that txtFirstName.Text is inaccessible.



check again to see if it compiles. if it does, zip the bare bones and send
it to me

http://www.velocityreviews.com/forums/(E-Mail Removed)

i have a fix for it but it might be moot if it doesn't compile correctly
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"David A. Coursey" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Ok, here you go.
>
> aspx page:
>
> <%@ Register TagPrefix="s2f" TagName="control" src="control.ascx" %>
> <%@ Page language="c#" Codebehind="main.aspx.cs" AutoEventWireup="false"
> Inherits="TESTbug.main" %>
> <html>
> <head>
> <title>test</title>
> </head>
> <body>
> <form id=mainForm method=post runat="server">
> <s2f:control id="control" runat="server"></s2f:control>
> </form>
> </body>
> </html>
>
>
> ascx page
>
>
> <%@ Control Language="c#" AutoEventWireup="false"
> Codebehind="control.ascx.cs" Inherits="TESTbug.Controls.control"
> TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
> <asp:textbox id="txtFirstName" runat="server"></asp:textbox>
>
>
> "Alvin Bruney [MVP]" wrote:
>
>> post the html please
>>
>> --
>> Regards,
>> Alvin Bruney
>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>> Got tidbits? Get it here... http://tinyurl.com/27cok
>> "Dave" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> >> post a small sample which demonstrates the problem i will take a look
>> >> use this as a guide http://www.yoda.arachsys.com/csharp/complete.html
>> >
>> >
>> > Ok, I read your document and this is as short and sweet as I could get
>> > it.
>> > It requires an .aspx page and an .ascx web user control. I'm leaving
>> > off
>> > the
>> > html for the aspx and ascx pages because all you need to do is drop a
>> > textbox
>> > on the control and drop the control on the page. At this point I
>> > think I
>> > just have something fundamentally wrong, but I would like to find out
>> > why
>> > this isn't "allowed".
>> >
>> >
>> > .aspx code behind page
>> >
>> >
>> > using System;
>> > using TESTbug.Controls;
>> >
>> > namespace TESTbug
>> > {
>> > /// <summary>
>> > /// Summary description for cma.
>> > /// </summary>
>> > public class main : System.Web.UI.Page
>> > {
>> > protected Microsoft.Web.UI.WebControls.TabStrip tabStrip;
>> > protected Microsoft.Web.UI.WebControls.MultiPage multiPage;
>> >
>> > private void Page_Load(object sender, System.EventArgs e)
>> > {
>> > control.txtFirstName.Text = "This won't work";
>> > }
>> >
>> >
>> > #region Web Form Designer generated code
>> > //left out for clarity, nothing has been
>> > altered
>> > #endregion
>> >
>> > }
>> > }
>> >
>> >
>> >
>> >
>> > ascx page code behind
>> >
>> > namespace TESTbug.Controls
>> > {
>> > using System;
>> >
>> > /// <summary>
>> > /// Summary description for customer.
>> > /// </summary>
>> > public class control : System.Web.UI.UserControl
>> > {
>> > public static System.Web.UI.WebControls.TextBox txtFirstName;
>> >
>> > private void Page_Load(object sender, System.EventArgs e)
>> > {
>> > //nothing
>> > }
>> >
>> > #region Web Form Designer generated code
>> > //left out for clarity, nothing has been
>> > altered
>> > #endregion
>> > }
>> > }
>> >
>> >
>> >
>> > Thank you for your help
>> > dave

>>
>>
>>



 
Reply With Quote
 
 
 
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-30-2004
you've made the textbox a static instance. controls cannot be static because
it interfers with the viewstate mechanism. instead you should store the data
in a static variable. consider a get/set method to move the data in the
textbox into a static reference


--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:u%(E-Mail Removed)...
> do you have this compiling. i swear mine compiled a while ago. now it will
> not compile at this line
> control.txtFirstName.Text = "This won't work";
>
> rightfully stating that txtFirstName.Text is inaccessible.
>
>
>
> check again to see if it compiles. if it does, zip the bare bones and send
> it to me
>
> (E-Mail Removed)
>
> i have a fix for it but it might be moot if it doesn't compile correctly
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "David A. Coursey" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> Ok, here you go.
>>
>> aspx page:
>>
>> <%@ Register TagPrefix="s2f" TagName="control" src="control.ascx" %>
>> <%@ Page language="c#" Codebehind="main.aspx.cs" AutoEventWireup="false"
>> Inherits="TESTbug.main" %>
>> <html>
>> <head>
>> <title>test</title>
>> </head>
>> <body>
>> <form id=mainForm method=post runat="server">
>> <s2f:control id="control" runat="server"></s2f:control>
>> </form>
>> </body>
>> </html>
>>
>>
>> ascx page
>>
>>
>> <%@ Control Language="c#" AutoEventWireup="false"
>> Codebehind="control.ascx.cs" Inherits="TESTbug.Controls.control"
>> TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
>> <asp:textbox id="txtFirstName" runat="server"></asp:textbox>
>>
>>
>> "Alvin Bruney [MVP]" wrote:
>>
>>> post the html please
>>>
>>> --
>>> Regards,
>>> Alvin Bruney
>>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>>> Got tidbits? Get it here... http://tinyurl.com/27cok
>>> "Dave" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>> >> post a small sample which demonstrates the problem i will take a look
>>> >> use this as a guide http://www.yoda.arachsys.com/csharp/complete.html
>>> >
>>> >
>>> > Ok, I read your document and this is as short and sweet as I could get
>>> > it.
>>> > It requires an .aspx page and an .ascx web user control. I'm leaving
>>> > off
>>> > the
>>> > html for the aspx and ascx pages because all you need to do is drop a
>>> > textbox
>>> > on the control and drop the control on the page. At this point I
>>> > think I
>>> > just have something fundamentally wrong, but I would like to find out
>>> > why
>>> > this isn't "allowed".
>>> >
>>> >
>>> > .aspx code behind page
>>> >
>>> >
>>> > using System;
>>> > using TESTbug.Controls;
>>> >
>>> > namespace TESTbug
>>> > {
>>> > /// <summary>
>>> > /// Summary description for cma.
>>> > /// </summary>
>>> > public class main : System.Web.UI.Page
>>> > {
>>> > protected Microsoft.Web.UI.WebControls.TabStrip tabStrip;
>>> > protected Microsoft.Web.UI.WebControls.MultiPage multiPage;
>>> >
>>> > private void Page_Load(object sender, System.EventArgs e)
>>> > {
>>> > control.txtFirstName.Text = "This won't work";
>>> > }
>>> >
>>> >
>>> > #region Web Form Designer generated code
>>> > //left out for clarity, nothing has
>>> > been
>>> > altered
>>> > #endregion
>>> >
>>> > }
>>> > }
>>> >
>>> >
>>> >
>>> >
>>> > ascx page code behind
>>> >
>>> > namespace TESTbug.Controls
>>> > {
>>> > using System;
>>> >
>>> > /// <summary>
>>> > /// Summary description for customer.
>>> > /// </summary>
>>> > public class control : System.Web.UI.UserControl
>>> > {
>>> > public static System.Web.UI.WebControls.TextBox txtFirstName;
>>> >
>>> > private void Page_Load(object sender, System.EventArgs e)
>>> > {
>>> > //nothing
>>> > }
>>> >
>>> > #region Web Form Designer generated code
>>> > //left out for clarity, nothing has
>>> > been
>>> > altered
>>> > #endregion
>>> > }
>>> > }
>>> >
>>> >
>>> >
>>> > Thank you for your help
>>> > dave
>>>
>>>
>>>

>
>



 
Reply With Quote
 
 
 
 
David A. Coursey
Guest
Posts: n/a
 
      09-30-2004
Ok, that clears that up, but now the other question is why do I get an error
when using the get/set method? It compiles fine, but when it runs it throws
an error because it can't find the item that is being set/get.
Try this code in place of the other:

www.3doverdose.com/dl/CMAstripped02.zip

"Alvin Bruney [MVP]" wrote:

> you've made the textbox a static instance. controls cannot be static because
> it interfers with the viewstate mechanism. instead you should store the data
> in a static variable. consider a get/set method to move the data in the
> textbox into a static reference


 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-30-2004
i believe you are running into a caching problem notorius with user
controls. try closing the project restarting iis and re-opening the
solution. see if that helps

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"David A. Coursey" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> Ok, that clears that up, but now the other question is why do I get an
> error
> when using the get/set method? It compiles fine, but when it runs it
> throws
> an error because it can't find the item that is being set/get.
> Try this code in place of the other:
>
> www.3doverdose.com/dl/CMAstripped02.zip
>
> "Alvin Bruney [MVP]" wrote:
>
>> you've made the textbox a static instance. controls cannot be static
>> because
>> it interfers with the viewstate mechanism. instead you should store the
>> data
>> in a static variable. consider a get/set method to move the data in the
>> textbox into a static reference

>



 
Reply With Quote
 
David A. Coursey
Guest
Posts: n/a
 
      09-30-2004
No dice... I can even reboot and it will still have the same results.
Could this be a bad install possibly?

"Alvin Bruney [MVP]" wrote:

> i believe you are running into a caching problem notorius with user
> controls. try closing the project restarting iis and re-opening the
> solution. see if that helps
>
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "David A. Coursey" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
> > Ok, that clears that up, but now the other question is why do I get an
> > error
> > when using the get/set method? It compiles fine, but when it runs it
> > throws
> > an error because it can't find the item that is being set/get.
> > Try this code in place of the other:
> >
> > www.3doverdose.com/dl/CMAstripped02.zip
> >
> > "Alvin Bruney [MVP]" wrote:
> >
> >> you've made the textbox a static instance. controls cannot be static
> >> because
> >> it interfers with the viewstate mechanism. instead you should store the
> >> data
> >> in a static variable. consider a get/set method to move the data in the
> >> textbox into a static reference

> >

>
>
>

 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-30-2004
> No dice... I can even reboot and it will still have the same results.
> Could this be a bad install possibly?


no, because i am getting as well.

i'll take a closer look in a while (mildly busy at the moment).

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"David A. Coursey" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
> No dice... I can even reboot and it will still have the same results.
> Could this be a bad install possibly?
>
> "Alvin Bruney [MVP]" wrote:
>
>> i believe you are running into a caching problem notorius with user
>> controls. try closing the project restarting iis and re-opening the
>> solution. see if that helps
>>
>> --
>> Regards,
>> Alvin Bruney
>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>> Got tidbits? Get it here... http://tinyurl.com/27cok
>> "David A. Coursey" <(E-Mail Removed)> wrote in
>> message news:(E-Mail Removed)...
>> > Ok, that clears that up, but now the other question is why do I get an
>> > error
>> > when using the get/set method? It compiles fine, but when it runs it
>> > throws
>> > an error because it can't find the item that is being set/get.
>> > Try this code in place of the other:
>> >
>> > www.3doverdose.com/dl/CMAstripped02.zip
>> >
>> > "Alvin Bruney [MVP]" wrote:
>> >
>> >> you've made the textbox a static instance. controls cannot be static
>> >> because
>> >> it interfers with the viewstate mechanism. instead you should store
>> >> the
>> >> data
>> >> in a static variable. consider a get/set method to move the data in
>> >> the
>> >> textbox into a static reference
>> >

>>
>>
>>



 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      09-30-2004
I'm stopping just short of calling this behavior a bug.

I need to do a couple days research on this because clearly i don't
understand what is going on.

From what i gather so far,the main page fires its page load events, next the
usercontrols load event fires. at this point strangely, the textbox declared
on the page is a null reference. so attempting to assign variables at the
point will bomb.

i had success with moving the assignment to the page unload event. but even
there, the expected behavior is somewhat quirky; it will bomb the first
time, but work as intended for every subsequent run. I understand the
usercontrols are self contained and the design should reflect this but it
doesn't explain why this is happening.

i feel like a deer stuck in the headlights tehehehe. it will probably be a
week or so before i have something definitive on this.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
>> No dice... I can even reboot and it will still have the same results.
>> Could this be a bad install possibly?

>
> no, because i am getting as well.
>
> i'll take a closer look in a while (mildly busy at the moment).
>
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "David A. Coursey" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> No dice... I can even reboot and it will still have the same results.
>> Could this be a bad install possibly?
>>
>> "Alvin Bruney [MVP]" wrote:
>>
>>> i believe you are running into a caching problem notorius with user
>>> controls. try closing the project restarting iis and re-opening the
>>> solution. see if that helps
>>>
>>> --
>>> Regards,
>>> Alvin Bruney
>>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>>> Got tidbits? Get it here... http://tinyurl.com/27cok
>>> "David A. Coursey" <(E-Mail Removed)> wrote in
>>> message news:(E-Mail Removed)...
>>> > Ok, that clears that up, but now the other question is why do I get an
>>> > error
>>> > when using the get/set method? It compiles fine, but when it runs it
>>> > throws
>>> > an error because it can't find the item that is being set/get.
>>> > Try this code in place of the other:
>>> >
>>> > www.3doverdose.com/dl/CMAstripped02.zip
>>> >
>>> > "Alvin Bruney [MVP]" wrote:
>>> >
>>> >> you've made the textbox a static instance. controls cannot be static
>>> >> because
>>> >> it interfers with the viewstate mechanism. instead you should store
>>> >> the
>>> >> data
>>> >> in a static variable. consider a get/set method to move the data in
>>> >> the
>>> >> textbox into a static reference
>>> >
>>>
>>>
>>>

>
>



 
Reply With Quote
 
David A. Coursey
Guest
Posts: n/a
 
      10-01-2004
Thank you very much for even taking the time to look into this. I am very
interested in what your results may be because I was very confused as well.
For now I will redesign the pages without user controls (which will make one
gi-normus aspx page) and keep moving forward on the project.

Again, thank you for your help
David A. Coursey


"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
> I'm stopping just short of calling this behavior a bug.
>
> I need to do a couple days research on this because clearly i don't
> understand what is going on.
>
> From what i gather so far,the main page fires its page load events, next
> the usercontrols load event fires. at this point strangely, the textbox
> declared on the page is a null reference. so attempting to assign
> variables at the point will bomb.
>
> i had success with moving the assignment to the page unload event. but
> even there, the expected behavior is somewhat quirky; it will bomb the
> first time, but work as intended for every subsequent run. I understand
> the usercontrols are self contained and the design should reflect this but
> it doesn't explain why this is happening.
>
> i feel like a deer stuck in the headlights tehehehe. it will probably be a
> week or so before i have something definitive on this.
>
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> news:(E-Mail Removed)...
>>> No dice... I can even reboot and it will still have the same results.
>>> Could this be a bad install possibly?

>>
>> no, because i am getting as well.
>>
>> i'll take a closer look in a while (mildly busy at the moment).
>>
>> --
>> Regards,
>> Alvin Bruney
>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>> Got tidbits? Get it here... http://tinyurl.com/27cok
>> "David A. Coursey" <(E-Mail Removed)> wrote in
>> message news:(E-Mail Removed)...
>>> No dice... I can even reboot and it will still have the same results.
>>> Could this be a bad install possibly?
>>>
>>> "Alvin Bruney [MVP]" wrote:
>>>
>>>> i believe you are running into a caching problem notorius with user
>>>> controls. try closing the project restarting iis and re-opening the
>>>> solution. see if that helps
>>>>
>>>> --
>>>> Regards,
>>>> Alvin Bruney
>>>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>>>> Got tidbits? Get it here... http://tinyurl.com/27cok
>>>> "David A. Coursey" <(E-Mail Removed)> wrote in
>>>> message news:(E-Mail Removed)...
>>>> > Ok, that clears that up, but now the other question is why do I get
>>>> > an
>>>> > error
>>>> > when using the get/set method? It compiles fine, but when it runs it
>>>> > throws
>>>> > an error because it can't find the item that is being set/get.
>>>> > Try this code in place of the other:
>>>> >
>>>> > www.3doverdose.com/dl/CMAstripped02.zip
>>>> >
>>>> > "Alvin Bruney [MVP]" wrote:
>>>> >
>>>> >> you've made the textbox a static instance. controls cannot be static
>>>> >> because
>>>> >> it interfers with the viewstate mechanism. instead you should store
>>>> >> the
>>>> >> data
>>>> >> in a static variable. consider a get/set method to move the data in
>>>> >> the
>>>> >> textbox into a static reference
>>>> >
>>>>
>>>>
>>>>

>>
>>

>
>



 
Reply With Quote
 
Alvin Bruney [MVP]
Guest
Posts: n/a
 
      11-02-2004
oooops,
did you figure this out? This message was lost in my pending box for a
couple weeks

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:(E-Mail Removed)...
>> No dice... I can even reboot and it will still have the same results.
>> Could this be a bad install possibly?

>
> no, because i am getting as well.
>
> i'll take a closer look in a while (mildly busy at the moment).
>
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "David A. Coursey" <(E-Mail Removed)> wrote in
> message news:(E-Mail Removed)...
>> No dice... I can even reboot and it will still have the same results.
>> Could this be a bad install possibly?
>>
>> "Alvin Bruney [MVP]" wrote:
>>
>>> i believe you are running into a caching problem notorius with user
>>> controls. try closing the project restarting iis and re-opening the
>>> solution. see if that helps
>>>
>>> --
>>> Regards,
>>> Alvin Bruney
>>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
>>> Got tidbits? Get it here... http://tinyurl.com/27cok
>>> "David A. Coursey" <(E-Mail Removed)> wrote in
>>> message news:(E-Mail Removed)...
>>> > Ok, that clears that up, but now the other question is why do I get an
>>> > error
>>> > when using the get/set method? It compiles fine, but when it runs it
>>> > throws
>>> > an error because it can't find the item that is being set/get.
>>> > Try this code in place of the other:
>>> >
>>> > www.3doverdose.com/dl/CMAstripped02.zip
>>> >
>>> > "Alvin Bruney [MVP]" wrote:
>>> >
>>> >> you've made the textbox a static instance. controls cannot be static
>>> >> because
>>> >> it interfers with the viewstate mechanism. instead you should store
>>> >> the
>>> >> data
>>> >> in a static variable. consider a get/set method to move the data in
>>> >> the
>>> >> textbox into a static reference
>>> >
>>>
>>>
>>>

>
>



 
Reply With Quote
 
David A. Coursey
Guest
Posts: n/a
 
      01-14-2005
I just came back to look at this post again.

No I never did get it to work. I ended up ditching the user controls and
having the code all on one aspx page. This is really a bad way to work
because I am unable to switch to design view, the code gets horribly hacked
if I do.

dave

"Alvin Bruney [MVP]" wrote:

> oooops,
> did you figure this out? This message was lost in my pending box for a
> couple weeks
>
> --
> Regards,
> Alvin Bruney
> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> Got tidbits? Get it here... http://tinyurl.com/27cok
> "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
> news:(E-Mail Removed)...
> >> No dice... I can even reboot and it will still have the same results.
> >> Could this be a bad install possibly?

> >
> > no, because i am getting as well.
> >
> > i'll take a closer look in a while (mildly busy at the moment).
> >
> > --
> > Regards,
> > Alvin Bruney
> > [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> > Got tidbits? Get it here... http://tinyurl.com/27cok
> > "David A. Coursey" <(E-Mail Removed)> wrote in
> > message news:(E-Mail Removed)...
> >> No dice... I can even reboot and it will still have the same results.
> >> Could this be a bad install possibly?
> >>
> >> "Alvin Bruney [MVP]" wrote:
> >>
> >>> i believe you are running into a caching problem notorius with user
> >>> controls. try closing the project restarting iis and re-opening the
> >>> solution. see if that helps
> >>>
> >>> --
> >>> Regards,
> >>> Alvin Bruney
> >>> [ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
> >>> Got tidbits? Get it here... http://tinyurl.com/27cok
> >>> "David A. Coursey" <(E-Mail Removed)> wrote in
> >>> message news:(E-Mail Removed)...
> >>> > Ok, that clears that up, but now the other question is why do I get an
> >>> > error
> >>> > when using the get/set method? It compiles fine, but when it runs it
> >>> > throws
> >>> > an error because it can't find the item that is being set/get.
> >>> > Try this code in place of the other:
> >>> >
> >>> > www.3doverdose.com/dl/CMAstripped02.zip
> >>> >
> >>> > "Alvin Bruney [MVP]" wrote:
> >>> >
> >>> >> you've made the textbox a static instance. controls cannot be static
> >>> >> because
> >>> >> it interfers with the viewstate mechanism. instead you should store
> >>> >> the
> >>> >> data
> >>> >> in a static variable. consider a get/set method to move the data in
> >>> >> the
> >>> >> textbox into a static reference
> >>> >
> >>>
> >>>
> >>>

> >
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing USER CONTROL which is inside Masterpagethrough Another USER Control inside normal page. Kiran More ASP .Net Web Controls 2 11-14-2006 12:58 PM
Accessing Web User Control Values From ASPX Code Behind Jason ASP .Net Web Controls 0 10-06-2005 07:19 PM
dynamic user control textbox is empty when accessing from aspx pag randman ASP .Net Web Controls 3 07-26-2005 05:56 PM
RE: Accessing Parent Page Members from a User Control Steven Cheng[MSFT] ASP .Net 3 04-08-2004 08:09 AM
accessing control's members from aspx code. Marko Rangel ASP .Net Web Controls 2 08-22-2003 04:10 PM



Advertisments