The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

Share tech news, updates, or what's on your mind.

Sign up to Post

I have an web application with a grid.  One column has a bulleted list with displaytype as Hyperlink. It is databound. I return some folder paths in this list. If the path is a share on a server all works find as example 1.

In example 1 the spaces are replace by %20.

But for some reason in Example 2 when the actual drive letter is used the spaces are replaced by %2520 which then does not work.



What causes this %2520 to happen? In example 1 with %20 the link works.

It looks like an encoding issue in the Bulleted list Hyperlink. It is adding the %2520 on the Example 2.


Microsoft Azure 2017
LVL 13
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.


I have these classes:

Public Class Party
    Public Property partyIdentifier As String
    Public Property email As String
    Public Property telephone As String
    Public Property role As String
End Class

Public Class Car
    Public Property registrationNumber As String
    Public Property registrationNumberMissing As Boolean
    Public Property model As String
    Public Property used As Boolean
    Public Property year As Integer
    Public Property mileage As Integer
    Public Property objectGroupType As String
End Class

Public Class Calculation
    Public Property cashPrice As Integer
    Public Property downPayment As Integer
    Public Property residualDebt As Integer
    Public Property creditTime As Integer
    Public Property interest As Double
End Class

Public Class Insurance
    Public Property monthlyCost As Integer
End Class

Public Class Finance
    Public Property contractType As String
    Public Property customerType As String
    Public Property customerLicenceType As String
    Public Property Parties As List(Of Party)
    Public Property car As Car
    Public Property calculation As Calculation
    Public Property profileId As Integer
    Public Property campaignId As Integer
    Public Property plannedDeliveryDate As DateTime
    Public Property insurance As Insurance
End Class

Open in new window

