I know that the web handler will automatically json encode the data, and that the way I have built my list should be reworked (the way we previously used this it was exactly what we needed).What might be a better way for me to house my data and return it to the browser in a way that is understood correctly?
I have a context.Request.QueryString item that is returning the wrong value in the ProcessRequest method of a .ashx handler.
The code is like so:
Public Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim strOrderItems As String = Convert.ToString(context.Request.QueryString("OrderItems")) End Sub
One of the values returned by "OrderItems" is wrong. How can I find out what process has called this method to fix the incorrect data?
I'm looking to return a thumbnail image from a full size image stored as varbinary(max) in the database. I'll be using the thumbnails in a gallery-style view, so small size / efficient loading is crucial. I've been using an .ashx to return the full size image into a bound asp.net Image control, with the following code:
Sub ProcessRequest(ByVal context As HttpContext) Implements IHttpHandler.ProcessRequest Dim conn As New SqlConnection()
[Code]....
I realize it's probably best to address the re-size at the upload, and stored the smaller image as a discrete column. But in the meantime, is it possible to program the handler to re-size the image on the fly? Ideally, I'd be able to pass an additional query string parameter, something like isResized from the image binding, allowing the same handler to be used for both full size and re-sized images.
I am having trouble getting my .ASPX page to call my .ASHX file. Does anyone know what I might be leaving out? I have posted my entire .ASHX file below along with a little .aspx.
I have two lists. One list is a list of names, the other list is a list of how many times each name is found in the first list noted in the database
so... Nick John Jim Jack
is the firs tlist
10 13 13 2
is the second list. Nick had 10, john 13 and so on.I want to sort the second list from large to small, but have the index for the first list still linked to the correct amount of calls.i do it this way so I can
for x = 0 to num_of_names string = lst_name(x) & "-" & lst_count(x) next x
This question is a following from another question I asked - Passing client data to server to create Excel or CSV File. I have a client page which builds a JSON object to send to the server, and I have server code which can parse that JSON object into an SQL command and end up with a dataset of required data.
I had originally been passing the JSON object to an .asmx web service which would return a JSON object containing my data. Now I want to go in a different direction and have the data returned as a .csv file.
I understand I can try to put my JSON object into a query string and call my .ashx page, but the JSON object could get large, so I'm trying to use the Request.Form of a POST.
My question, and lack of understanding, is in how to use jQuery to post to the .ashx page and have it return the .csv file to the client. If I navigate to the .ashx page directly (and modify the page to hard code the passed data), I get the .csv file returned to me no problem (i.e I get the prompt to open/save the file). If I make a POST to the .ashx file from jQuery and send my JSON object through, I get a response which contains the data in a string, rather than getting a .csv.
So, is there something I am missing, or am I just trying to achieve something that I can't or shouldn't be doing? I'd thought about passing my JSON object to a .asmx web service which would store the JSON object into a database and return an ID, and then use window.location to browse to the .ashx with the ID as a query string parameter to then generate the .csv file, but I thought there might be a way to avoid that middle step and do it with the POST.
I need to get a value from an API I made with ASHX and normally it is called from javascript but I need to call it right in ASP.NET I figured this shouldn't be a problem but I'm not sure the syntax.
I know how to check whether an item exists in a list using (MyList.Contains), But I do not know how to check the whole list. For example (use one button and one richtextbox):
The event handlers in my parent class are never called though the events are raised in the child class.
The Code:
Public Class childForm Public Event checkboxchangedEvent(ByVal checkbox1 As Boolean, ByVal checkbox2 As Boolean) Private Sub checkboxchanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged, CheckBox2.CheckedChanged
I'm working up a system where I plan on using RealProxy objects to enable intercepting method calls against a set of objects, handling the call, and then returning appropriate results. This works just find for simple return types like strings or ints, but I can't seem to return objects from the RealProxy.Invoke method. Everything works. I get no errors, but the returned value is always NOTHING, instead of an object.
I've worked up the smallest sample code I could, and have included it below. Essentially, just call RPtest and single step through. The code creates a simple object, RPTestA, with a string field and an object valued field It then retrieves the string
remove an event handler from within the event handler?
I have a class that gets data from a hand scanner. When the scan is complete and the data is validated, the class fires a custom "ScanComplete" event and returns the data in a custom EventArgs.
In the calling program, I'm creating an instance of the scanning class and adding a handler for the "ScanComplete" event. In the event handler I get the data that was scanned and then remove the handler.
It seems to be working but it feels wrong to remove the handler while I'm running inside the handler. Will this cause a problem?
I would like to loop through two lists using a For each loop. dim data as list(of pointpairlist) For each recLine in records For Each chan In recLine.channels and d in data d.add( func(chan) ) Next next
Note: each record line has one sample from each channel recorded. i.e. each record line is a slice of a 32 sensor recordings. I want to build up a x,y list of data points for each channel (the x axis is common to all channels). Is there some way to do it similar to what I have above (avoiding indexing variables).
I'm very new to programing and am having problems trying to perform some calculations with a list. I have read in an array into a list with a count attached to each item example: "xxxxxx(intcount)". What I'm trying to do it use two xxxxxx(intcount)'s at xxxxxx(intcount+5) and xxxxxx(intcount+25) and use these two variables to calculate yyyyyy(intcount) but it isn't working. I understand this may be a stupid question but could someone please point me in the right direction.
Ok this is a hw assignment like always....just not sure on how to do the math on this form...the constants are declared for the registration fees and i did the same for the required days at each work shop i just need to find a way to multiply the days required at each workshop by the lodging fees. but i also need to display the lists of costs so its pretty complicated.
I have a method where I'm taking a generic object and using TypeOf to check what has been passed through. Now I would like to pass it a List(Of T) (T being anything) and no matter what T is I'd like to do the same thing to this list. I tried the following:
public sub foo(ByVal obj As Object) if TypeOf obj Is List(Of Object) Then 'do stuff end if end sub
but this doesn't seem to work if I pass it List(Of String), say. I suppose that List(Of Object) and List(Of String) are being treated as different objects, but I thought that since String is an object, the comparision might work.
Now I realise that this is as ugly as sin and I'm better off overloading the method to take List(Of T) as its parameter, but I'm mostly asking out of curiosity: is there a way of comparing the types List(Of Object1) and List(Of Object2) and getting a positive result, since they are both just List(Of T)?
Right now I have a viewmodel that contains three lists of inputs; textboxinput, dropdownlistinput, and checkboxinput. Each of these lists is a list of input objects, which contain four values; paramenums, paramname, paramtype, and value. I am using these input lists to generate a variable number of fields on a form dependent on how many objects each list contains.
My current problem is that I'm not sure how to validate the variables in the list objects with fluent validation. I know how the behavior of each list should behave with regards to returning Nothing, but I don't know how to code that behavior with FluentValidation.
[Code]...
The thing I want to currently do is confirm that in every object in each of my lists, they all have a value attribute that isn't nothing. Can I do this by validating the input model? Right now, the code works at confirming that the list itself isn't null, but the objects in the list can still contain all null values. Is there a trivial way to do this? Alternatively, should I have set my code up differently?
I have referred to the following question at: Using foreach loop to iterate through two lists. My question is this, with regards to the chosen answer: Can the o.DoSomething be a comparison? As in:
For Each a in ListA.Concat(ListB) If(a from ListA=a from ListB) Then Do Something here End If Next
I'm using VB.Net and would like to know how I can do what I have shown here. That would basically be to iterate through a joined list separately/independently.
Is the size of Lists cached in some way (calculated the first time you call it, and then retained untill some change is made to it), or does it get calculated every time you call the Count property? Same question for arrays.
I am fairly new to VB (have done some VB in excell, but its a bit different)
I have a couple of questions:
1) How do I populate a dropdown list from a Database Row 2?
2) When I create a Database from Acess, where do I save the database? and If I build the exe program later on, will it include the database, or how does it work? I feel completely stupid, but one of the best ways to learn is to try over and over again