|
|
Searching on the web I found differents solutions to log all requests received by a IIS server.
I read all articles about these differents solutions and I already implemented and tested them. I don't know wich one to choose between solution 1 and solution 2. Is there an history or performance or architecture maintenance reason that explain a solution is better than another. Are DelegatingHandler and/or ActionFilterAttribute a old feature?
B413
|
|
|
|
|
If you want to log every request, then use the IIS log. That will include requests which might not be mapped to the Web API pipeline, and therefore wouldn't be picked up by a DelegatingHandler or action filter.
If you just want to log the Web API requests, then either a DelegatingHandler or an action filter will work. Neither is an "old" feature. However, if you want to log the request and response bodies as a single entry, the DelegatingHandler would be the better choice.
protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var response = await base.SendAsync(request, cancellationToken);
await LogAsync(request, response);
return response;
}
If you just want trace logs for your code, have a look at Tracing in ASP.NET Web API 2[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hey, guys.
I am an experienced programmer but very new to ASP.NET. I am needing to code a simple web app and unsure of the best way to do it. I know how to find most answers on my own, so I won't be a needy person here. I just need to know the general design I should follow.
The web app is for a company that needs employees to enter data into a time log excel spreadsheet. My design simplifies the process using a step-by-step method that prompts for each item (i.e. start time, activity type). As the user inputs data, the answers are fed into the excel spd using COM (don't need any help there).
An example of the process:
1. Select your name (from DDL - I plan to automate this by login)
2. Enter your hours
3. etc.
The data inputted is contextual. In other words, what is prompted for in #4 can be dependent upon #1. This means the Server must keep up with all the information until the entry is complete.
Sorry if this is TMI. The short of it is, how do I display each step? Should they all be separate web pages? My gut says that's a bad idea. Is there a way to stay on one page and enter all this data one at a time? Currently I'm working with a Windows Forms ASP.NET web project.
Bonus points: The windows app I coded is smart enough to dynamically create the prompts, and it would be *amazing* if the web app could do the same.
|
|
|
|
|
If I had to do this project, I would use a grid control to have the user enter their time, then when all of the time is validated you could save it to the database.
Do yourself a favor and consider buying a set of controls to help you implement ASP.NET projects. I would strongly consider: Developer Express .NET UI Controls for Developers of Mobile, Desktop, Web & Reporting Applications | www.DevExpress.com[^]
I've been using their controls for years and met some of the guys personally. Great company.
You really want to look at their Grid Control, amazing.
That's my 2 cents, I'm getting off my soapbox now ... 
|
|
|
|
|
Thank you! I certainly will check out grid control -- sounds great!
|
|
|
|
|
There's 2 ways to do this: on the server or on the client. The approach depends largely on which particular ASP.NET framework you're using (MVC or webforms) and how comfortable you are with JavaScript.
From a UI standpoint you can generally do with a web app the things that you can do with a native one as long as you consider the limitations of the sandbox (you won't be hooking graphics hardware directly, etc). I've found that for enterprise applications that doens't matter much.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Thank you! I'm using WebForms and far more comfortable with C# than with JavaScript. As much as I can I'm keeping the code server-side and using C#.
|
|
|
|
|
Check out the Wizard control. I've used it to do exactly what you are talking about.
"Go forth into the source" - Neal Morse
|
|
|
|
|
This is right on the money! Thank you so much 
|
|
|
|
|
Glad I could help. I used the Wizard control in a web based timeclock system recently. The automatic handling of back and next is great. Good luck!
"Go forth into the source" - Neal Morse
|
|
|
|
|
Hi Everyone
I added change Language button to the master page with the following code
If Session("culture") = "en-US"
Session("culture") = "ar-SA"
else
Session("culture") = "en-US"
End If
Thread.CurrentThread.CurrentCulture = CultureInfo(Session("culture").ToString())
Thread.CurrentThread.UICurrentCulture = CultureInfo(Session("culture").ToString())
Server.Transfare(Request.Url.PathAndQuery)
Also added this code on Page_Init() for master page
If Session("culture") Is Nothing Then
Session("culture") = HttpContext.Current.Request.UserLanguages(0)
End If
also for the controls it is like this
<asp:Label Text="Text" meta:resourcekey="xxx" />
and i added App_LocalResources with 2 files for everypage(one for en and other for ar)
when i click on change language button it works but when move into other view within multiview inside same page language change back into user browser default language, so i have to click on change language button again to change the language
Can someone tell me what wrong with my code
P.S.: I tried with cookies same result
UPDATE:
i solved by using Global.asax and moved setting culture code into Application_OnAcquireRequestState event
modified 5-Oct-16 6:54am.
|
|
|
|
|
hello
i want to creat one form in asp and implemen digital signature with md5 and aes that say to me correct
i dont know what doing
pleas help me
thanks
|
|
|
|
|
So the first thing you'll need is to determine how you're going to manage the certificates that are used for signing. These need to either be home-baked or from an authoritative source, such as Verisign.
Just for your awareness, managing a digital certificate store is a gigantic pain in the rear, with significant administrative overhead (you can google PKI RA for funzies). Unless you have a substantial client base you're best off going through a vendor.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
I want to hide a label, textbox, and button when the toggle switch is set to no. Can some help me in doing that based off my code?
<div class="form-group">
<div class="row">
<div class="col-md-12">
<label for="exampleDateSigned">Does CAGE Code exist for contract?<span
class="style1">*</span>:</label>
<label class="lookup-switch-btn">
<input class="checked-switch" name="cage-lookup" type="checkbox" />
</label>
</div>
</div>
</div>
'Want to hide this when the toggle switch is changed to no.
<div class="form-group">
<div class="CAGErow">
<label for="exampleCAGE"> CAGE<span
class="style1">*</span>:</label><br />
<div class="col-md-4 col-sm-4"><asp:TextBox ID="TextBox11" class="form-control"
placeholder="" runat="server" Height="22px"></asp:TextBox> </div>
<div class="col-md-4 col-sm-4"><asp:Button ID="Button4" Text="Lookup"
type="button" runat="server" onclick="NextButton_Click" Height="25px"/></div>
</div>
</div>
|
|
|
|
|
In code behind or javascript?
|
|
|
|
|

<pre lang="c#"><head runat="server">
<title></title>
<script type="text/javascript">
function showHideDiv(id) {
var e = document.getElementById(id);
if (e.style.display == null || e.style.display == "none") {
e.style.display = "block";
} else {
e.style.display = "none";
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div class="form-group">
<div class="row">
<div class="col-md-12">
<label for="exampleDateSigned">Does CAGE Code exist for contract?<span
class="style1">*</span>:</label>
<label class="lookup-switch-btn">
<input class="checked-switch" name="cage-lookup" type="checkbox" onclick="showHideDiv('hideDiv')"/>
</label>
</div>
</div>
</div>
'Want to hide this when the toggle switch is changed to no.
<div runat="server" id="hideDiv" class="form-group" >
<div class="CAGErow">
<label for="exampleCAGE"> CAGE<span
class="style1">*</span>:</label>
<div class="col-md-4 col-sm-4"><asp:TextBox ID="TextBox11" class="form-control"
placeholder="" runat="server" Height="22px"></asp:TextBox> </div>
<div class="col-md-4 col-sm-4"><asp:Button ID="Button4" Text="Lookup"
type="button" runat="server" onclick="NextButton_Click" Height="25px"/></div>
</div>
</div>
</form>
</body>
|
|
|
|
|
HI,
I have a RDLC Report, Contain a Table With Multiple Head Rows. I wanna Display only one Head Row in every Page. I wanna do it with Page number. If the page number is ONE(1) will show every Head Rows else only One Head Row.
Urgent Please help .........
What I have tried:
I tried to give expression for hide Head Row using Page number But Page number can't take in report body only Header or footer part of the report can include PageNumber functionality
|
|
|
|
|
This is exactly the same question you posted in QA two days ago:
RDLC report header row visiblility issue ..[^]
You didn't provide enough information for anyone to help you then, either.
And no, it's not "urgent" for the unpaid volunteers who answer questions here.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Does anyone know how to create a simple hard URL to an action in MVC5? I'm not using it in the context of a View though, I am generating a unique URL and storing it into the database... Trying to use this:
public IHttpActionResult Create(Url url)
{
UrlHelper helper = new UrlHelper();
if (!ModelState.IsValid)
{
BadRequest();
}
url.OurUrl = helper.Action("Go","Redirect", null, "http") + url.UrlId;
_context.Urls.Add(url);
_context.SaveChanges();
return Created(new Uri(Request.RequestUri + "/" + url.UrlId), Url);
}
I've tried all kinds of variations on the Action() method... Like just using Go and Redirect as arguments... And what you see there. But it keeps telling me that routeCollection cannot be null
I'm confused because routeCollection isn't even a parameter listed in the method. Thanks.
|
|
|
|
|
Create your helper like this
UrlHelper helper = new UrlHelper(HttpContext.Current.Request.RequestContext);
|
|
|
|
|
Good day friends!
I taught this would be possible but I spend over 2hrs trying to figure this out but to no avail.
This is what I want;
I have datalist control that displays payment details and everything is working fine except one. Which is
I want to display sum of all the payments made on a label control called Aggregate.
For example
Customer Name Amount Date
Paul $2000 20-09-2016
Catherine $5000 20-09-2016
Otes $3000 20-09-2016
Aggregate = Sum of all payments made
Any solution please...
Thanks in advance...
|
|
|
|
|
This sounds very easy to do. Where are you stuck?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Thanks for your reply. Am stuck at the summing. Help please
|
|
|
|
|
Otekpo Emmanuel wrote: Help please I would love to but I have no idea what your problem is. It's like you went to the mechanic and said, "I can't drive my car." Do you think they could help?
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|