I'm now trying to build this as an object that I can serialize into json like this:
 If Not Page.IsPostBack Then
            Dim f As New Finance

            ' Basic
            f.contractType = "Installment"
            f.customerType = "Private"
            f.customerLicenceType = "SwedishDriversLicense"

            ' Parties
            Dim p As New Party With {
                .partyIdentifier = "8811119307",
                .email = "",
                .telephone = "0854545656",
                .role = "Buyer"

            Dim json As String = JsonConvert.SerializeObject(f)
            Label1.Text = json
        End If

Open in new window

The problem is that I get an error that an object doesn't exist when adding an party item to the lost of parties as can be seen in below image.
 Objkect error
What am I doing wrong and how can I fix it?


I need some help with a request in In postman I've succeded to get it to work and I've added the screenshots below
Postman 1Postman 2Postman 3

Now I've used Restsharp (but any request will do) to try and connect through code:

 Dim username As String = "xxx"
        Dim password As String = "xxx"
        Dim client As RestClient = New RestClient("https://url")
        client.Authenticator = New HttpBasicAuthenticator(username, password)
        Dim request = New RestRequest(Method.POST)
        request.AddHeader("Postman-Token", "fa4aa5a9-0c7a-45ad-a8b1-24fd0ac75f8c")
        request.AddHeader("cache-control", "no-cache")
        request.AddHeader("api-version", "1")
        request.AddHeader("Authorization", "Basic xxx")
        request.AddHeader("Content-Type", "application/x-www-form-urlencoded")
        Dim response As IRestResponse = client.Execute(request)

Open in new window

However I get this answer:
I'm getting the following error message when trying to write to the event log in my aspx page:

code to write to the event log:
EventLog.WriteEntry ......

error message
[SecurityException: Requested registry access is not allowed.]
   System.ThrowHelper.ThrowSecurityException(ExceptionResource resource) +51
   Microsoft.Win32.RegistryKey.OpenSubKey(String name, Boolean writable) +7469849
   System.Diagnostics.EventLog.CreateEventSource(EventSourceCreationData sourceData) +366
   System.Diagnostics.EventLog.VerifyAndCreateSource(String sourceName, String currentMachineName) +194
   System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +205
   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +87
   System.Diagnostics.EventLog.WriteEntry(String source, String message, EventLogEntryType type) +14
   TagTeam.ttDownloadHandler.ProcessError(HttpContext context, String errorMessage, EventLogEntryType entryType) in e:\InetPub\Products\RevBase\Applications\DotNet\ttDownloadHandler\sl.ashx:395
   TagTeam.ttDownloadHandler.ProcessRequest(HttpContext context) in e:\InetPub\Products\RevBase\Applications\DotNet\ttDownloadHandler\sl.ashx:106
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& 

Open in new window


In my GridView the following event isn't firing

I have a page that upload file to one of the folders. I have a file that is about 47MB and received this error

The request filtering module is configured to deny a request that exceeds the request content length.

I went to web.config to change the limit.

    <httpRuntime requestValidationMode="2.0" maxRequestLength="102400000"/>

But still does not work. Am I missing something?  thanks

I use the following code to get refer to a GridView template control. How do I get the column index of that template control?

    Private Sub GridView1_RowDataBound(sender As Object, e As GridViewRowEventArgs) Handles GridView1.RowDataBound

        Dim oStatus As String

            If e.Row.RowType = DataControlRowType.DataRow Then

                Dim lblStatus As Label = CType(e.Row.FindControl("lblStatus"), Label)

Open in new window


In I noticed that variables declared publically in Module1 could be accessed at the same time from different users around the world.
I have now moved my variables (like that below) to the top of each web form so that they are only accessible by the current user. I just want to confirm
that this is true
Public Class Purchase_Order

    Inherits System.Web.UI.Page

    Private objDV As New DataView

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Open in new window


In my project I have been assigning usernames to a variable in Module1 when users log in.
The variable is declared as Public oUsername at the top of the module.
When another user logs in it changes that variable to their username.
I thought that Module1 wasn't shared like this. Why is it?
Is there a better way place to store the variable?

In my web app I use the following style. How do I make the font much larger?

    <style type="text/css">
             .pleaseWait { width: 30%; height: 100px; background-color: #2964c4; display: none; z-index:999; position:absolute; left:25%; top:10%}
JavaScript Best Practices
LVL 13
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

(I don't know where to put this so I put in C#/ASP.Net category)..

For those of you who've been helping me and know I've been dealing with an abusive and moody manager for almost a year... I accepted an offer today.  I've been practicing my resignation since my manager blew up on me in January...over some silly SQL indentation... can you believe it?!...but now I'm not happy about it. Why is it so easy for companies to see good people come and go but so hard to dicipline a manager? (I'm the 3rd one leaving this company). Why is it so easy to see good people come and go but so hard to send a manager to training?

The position I accepted is a little outdated in technology. They said it's Web Forms and Crystal Reports but open to upgrades.  Another developer does Angular and web stuff. Someone else does other stuff. Solid company and the owner also spoke with me. Seemed like a really nice person and my future manager said he has no tolerance for bad behavior.

I had another potential offer that with more recent technologies but they were taking their time and they're like a startup. They've already had layoffs and the company has been bought out. I chose the solid company with a good 401K (I'm getting older and not younger :)) , 3 weeks of vacation and a little increase in my salary. I chose a manager over technology (I read an article on LinkedIn about it). They did say they're looking into AI and new stuff. I do side projects so I can keep up with newer technologies.

I have a GridView that displays particular files from a folder. Is there a way to sort it desc by the file date?

        DirectoryInfo loanDir = new DirectoryInfo(@"C:\myFoler");

        FileInfo[] filesInDir = loanDir.GetFiles("*" + partialName + "*.*");

        List<FileDetail> files = new List<FileDetail>();
        foreach (FileInfo foundFile in filesInDir)
            files.Add(new FileDetail(foundFile));
        GridView1.DataSource = files;

Open in new window

Is it possible to stop code running in a timer tick when the user is busy typing something
in a GridView template column textbox.
I want to select a row from a table and present
that row in a web Form which is developed using the row columns?

I am developing a table which will consist of form data which will be presented
based on a given type.


I have an GridView with a TextBox template column in it. I have a Timer Control that reloads this GridView
every 5 seconds. The problem is that anything types into one of the TextBoxes disappears. Is there a way to somehow
not clear the TextBoxes in my template column? Should I perhaps just have the timer tick every 2o seconds?

I have a visual studio 2015 website and every time I run it, it recompiles, even if I haven't made any changes, which is making it tediously slow to get any work done.

On Website Property Pages:
Before running startup page:
Build Web Site

Build Solution action:
X - Build website as part of solution.

But I've had these settings for years and this hasn't been a problem in the past. I want to make sure all changes get compiled before testing.

Suggestions on best settings to keep it moving along, but yet compile changes?

I have a program that operates on web application.  I have a portion of this program that runs a return of retrieving data for charting in the chart control.  The initial running of the program works as intended, but when I repeat the process of selecting a different set of data parameters for the chart to display the program slows down.

Is this because of cache?  If so how do I correct this?

Thanks in advance for the help.

For sending requests to a webservice that deserializes Json, what items in this list are 'required' by the webservice?

# BasicAuthUser:
# BasicAuthPassword:
# ProxyURI:
# ProxyUser:
# ProxyPassword:
# SendHTTPHeaders:
# HeaderCookieData:
# ResponseCookieFile:
# HeaderSOAPAction:
# HeaderUserAgent:
# HeaderAccept:
# HeaderHost:
# HeaderReferer:
# HeaderConnection:
# HeaderContentType:
# CustomHeaderName(1): Authorization
# CustomHeaderValue(1):
# InputCcsid: 0
# OutputCcsid: 0
# EnableExpectHeader:  
# LocalInterface:
# Enable IPv6:
I have the following code

        public PartialViewResult GetDataFromGraphPoint(int Id)
            var Model = processSDT.GetAllDataFromProbeLogId(Id);

            return PartialView("/Views/Home/ImageFromProbeLogId.cshtml", Model);

This all works fine in debug mode
However in IIS the site runs in a virtual directory on some instances
i.e. the location is

But i think its trying to access

So it fails to find the CSHTML file
Is there an easy way in code to make this work in virtual directories and non virtual directories in IIS ?
I could hack it by having a web.config flag that you set running directory....
i.e. SiteRunsIn = "/myAppHere/"

However is there a more elegant way?
Introduction to Web Design
LVL 13
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

Why is this answer correct?

Revenue for Q2 is 300. Cost is 250. So profit is 300,000-250,000 = 50,000 but then Q1 and Q3 are also the same.

No way this is that hard but I've been doing all this math stuff all afternoon and my brain is fried....

X is gas price
Increased by 15% so  X * .15
the price is now 3.91 ..I'm missing something

For this one...
There are 15 even days. 15 odd days in a month.
On Even days, doctor works for 7 hours
On Odd days , doctor works or 7:30 hours

Nothing jumps out at me to see why 4 hours is correct... not sure how to go about this one...

for this one... this is how I went about it

From 12 AM to 5 PM... we lose 5 mins each hour so that's 165 mins = 2.75 hours. But this doesn't get 3:35... I'm missing some calculation.

The answer is 25% decrease. From the graph, I eliminated the 4 answers because the graph for "food and beverages" and "services" has decreased.

Why is it 25%? For example, food & Beverages went from 60 Million to 50 Million and Services went from 20 million to 10 million. I wanted to say... what percentage of 50 million is less than 60 million...

Why is the answer to this is 100?

That's 500 mins of free call in the grid... it's not 500 per min. One year is 12 months.... hmmm... I don't know how 100 is correct.







The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications