Asp.net - .net Ashx Web Handler How To Return Lists?

Mar 2, 2012

I have a vb.net web handler which builds two strings The strings basically looks like this:

["filename", "filepath"],["filename", filepath"],...,["filename", filepath"]

I need to return it in a way that the strings are sent with the name of the list, followed by the list

["listname": {["filename", "filepath"],["filename", filepath"],...,["filename", filepath"]}

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?

View 1 Replies


ADVERTISEMENT

Asp.net - Find What Process Called ProcessRequest In An .ashx Web Handler File?

Jan 31, 2012

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?

View 1 Replies

Asp.net - Return Re-sized Image From Database Through .ashx

Aug 8, 2011

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.

View 3 Replies

Image Bind - Onversion From String "Handler.ashx?ID=" To Type 'Double' Is Not Valid

Aug 11, 2011

<asp:TemplateField
HeaderText="Image">

<ItemTemplate>

[CODE]...

When i run my form then it will show this.......and using vb.net. onversion from string "Handler.ashx?ID=" to type 'Double' is not valid.

View 2 Replies

.ASHX File Not Being Called?

Feb 20, 2012

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.

Imports System.Web
Imports System.Web.Services
Imports System.Data.SqlClient

[Code]....

View 1 Replies

Sorting 2 Lists Based On Only One Of The Lists?

Apr 1, 2011

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

View 3 Replies

C# - Which Better To Use For Handling Requests Aspx Or Ashx?

Mar 14, 2011

i am creating a httpRequest handler to download files my question is which better to use aspx or ashx ?

View 3 Replies

Getting File From .ashx With A JQuery Post?

Jan 11, 2012

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.

View 1 Replies

Call An ASHX From Inside An ASPX.VB Function?

Feb 24, 2009

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.

View 2 Replies

Know If An Array Of Lists Contains Similar Items (similar Lists)?

May 20, 2010

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):

[Code]...

View 14 Replies

Firing An Event Handler From Within A Nother Event Handler?

Aug 27, 2011

How do I get a Event Handler to fire from within a nother Event Handler?

View 6 Replies

.net - Event Handler Is Never Called Because The Original Event Is Raised In Another Event Handler?

Apr 18, 2011

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

[code]....

View 2 Replies

[VB 2010] Return Alert Message If SQL Query Return No Records

Dec 12, 2011

I use this code to return records in a DataGridView:

[Code]....

View 3 Replies

Return An Object As The Return Value Through A RealProxy Transparent Proxy?

Oct 7, 2010

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

[Code]...

View 1 Replies

Remove An Event Handler From Within The Event Handler?

Mar 21, 2012

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?

View 1 Replies

For Each Loop - Two Lists?

Jul 24, 2010

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).

View 2 Replies

Passing Lists From WCF To WCF In VB?

May 13, 2011

I'm trying to populate one list from another. I would think this code should work, but at the end of the day I get a list of identical items.

Public Sub WriteDatFile(ByRef lstReasons As System.Collections.Generic.List(Of LetterReason))
Dim tmplstReason As New TCPService.LetterReason

[Code]....

View 2 Replies

VB Lists And Calculations?

Jun 6, 2011

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.

View 6 Replies

Display The Lists Of Costs ?

Mar 20, 2011

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.

View 6 Replies

.net - Compare Different Generic Lists?

Mar 2, 2011

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)?

View 3 Replies

Compare Differences Between Lists?

Feb 17, 2011

Compare differences between lists?I have two sets of lists below[code]...

View 1 Replies

Comparing 2 Lists Name And Price?

Dec 17, 2009

I'm creating <!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-

[code].....

View 2 Replies

FluentValidation With Lists Of Objects?

May 31, 2012

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?

View 1 Replies

Grab, And Lists All Into A Listbox?

Aug 27, 2011

<a href="http://www.websitename.com/Name" data-hovercard="/ajax/hovercard/user.php?id=100054545">Name</a>

how to grab, and lists all into a listbox?

View 1 Replies

How To Loop Through Two Lists Simultaneously

Apr 12, 2011

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.

View 4 Replies

Is Size Of Lists Cached In Some Way

Jan 17, 2010

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.

View 11 Replies

Lists() And Data Structures

Sep 1, 2009

Can a list class in vb.net contain Data Structures ?

View 1 Replies

Merging 2 Lists In LINQ?

Jun 9, 2011

I have two Lists of custom objects:

List1: Year, Month, ValueA
List2: Year, Month, ValueB

I want to get a third List with a merge between the two:

List3: Year, Month, ValueA, ValueB

Is there any elegant way to perform that in LINQ VB.Net?

Example:

List1:
2010 - 6 - 2
2010 - 7 - 5

[Code].....

View 1 Replies

Moving Lines Between Lists?

May 16, 2011

how I would be able to move a line from one list box to another?

What I need to do is read a text file, populate the lines in list boxes (automatically sorting them by set groups, defined in the text file).

Then I want to move the names between the boxes to my desire, the hit save and it will write them all back into the same text file.

View 2 Replies

Populate Drop Down Lists?

Apr 5, 2011

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

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved