यह एक बहुत देर से इस सवाल का जवाब है, लेकिन मुझे लगता है कि आपको यह पसंद आएगा ..
आप पृष्ठ के विषय को बदल सकते हैं प्रीइनिट इवेंट में, लेकिन आपने बेस पेज का उपयोग नहीं किया है ..
मास्टरपेज में डीडीएलटीमा नामक एक ड्रॉपडाउन बनाएं, उसके बाद यह कोड आपके ग्लोबल.एक्सएक्स में लिखें। देखें कि जादू कैसे काम करता है :)
public class Global : System.Web.HttpApplication
{
protected void Application_PostMapRequestHandler(object sender, EventArgs e)
{
Page activePage = HttpContext.Current.Handler as Page;
if (activePage == null)
{
return;
}
activePage.PreInit
+= (s, ea) =>
{
string selectedTheme = HttpContext.Current.Session["SelectedTheme"] as string;
if (Request.Form["ctl00$ddlTema"] != null)
{
HttpContext.Current.Session["SelectedTheme"]
= activePage.Theme = Request.Form["ctl00$ddlTema"];
}
else if (selectedTheme != null)
{
activePage.Theme = selectedTheme;
}
};
}
@ थीसिस। __curious_geek, पेज_लोड में ऐसा क्यों करना पसंद नहीं है Pre_Int? –