Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > User control not visible when setting .Visible = true;

Reply
Thread Tools

User control not visible when setting .Visible = true;

 
 
Andrea Williams
Guest
Posts: n/a
 
      01-26-2004
I'm working with c#, my code is below. The page starts out showing just a
dropdown and a button. When the dropdown is selected and the button is
pressed, it's supposed to show the user controls, however, even though the
code sets it to be visible again, it's still not visible. I have run
through the code with the debugger and the code is being executed, but
nothing shows up on the page. Any ideas?

Thanks,
Andrea

protected CIS.controls.ucFrmSubmission UcFrmSubmission1;

protected CIS.controls.ucFrmAuthors ucFrmAuthors1;

private void InitializeComponent()

{

m_strNumOfAuthors = Request.Form.Get("selNumOfAuthors");

if (m_strNumOfAuthors == null)

{

UcFrmSubmission1.Visible = false;

ucFrmAuthors1.Visible = false;

}

else

{

UcFrmSubmission1.Visible = true;

ucFrmAuthors1.Visible = true;

}

}


 
Reply With Quote
 
 
 
 
CMA
Guest
Posts: n/a
 
      01-27-2004
can u put the code into Page_Load() event and see... dont put codes in
initialize section...

CMA



"Andrea Williams" <(E-Mail Removed)> wrote in message
news:%23zzp%(E-Mail Removed)...
> I'm working with c#, my code is below. The page starts out showing just a
> dropdown and a button. When the dropdown is selected and the button is
> pressed, it's supposed to show the user controls, however, even though the
> code sets it to be visible again, it's still not visible. I have run
> through the code with the debugger and the code is being executed, but
> nothing shows up on the page. Any ideas?
>
> Thanks,
> Andrea
>
> protected CIS.controls.ucFrmSubmission UcFrmSubmission1;
>
> protected CIS.controls.ucFrmAuthors ucFrmAuthors1;
>
> private void InitializeComponent()
>
> {
>
> m_strNumOfAuthors = Request.Form.Get("selNumOfAuthors");
>
> if (m_strNumOfAuthors == null)
>
> {
>
> UcFrmSubmission1.Visible = false;
>
> ucFrmAuthors1.Visible = false;
>
> }
>
> else
>
> {
>
> UcFrmSubmission1.Visible = true;
>
> ucFrmAuthors1.Visible = true;
>
> }
>
> }
>
>



 
Reply With Quote
 
 
 
 
Andrea Williams
Guest
Posts: n/a
 
      01-27-2004
I've tried putting the code in the Page_Load event, but nothing owrked when
the code was there. Things don't hide or appear.

Andrea


"CMA" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> can u put the code into Page_Load() event and see... dont put codes in
> initialize section...
>
> CMA
>
>
>
> "Andrea Williams" <(E-Mail Removed)> wrote in message
> news:%23zzp%(E-Mail Removed)...
> > I'm working with c#, my code is below. The page starts out showing just

a
> > dropdown and a button. When the dropdown is selected and the button is
> > pressed, it's supposed to show the user controls, however, even though

the
> > code sets it to be visible again, it's still not visible. I have run
> > through the code with the debugger and the code is being executed, but
> > nothing shows up on the page. Any ideas?
> >
> > Thanks,
> > Andrea
> >
> > protected CIS.controls.ucFrmSubmission UcFrmSubmission1;
> >
> > protected CIS.controls.ucFrmAuthors ucFrmAuthors1;
> >
> > private void InitializeComponent()
> >
> > {
> >
> > m_strNumOfAuthors = Request.Form.Get("selNumOfAuthors");
> >
> > if (m_strNumOfAuthors == null)
> >
> > {
> >
> > UcFrmSubmission1.Visible = false;
> >
> > ucFrmAuthors1.Visible = false;
> >
> > }
> >
> > else
> >
> > {
> >
> > UcFrmSubmission1.Visible = true;
> >
> > ucFrmAuthors1.Visible = true;
> >
> > }
> >
> > }
> >
> >

>
>



 
Reply With Quote
 
Andrea Williams
Guest
Posts: n/a
 
      01-28-2004
