I have a master page in asp.net C# under it i have a content page.
when i take button on master page then on runtime on button click content form load event called on button click.
on every button click it happened.
any body face this type of problem ?
why?
Loading

Suthish NairPosted Oct 13, 2010, 3:03 PM
if problem solved, please mark as answer...
Vikas AhlawatPosted Oct 15, 2010, 12:08 AM
Suthish NairPosted Oct 14, 2010, 10:03 AM
http://www.c-sharpcorner.com/UploadFile/suthish_nair/3781/Default.aspx?ArticleID=8d6a6498-9ead-481b-997f-3d264369d509
but theres some security issues.
Vikas AhlawatPosted Oct 14, 2010, 7:15 AM
My problem is solved by this
http://dotnetslackers.com/Events/re-23154_Capture_Master_Page_Events_in_Content_Pages_ASP_NET_2_0.aspx
article
but it is very difficult
Which solution you give me it never
if (Request.QueryString["formname"] != null)
{
} never true
you can also read this article.
if any other easy solution then please explain.
Thanks any way
i m marking it answer.
Mahesh ChandPosted Oct 8, 2010, 1:55 PM
if (Request.QueryString["formname"] != null)
{
}
karthick kumarPosted Oct 8, 2010, 12:43 PM
You can check some conditions like
if( Request.QueryString["formname"].ToString()!=dbNull.ToString())
{
string formvalue = Request.QueryString["formname"].ToString();
}
Suthish NairPosted Oct 8, 2010, 12:23 PM
Vikas AhlawatPosted Oct 8, 2010, 7:05 AM
In this query sting always null because contant form load event called before master page button click event.
i want to display query sting value when content form load event call
Suthish NairPosted Oct 8, 2010, 6:52 AM
Vikas AhlawatPosted Oct 8, 2010, 5:42 AM
Can you give example
of passing query string from master page(button click event) to content page
Suthish NairPosted Oct 8, 2010, 3:31 AM
Vikas AhlawatPosted Oct 8, 2010, 2:33 AM
//when i click on the button then error occur here because button click event
protected void btnCategory_Click(object sender, EventArgs e)
{
Response.Redirect("~/Forms/frmView.aspx?formname=Category");
}
not called and when i make comment to these three lines then button click event ( btnCategory_Click) execute successfully.
you can help me by check it http://www.c-sharpcorner.com/Forums/UploadFile/96725
Suthish NairPosted Oct 8, 2010, 2:23 AM
Vikas AhlawatPosted Oct 8, 2010, 12:35 AM
if (!IsPostBack) {}Suthish NairPosted Oct 7, 2010, 8:55 AM
if (!IsPostBack) {}Vikas AhlawatPosted Oct 7, 2010, 8:28 AM
protected void btnCategory_Click(object sender, EventArgs e)
{
Response.Redirect("~/Forms/frmView.aspx?formname=Category");
}
content page onload even code
protected void Page_Load(object sender, EventArgs e)
{
txtFromDate.Text = DateTime.Now.AddMonths(-1).ToString("MM/dd/yyyy");
txtToDate.Text = DateTime.Now.ToString("MM/dd/yyyy");
//Session["is_starting"]=
if (Session["is_starting"] == "yes")
{
RefreshData("Category");
Session["is_starting"] = null;
}
else
{
string formvalue = Request.QueryString["formname"].ToString(); //when i click on the button then error occur here because button click event not called and when i make comment to these three lines then button click event ( btnCategory_Click) execute successfully.
Response.Write("");
RefreshData(formvalue);
// RefreshData("StudentProspects");
}
//Response.Write("");
}
Suthish NairPosted Oct 7, 2010, 7:24 AM
readon: http://odetocode.com/Articles/450.aspx