I have managed to achieve requested functionality in WinForms, though as I’m still a beginner in ASP.NET (which is far more complex platform than Windows, variables ‘loses’ they’re everything they owned before) and client VS. server, I kind of ask my self where to start.
In WinForms using system reflection I was able to be repotted
(via a ListView placed on the current form ) ListView is than populated
with every single Function information (timings parameters etc…)
but I can’t really think about a web site to host that ListView even though I could lose it before publishing the application. Instead,
I thought of something like the following, and I would like to check with you experienced developers, how do you take care of your business?
I can actually be satisfied with Visual studios own debugging capabilities .
This is my approach
A click on a submit button for example
protected void imgBut_Submt_Click(object sender, ImageClickEventArgs e)
{
//debugging and logging via methods that's in a namespace/ classses showed below
SeSn.Modify(Act.Edit,SeSn.CurrentStage, Mod.submitedFreshQuery); <-----=======
App.Add(AppFlags.SubmitButtonWasPressed);<------===========
Display.Show(DV_UsersInTblTime);
tblTimeDataLists.getReportFromSP(Convert.ToInt32(DDL_ChosenBranch.SelectedItem.Value), SelectedReportMonth, SelectedReportYear);
Visibility.Hide(imgBut_Submt);
var m = Request.Form["DDLmonth"];
var y = Request.Form["DDLyear"];
string branchName = GetTableData.AsString(HTDB_Cols.TblBranches.BranchName, HTDB_Tables.TblBranches, HTDB_Cols.TblBranches.BranchID, DDL_ChosenBranch.SelectedItem.Value);
if (tblTimeDataLists.TheresNoRecordForThatSnif(Convert.ToInt32(DDL_ChosenBranch.SelectedItem.Value), Convert.ToInt32(m), Convert.ToInt32(y)))
JsTemplates.Alert(string.Format("No data for {0} at period {1}/{2}", branchName, m, y));
DisplayRepResults();
}
You can have a little look on the methods I’m using to “harvest” systems session data
namespace DebugTests
{
namespace Sesseion
{
public static class SeSn
{
public const string CurrentStage = "CurrStage";
public static bool isNotEmpty()
{
return HttpContext.Current.Session.Keys.Count > 0;
}
public static bool Raised(string FlagName)
{
return GetValueAS.Bool(FlagName);
}
public static void Modify(Act action, string NewQs_paramName, string NewP_Value = "", string CurSes_ParamName = null, bool redirectWithNewQuerySettings = false)
{
switch (action)
{
case Act.Remove:
if (isNotEmpty())
HttpContext.Current.Session.Remove(CurSes_ParamName);
break;
case Act.Replace:
HttpContext.Current.Session.Remove(CurSes_ParamName);
HttpContext.Current.Session.Add(NewQs_paramName, NewP_Value);
break;
case Act.Edit:
HttpContext.Current.Session.Remove(CurSes_ParamName);
HttpContext.Current.Session.Add(CurSes_ParamName, NewP_Value);
break;
case Act.Add:
HttpContext.Current.Session.Add(NewQs_paramName, NewP_Value);
break;
case Act.AddFlag:
HttpContext.Current.Session.Add(NewQs_paramName, true);
break;
}
}
}
public enum Act
{
Edit, Add, AddFlag, Remove, Replace
}
public sealed class SesVals
{
public const string state = "Cstate";
public const string custid = "custid";
public const string recordID = "recordID";
public const string SelectedMonth = "SesMonth";
public const string SelectedChosenWorker = "SesChosenWorkerSelected";
//etc....
}
public sealed class Mod
{
public const string FirstloadeViaLink = "Link",
submitedFreshQuery = "submitedFreshQuery",
canceledInsert = "cancelInsert",
filteredByTable = "filteredByTable",
filterByColumn = "filterByColumn";
//etc....
}
public sealed class App
{
public static void Add(string flagName)
{
Sesseion.SeSn.Modify(Act.AddFlag, flagName);
}
}
public sealed class AppFlags
{
public const string SubmitButtonWasPressed = "SubmitButtonWasPressed";
public const string MainDataSetIsPopulated = "MainDataSetIsPopulated";
public const string HTDB_DisplayCpa_Cols_WasSelected = "HTDBCpa_ColsWasSelected";
//etc....
}
}
}
Is this the way to do it If i want to avoid Extra programs / plugins for VS
or is it a must to use them?
How are you managing your apps maneuvers?
(Ignoring whole bunch of text/code in question that does not seem to be related to question in title)
You can debug both ends of web application written using ASP.Net by using Visual Studio.
Browser side debugging with VS is limited to IE, but generally it is not a problem as all modern browsers for desktop systems include developer tools (usually avaialble by clicking F12).
Server portion can be directly debugged on either built in Web server or on IIS. In case if you don’t use default deployment you can simply attach VS debugger to w3wp process that contains app pool for given site.