Is there any way to allow me to trace button click in which webpage.
For example
Default1.aspx
button1 click
Then in my log file.My log file will log that button1 click in default1 page .
Is possible to do this in the beginrequest event of the global.asax file?
Please guild me a solution .
Here is my code for global.asax
protected void Application_Start(object sender, EventArgs e)
{
// Set logfile name and application name variables
string l4net = Server.MapPath("~/log4Net.config");
log4net.Config.XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo(l4net));
}
protected void Application_BeginRequest(object sender, EventArgs e)
{
//What should i code here???
}
Any help is much appreciated
Yes, surely you can do it.
You can get the current page using
and the button is present in the event target
This gets you the ClientID of your control, but you should be able to extract the control ID from it.