Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP.NET Navigation and Validation quesitons

Posted on 2012-03-31
1
Medium Priority
?
181 Views
Last Modified: 2012-04-03
Two things I am trying to figure out.

Question 1.
A site map comes from the master page.  The site map is displayed in a tree view.  How can I disable the tree view until there are no more pages errors.

Question 2.
Both the current and prior page use  MasterPageFile="~/Site.Master"
And
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"

Page 1 has a control named TextBox1.

Why does this PageLoad() code never find control TextBox1?
{
   ContentPlaceHolder cp = ((ContentPlaceHolder)PreviousPage.Master.FindControl("ContentPlaceHolder1"));
           string fname = ((TextBox)cp.FindControl("TextBox1")).Text;
           valuesFromPriorPage.Text = fname;
}


Thanks
0
Comment
Question by:wilfordrocks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
madgino earned 2000 total points
ID: 37795457
Q1: It's not clear what are you trying to achieve, but I'll try a response:
 - change in code visible =false for tree and change it back when the page is free of errors or
- add  Page_Error event in page and hide the tree if there is any error
http://msdn.microsoft.com/en-us/library/ed577840.aspx
- use try/catch for the code that raises error and manage tree visibility in catch code

Q2: You are probably searching the wrong container:
- try to find control recursive
http://sharpertutorials.com/recursive-findcontrol/
- check if indeed you need to search PreviousPage or directly the Master of the current page:
 ContentPlaceHolder cp = ((ContentPlaceHolder)Master.FindControl("ContentPlaceHolder1"));
0

Featured Post

A new era in Cloud training has arrived.

A day that will go down in Cloud history.. But are you ready for it? Will you accept this Cloud challenge?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question