Click here to Skip to main content
15,925,042 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: ASP Error on local site : Expected Error ';' Pin
John-ph3-Sep-07 21:35
John-ph3-Sep-07 21:35 
GeneralRe: ASP Error on local site : Expected Error ';' Pin
bryan paling3-Sep-07 21:45
bryan paling3-Sep-07 21:45 
AnswerRe: ASP Error on local site : Expected Error ';' Pin
Fred_Smith3-Sep-07 23:15
Fred_Smith3-Sep-07 23:15 
GeneralRe: ASP Error on local site : Expected Error ';' Pin
bryan paling3-Sep-07 23:23
bryan paling3-Sep-07 23:23 
GeneralRe: ASP Error on local site : Expected Error ';' Pin
Fred_Smith3-Sep-07 23:28
Fred_Smith3-Sep-07 23:28 
QuestionChanging the properties of control used in Web User Control from Web Form Pin
Dhyanga3-Sep-07 20:39
Dhyanga3-Sep-07 20:39 
AnswerRe: Changing the properties of control used in Web User Control from Web Form Pin
Sandeep Akhare3-Sep-07 20:54
Sandeep Akhare3-Sep-07 20:54 
AnswerRe: Changing the properties of control used in Web User Control from Web Form Pin
/randz3-Sep-07 20:59
/randz3-Sep-07 20:59 
If I understand your question correctly, the answer is yes, you can implement that in a single webusercontrol. On your webusercontrol (the one that contains button1 and button2), you need to provide a public property to get/set the Visible property of the buttons. For example to have a publicly-accessible Visible property of button1, you may provide this code in your webusercontrol's codebehind:
C#
<br />
public bool ButtonOneVisible<br />
{<br />
  get{return button1.Visible;}<br />
  set{button1.Visible = value;}<br />
}<br />

You can provide similar approach for button2.

Now, on Form1's codebehind, you only need to set the value of this property to true/false depending on your need. For example, on the codebehind of Form1.aspx:

C#
<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
    if (!IsPostBack)<br />
    {<br />
        WebUserControl1.ButtonOneVisible = true;<br />
        WebUserControl1.ButtonTwoVisible = false;<br />
    }<br />
}




[http://www.theunix.info/sheijin]
Remember, your work is not yours alone. Somewhere, there are some codes written by others amongst us that depends on your work. By failing to see that you are part of their ecosystem, you are bound to break their code.

GeneralRe: Changing the properties of control used in Web User Control from Web Form Pin
mani_iips3-Sep-07 23:07
mani_iips3-Sep-07 23:07 
GeneralRe: Changing the properties of control used in Web User Control from Web Form Pin
/randz3-Sep-07 23:24
/randz3-Sep-07 23:24 
QuestionDatalist inside datalist Pin
IamAmit3-Sep-07 20:33
IamAmit3-Sep-07 20:33 
AnswerRe: Datalist inside datalist Pin
rahul.net113-Sep-07 21:10
rahul.net113-Sep-07 21:10 
GeneralRe: Datalist inside datalist Pin
IamAmit3-Sep-07 21:19
IamAmit3-Sep-07 21:19 
GeneralRe: Datalist inside datalist Pin
rahul.net113-Sep-07 22:29
rahul.net113-Sep-07 22:29 
Questiontool tip for each items in combobox(HTML Control) Pin
Member 38798813-Sep-07 20:17
Member 38798813-Sep-07 20:17 
AnswerRe: tool tip for each items in combobox(HTML Control) Pin
mani_iips3-Sep-07 23:12
mani_iips3-Sep-07 23:12 
QuestionEditable GridView. Please help Pin
varshavmane3-Sep-07 20:13
varshavmane3-Sep-07 20:13 
AnswerRe: Editable GridView. Please help Pin
Sathesh Sakthivel3-Sep-07 20:16
Sathesh Sakthivel3-Sep-07 20:16 
AnswerRe: Editable GridView. Please help Pin
Sandeep Akhare3-Sep-07 20:29
Sandeep Akhare3-Sep-07 20:29 
AnswerRe: Editable GridView. Please help Pin
VanithaVasu4-Sep-07 0:42
VanithaVasu4-Sep-07 0:42 
QuestionHelp Needed . Gridview . Pin
rtsviswa3-Sep-07 20:08
rtsviswa3-Sep-07 20:08 
AnswerRe: Help Needed . Gridview . Pin
Sandeep Akhare3-Sep-07 20:30
Sandeep Akhare3-Sep-07 20:30 
Questionrollup/rollout page Pin
saravanan053-Sep-07 20:02
saravanan053-Sep-07 20:02 
QuestionProblem during User Authentication. Pin
nagendrathecoder3-Sep-07 19:55
nagendrathecoder3-Sep-07 19:55 
AnswerRe: Problem during User Authentication. Pin
John-ph3-Sep-07 20:25
John-ph3-Sep-07 20:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.