|
using System; //needed
using System.Web.UI.WebControls; //needed by ODS
using NHibernate.MapClasses;
public partial class Show : System.Web.UI.Page,MVC.Views.IGeneralView
{
//Show does not need controller
private MVC.Controllers.IAdminController _controller;
public delegate Product SingleBook_Handler();
public void Alert(string message) //alert available immadiately
{
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
_controller = MVC.Factories.Factory.PointerToFactory.GetAdminController(this);
ObjectDataSource1.TypeName = _controller.GetType().FullName;
SingleBook_Handler GiveMethodName = new SingleBook_Handler(_controller.SingleBook);
ObjectDataSource1.SelectMethod = GiveMethodName.Method.Name;
DV_Show.DataSourceID = ObjectDataSource1.ID;
}
}
protected void Page_PreRender(object sender, EventArgs e)
{
//here i set navurl fro two urls
SetView();
}
protected void ObjectDataSource1_ObjectCreating(object sender, ObjectDataSourceEventArgs e)
{
e.ObjectInstance = _controller;
}
private void SetView()
{
//here i set navurl for CreateGoToAdmin link
ContentPlaceHolder MasterPlaceH = (ContentPlaceHolder)this.Master.FindControl("MainCol");
HyperLink ShowGoToAdmin = (HyperLink)MasterPlaceH.FindControl("ShowGoToAdmin");
HyperLink ShowGoToEdit = (HyperLink)MasterPlaceH.FindControl("ShowGoToEdit");
ShowGoToAdmin.NavigateUrl = Utils.Utils.GetUrl("action=>admin");
//id is gotten from url
ShowGoToEdit.NavigateUrl = Utils.Utils.GetUrl(@"action=>admin,method=>edit" +
",id=>" + Context.Items["id"].ToString());
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
After defending his
PhD thesis in 2005 (computational nuclear physics) at Vanderbilt in Nashville, the author decided to pursue a career in software development. As a long time open source advocate, he started with writing web applications using Linux-Apache-MySql-P (LAMP) framework. After that experience, he decided to embrace Microsoft technologies.
Currently working as a web developer in .NET platform in the online payments company.