Post object variable below is throwing a null reference exception

Topics: Controls
Jan 6, 2012 at 1:07 PM
Edited Jan 6, 2012 at 1:09 PM

Hi  , friends at BlogEngine.Net !

I am looking for an answer to a query regarding Blog Engine Widget...

I am trying to access Blog Post (Current) in Widget's Edit file (edit.ascx.cs). However , the Post object variable below is throwing a null reference exception. I can access Post variable in widget.ascx.cs but not in edit.ascx.cs how do i fix this ??

protected override void OnInit(EventArgs e)
        {
           
            string BaseDirectoryPath = System.Web.HttpContext.Current.Server.MapPath(BlogConfig.StorageLocation);   

            string s = Request.QueryString["id"];
            Post Post = Post.GetPost(new Guid(s));
          
            this.txtText.Text = Post.Title;
            base.OnInit(e);
        }

Happy New Year N Christmas.... :)