Click here to Skip to main content
15,889,335 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Generalaccessing master page controls Pin
amarnath n.n25-Aug-09 4:31
amarnath n.n25-Aug-09 4:31 
GeneralRe: accessing master page controls Pin
Christian Graus25-Aug-09 10:58
protectorChristian Graus25-Aug-09 10:58 
Questionuser control Pin
Ramkumar_S25-Aug-09 2:54
Ramkumar_S25-Aug-09 2:54 
AnswerRe: user control Pin
Blue_Boy25-Aug-09 2:58
Blue_Boy25-Aug-09 2:58 
AnswerRe: user control Pin
here2learn25-Aug-09 22:54
here2learn25-Aug-09 22:54 
QuestionPlaceholder+usercontrol Pin
Ramkumar_S25-Aug-09 2:28
Ramkumar_S25-Aug-09 2:28 
AnswerRe: Placeholder+usercontrol Pin
N a v a n e e t h25-Aug-09 2:31
N a v a n e e t h25-Aug-09 2:31 
GeneralRe: Placeholder+usercontrol Pin
Ramkumar_S25-Aug-09 2:35
Ramkumar_S25-Aug-09 2:35 
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class SampleMenuPage1 : System.Web.UI.Page
{
private const string BASE_PATH = "~/DynamicControlLoading/";

private string LastLoadedControl
{
get
{
return ViewState["LastLoaded"] as string;
}
set
{
ViewState["LastLoaded"] = value;
}
}

private void LoadUserControl()
{
string controlPath = LastLoadedControl;
if (!string.IsNullOrEmpty(controlPath))
{
PlaceHolder1.Controls.Clear();
UserControl uc = (UserControl)LoadControl(controlPath);
PlaceHolder1.Controls.Add(uc);
}
}

protected void Page_Load(object sender, EventArgs e)
{
LoadUserControl();

if (IsPostBack)
{
//Sleeps for 1 Seconds
//A Fake Deley to show the UpdateProgress/ModalPopup
System.Threading.Thread.Sleep(1000);
}
}

protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
{
MenuItem menu = e.Item;

string controlPath = string.Empty;

switch (menu.Text)
{
case "Load Control2":
controlPath = BASE_PATH + "SampleControl2.ascx";
break;
case "Load Control3":
controlPath = BASE_PATH + "SampleControl3.ascx";
break;
default:
controlPath = BASE_PATH + "SampleControl1.ascx";
break;
}

LastLoadedControl = controlPath;
LoadUserControl();
}
}

In SampleControl2.ascx ..Even is not firing for first time(dropdown onchange event)
And !ispostback is not working

Ramkumar

GeneralRe: Placeholder+usercontrol Pin
Charles Crawford25-Aug-09 12:57
Charles Crawford25-Aug-09 12:57 
GeneralRe: Placeholder+usercontrol Pin
Ramkumar_S25-Aug-09 23:01
Ramkumar_S25-Aug-09 23:01 
GeneralRe: Placeholder+usercontrol Pin
Charles Crawford26-Aug-09 15:12
Charles Crawford26-Aug-09 15:12 
Questionhyperlink with imageUrl Pin
Piya B25-Aug-09 2:19
Piya B25-Aug-09 2:19 
AnswerRe: hyperlink with imageUrl Pin
Ramkumar_S25-Aug-09 2:40
Ramkumar_S25-Aug-09 2:40 
AnswerRe: hyperlink with imageUrl Pin
Rhys Jacob25-Aug-09 2:47
Rhys Jacob25-Aug-09 2:47 
QuestionPrevent resending information on refresh Pin
benams25-Aug-09 1:46
benams25-Aug-09 1:46 
AnswerRe: Prevent resending information on refresh [modified] Pin
padmanabhan N25-Aug-09 1:51
padmanabhan N25-Aug-09 1:51 
GeneralRe: Prevent resending information on refresh Pin
benams25-Aug-09 2:04
benams25-Aug-09 2:04 
GeneralRe: Prevent resending information on refresh Pin
padmanabhan N25-Aug-09 2:09
padmanabhan N25-Aug-09 2:09 
GeneralRe: Prevent resending information on refresh Pin
nagendrathecoder25-Aug-09 2:01
nagendrathecoder25-Aug-09 2:01 
AnswerRe: Prevent resending information on refresh Pin
Vasudevan Deepak Kumar25-Aug-09 2:20
Vasudevan Deepak Kumar25-Aug-09 2:20 
AnswerRe: Prevent resending information on refresh Pin
Amit Patel198525-Aug-09 2:21
Amit Patel198525-Aug-09 2:21 
AnswerRe: Prevent resending information on refresh Pin
N a v a n e e t h25-Aug-09 2:25
N a v a n e e t h25-Aug-09 2:25 
GeneralRe: Prevent resending information on refresh Pin
benams25-Aug-09 2:52
benams25-Aug-09 2:52 
GeneralRe: Prevent resending information on refresh Pin
Abhijit Jana25-Aug-09 3:59
professionalAbhijit Jana25-Aug-09 3:59 
AnswerRe: Prevent resending information on refresh Pin
Abhijit Jana25-Aug-09 4:03
professionalAbhijit Jana25-Aug-09 4:03 

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.