The .Visible Property isn't working on the Div tags either. Same Problem
with the Visible property, except, see the code below. I start out with two
of the div tages visible and a third not. Then on postback and the number
of authors is not null, I want to make the first two invisible and the thrid
one visible. But on postback, none of them are visible.

I also have tried using a Label instead of the DIV tag, but it doesn't work
properly either.

This is weird... I just made a change, then refreshed the already posted
page, and the div tag showed up. Then I went 'back' in the browser to
before the post back and refreshed, then submitted the form again, and the
div tag was missing again.... Am I having som sort of server caching
problem?

Andrea

m_strNumOfAuthors = Request.Form["selNumOfAuthors"];

if (m_strNumOfAuthors == null)

{

divFormInstructions1.Visible = true;

divNumOfAuthors.Visible = true;

divFormInstructions2.Visible = false;

}

else

{

divFormInstructions1.Visible = false;

divNumOfAuthors.Visible = false;

divFormInstructions2.Visible = true;

}

"Andrea Williams" <(E-Mail Removed)> wrote in message
news:%23zzp%(E-Mail Removed)...
> I'm working with c#, my code is below. The page starts out showing just a
> dropdown and a button. When the dropdown is selected and the button is
> pressed, it's supposed to show the user controls, however, even though the
> code sets it to be visible again, it's still not visible. I have run
> through the code with the debugger and the code is being executed, but
> nothing shows up on the page. Any ideas?
>
> Thanks,
> Andrea
>
> protected CIS.controls.ucFrmSubmission UcFrmSubmission1;
>
> protected CIS.controls.ucFrmAuthors ucFrmAuthors1;
>
> private void InitializeComponent()
>
> {
>
> m_strNumOfAuthors = Request.Form.Get("selNumOfAuthors");
>
> if (m_strNumOfAuthors == null)
>
> {
>
> UcFrmSubmission1.Visible = false;
>
> ucFrmAuthors1.Visible = false;
>
> }
>
> else
>
> {
>
> UcFrmSubmission1.Visible = true;
>
> ucFrmAuthors1.Visible = true;
>
> }
>
> }
>
>



 
Reply With Quote
 
Andrea Williams
Guest
Posts: n/a
 
      01-28-2004
I found the problem.... Somehow the InitializeComponent function wwas
changed and it caused the issues that I was seeing. It probably happened
when I was doing a copy paste and VS.NET went wacky. I seem to be getting a
bug that messes up the Copy Paste functionality in VS.NET 2003 quite
frequently.. The only thing to fix the problem is to close VS and
re-open... I haven't been able to pin point why it goes into this funk
though...

Andrea


"Andrea Williams" <(E-Mail Removed)> wrote in message
news:%23zzp%(E-Mail Removed)...
> I'm working with c#, my code is below. The page starts out showing just a
> dropdown and a button. When the dropdown is selected and the button is
> pressed, it's supposed to show the user controls, however, even though the
> code sets it to be visible again, it's still not visible. I have run
> through the code with the debugger and the code is being executed, but
> nothing shows up on the page. Any ideas?
>
> Thanks,
> Andrea
>
> protected CIS.controls.ucFrmSubmission UcFrmSubmission1;
>
> protected CIS.controls.ucFrmAuthors ucFrmAuthors1;
>
> private void InitializeComponent()
>
> {
>
> m_strNumOfAuthors = Request.Form.Get("selNumOfAuthors");
>
> if (m_strNumOfAuthors == null)
>
> {
>
> UcFrmSubmission1.Visible = false;
>
> ucFrmAuthors1.Visible = false;
>
> }
>
> else
>
> {
>
> UcFrmSubmission1.Visible = true;
>
> ucFrmAuthors1.Visible = true;
>
> }
>
> }
>
>



 
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
Input button visible when not visible tshad ASP .Net 1 10-31-2009 10:53 PM
Hide textbox / Make textbox not visible (NOT USING visible property) Jurjen de Groot ASP .Net Web Controls 0 05-19-2008 09:50 AM
How to make a hyperlink Visible or not visible in DataList Patrick Olurotimi Ige ASP .Net 7 06-15-2005 12:01 PM
Sections visible and not visible tshad ASP .Net 4 01-31-2005 09:30 PM
button visible/not visible tshad ASP .Net 6 10-28-2004 10:02 PM



Advertisments