Process Array Returned By Active X Control(VB) In Javascript?

Dec 7, 2010

I am developing an active x control for IE which is invoked through javascript. The active x control is developed in visual basic and it an array of strings. How will I use this array of strings in javscript.

Eg :-

var a = new Array()
a = objActiveX.GetArray(); // call to active x returns array of string, how will I loop through this in javascript. The above line does not work.I want to loop through each string in javascript.

View 1 Replies


Similar Messages:

ADO.NET :: Process Returned List - Remove Duplicate Row

Mar 4, 2011

I have a linq statement that retrieves several rows from a stored procedure and maps them to a custom class. The rows returned could contain mulitple instances of the same ID

eg
id date total
1 01/01/2011 3
2 01/02/2011 2
3 02/03/2011 5
1 01/01/2011 3

the stored procedure perfoms some complex calculations to return the data How can I remove the duplicate rows in the list ive returned? Ive tried distinct but it doesnt work I want to process the RETURNED list (as there are only 4 rows here, i want to end up with 3) and just have 1 instance of ID 1.

View 4 Replies

C# - Test A Returned Array Contains At Least One Value With A Certain Property Value?

Oct 18, 2010

I have a method I wish to test:

public Cars[] GetCars();

I want to test that the array returned by this method contains at least one car which is of type "Mustang".

How would I actually do this?

Currently I have code like:

[Test]
public void GetCars_ReturnsMustangs()
{
Cars[] cars = GetCars();
foreach(Car car in cars)
{
Assert.IsTrue(Car.Type == "Mustang");
}
}

While this works as a test as far as I can tell I'm aware it's not a good idea to put loops inside the test?

View 4 Replies

WCF / ASMX :: Consume An Array Of Structs Returned By A Web Service?

Jan 3, 2011

A sample web service app I have been practicing with has two web methods:
1) HelloWorld -- which I can read the data from no problem - just a string
2) ClientData[] -- which returns an array of struct objects -- this is where I have the question.

Here is my instantiation of the webservice in my winform app for reading from HelloWorld

myWebSvc1.WebService1 s1 = new myWebSvc1.WebService1();
string y = s1.HelloWorld(); //--no problems so far here
Console.WriteLine(y);
//--but when I add the call to GetClientData() I have a problem
List<ClientData> ls = new List<ClientData>(s1.GetClientData(3)); //--problem here

public struct ClientData
{
public String Name;
public int ID;
}
[WebMethod(CacheDuration = 30,
Description="Returns an array of Clients.")]
public ClientData[] GetClientData(int Number)
{
ClientData [] Clients = null;
if (Number > 0 && Number <= 10)
{
Clients = new ClientData[Number];
for (int i = 0; i < Number; i++)
{
Clients[i].Name = "Client " + i.ToString();
Clients[i].ID = i;
}
}
return Clients;
}

If I browse the .asmx file -- the sample xml returns the following if I enter 3 for GetClientData function param

<?xml version="1.0" encoding="utf-8" ?>
- <ArrayOfClientData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://codeproject.com/webservices/">
- <ClientData>
<Name>Client 0</Name>
<ID>0</ID>
</ClientData>
- <ClientData>
<Name>Client 1</Name>
<ID>1</ID>
</ClientData>
- <ClientData>
<Name>Client 2</Name>
<ID>2</ID>
</ClientData>
</ArrayOfClientData>

From my winform app I get the following error messages when trying to add the GetClientData function call above --

Error 1 The best overloaded method match for 'System.Collections.Generic.List<DSS_2008.Form7.ClientData[]>.List(System.Collections.Generic.IEnumerable<DSS_2008.Form7.ClientData[]>)' has some invalid arguments

Error 2 Argument '1': cannot convert from 'DSS_2008.myWebSvc1.ClientData[]' to 'System.Collections.Generic.IEnumerable<DSS_2008.Form7.ClientData[]>'

Error1 The best overloaded method match for 'System.Collections.Generic.List<DSS_2008.Form7.ClientData[]>.List(int)' has some invalid arguments

Error 2 Argument '1': cannot convert from 'DSS_2008.myWebSvc1.ClientData[]' to 'int'

How can I fix this so that I can read the result into my winform app?
//--sample web service

namespace MyService
{
using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
public struct ClientData
{
public String Name;
public int ID;
}
/// <summary>
/// Summary description for WebService1.
/// </summary>
[WebService(Namespace="http://codeproject.com/webservices/",
Description="This is a demonstration WebService.")]
public class WebService1 : System.Web.Services.WebService
{
//--source of sample:
http://www.codeproject.com/KB/webservices/myservice.aspx
private const int CacheHelloWorldTime = 10; // seconds
public WebService1()
{
//CODEGEN: This call is required by the ASP+ Web Services Designer
InitializeComponent();
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
//WEB SERVICE EXAMPLE
//The HelloWorld() example service returns the string Hello World
//To build, uncomment the following lines then save and build the project
//To test, right-click the Web Service's .asmx file and select View in Browser
//
[WebMethod(CacheDuration = CacheHelloWorldTime,
Description="As simple as it gets - the ubiquitous Hello World.")]
public string HelloWorld()
{
return "Hello World bbb";
}
[WebMethod(CacheDuration = 30,
Description="Returns an array of Clients.")]
public ClientData[] GetClientData(int Number)
{
ClientData [] Clients = null;
if (Number > 0 && Number <= 10)
{
Clients = new ClientData[Number];
for (int i = 0; i < Number; i++)
{
Clients[i].Name = "Client " + i.ToString();
Clients[i].ID = i;
}
}
return Clients;
}
}
}

View 1 Replies

Javascript - How To Get TabIndex Property Of Currently Active Control

Feb 23, 2011

How do I find the TabIndex property of the control who has the active focus at runtime.I am using UlitmateEditor(Text Editor) i.e User Control , so i want focus inside the body of that Editor.

View 3 Replies

How To Get Tab Index Of Active/focused Control On Page Using Javascript

Feb 23, 2011

I have controls on my page, is there any way I can get the tabIndex of active control or focused control?

View 1 Replies

Web Forms :: Getting An Array Of List From Database To Client Side(javascript Array)?

May 12, 2010

Iam getting an array of list from database to client side(javascript array). Now my aim to place those values in a div one by one and that div should attach to the textbox similar to Autocomplete extender.

View 4 Replies

WCF / ASMX :: Recycling AppPools Without Interrupting Active Worker Process?

Oct 25, 2010

we're hosting a webservice that runs with up to 9 worker processes in it's application pool. There's a memory limit configured for the application pool to keep the system/server performant. Now my concern is that, if the memory limit is reached, a worker process may be recycled although there is an active request handled by this worker process that needs to be responded/finished first. The problem is especially with purchase/order requests, as such requests typically run several minutes and must not be aborted by any worker process recycle process. Is there any configuration setting that allows me app pool recycling by granting that no active process will be abandoned?

View 1 Replies

Pass C# Array To Javascript Array?

Aug 12, 2010

how to pass a C# ASP.NET array to a Javascript array? Sample code will also be nice.

Let's say for simplicity that in my aspx.cs file I declare:

int [] numbers = new int[5];

now I want to pass "numbers" to the client side and use the data in the array within javascript. How would I do this?

View 4 Replies

Active Directory/LDAP :: Active X Control Not Loading On Second Time?

Jan 29, 2010

i created an Active X Control for my web Form first time when i executes my page its works fine.. but when i modified my Active X Control then place my ActiveX Control dll to my web site root directory then my Active X Control is not loading on my Web page..

View 2 Replies

Active Directory/LDAP :: Getting Error "A Referral Was Returned From The Server."

Mar 16, 2010

I am trying to use ActiveDirectory/Windows Authentication. However I am having problems with the connection string for this

<membership defaultProvider="MembershipADProvider">
<providers>
<add

It seems as if the Connection String is the Problem

<add name="ADConnectionString" connectionString=LDAP://Server/DC=Server/OU=Users />

Note that Server is an alasis for the actual server name (www.someurl.com) and I am attempting to get this solution to run on localhost/visual studio. The error I seem to be getting is "A referral was returned from the server." Not sure if I need to specify a username/password (how?), if the URL syntax is wrong, that I'm trying to connect to the server remotely, the fact that 'server' is an alias or what.

View 2 Replies

WCF / ASMX :: "Cannot Create Active X Component" Error Returned From Webservice When Deployed On Server - Works

Mar 7, 2011

I have created a webservice to populate bookmark fields in a word document with values passed out from an adobe flex app. The document is based on a .dot template that is held on a share on the server. The aspnet user has read access to the share If i run the asmx on my local machine, it all works fine. If i run the asmx when deployed to the webserver I get an error "cannot create activex component" returned. I have set impersonate = true in the web.config on the webservice that is deployed on the server. The code for the webservice itself is very simple:

[Code]....

I have also checked that the microsoft.office.interop.word is in the gac on the server (i am using office 2003). I really don't understand what the issue is, obviously for the application to go live the webservice will have to be deployed to the server and I am happily calling other webservices that exist on the server from my flex application with no issues.

View 7 Replies

Javascript Calls To An Ajax WebMethod. How To Get Multiple Output Params Returned

Apr 24, 2010

I know how to call a simple old fashion asmx webservice webthod that returns a single value as a function return result. But what if I want to return multiple output params? My current approach is to separate the params by a dividing character and parse them on teh client. Is there a better way.

Here's how I return a single function result. How do I return multiple output values?

<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx" />
[code]....

View 2 Replies

How To Dynamically Create A Fully Functional Gridview In Javascript With The Results Returned From A Script Service

Jan 8, 2010

i need to create a fully funnctional gridview with the results returned from a script serice ( AJAX enabled WCF Service ).

The grid should allow user to sort and page the data.

could any body drive me to the proper technology or a useful link.

View 1 Replies

Javascript - Not Pushing To Array?

Jul 22, 2010

Trying to push some coordinates, as well as some stuff specified in a form by the user, to an an array called "seatsArray". Here's my code:

<div>
<img onLoad="shiftzoom.add(this,{showcoords:true,relativecoords:true,zoom:100});" id="image" src="plan1.bmp" width="1024" height="768">
</div>
<script type="text/javascript">
var seatsArray = [];
</script>
<br><input id="backnave" type="radio" name="area" value="backnave" /> Back Nave<br>
<input id="frontnave" type="radio" name="area" value="frontnave" /> Front nave<br>
<input id="middlenave" type="radio" name="area" value="middlenave" /> Middle nave<br>
<input type="radio" id="standardseat" name="seat" /><label for="radio1">Standard</label><br>
<input type="radio" id="wheelchairseat" name="seat" checked="checked" /><label for="radio2">Wheelchair</label><br>
<form id="my_form" action="savetext.aspx" method="post" onsubmit="return prepare()">
<input type="text" id="file_name" name="file_name" rows="1" cols="20" />
<input type="hidden" name="seatsArray" />
<input type="submit" value="Save" />
</form>
<form id="my_form" action="savetext.aspx" method="post" onsubmit="return prepare()">
<input type="text" id="file_name" name="file_name" rows="1" cols="20" />
<input type="hidden" name="seatsArray" />
<input type="submit" value="Save" />
</form>
<script type="text/javascript">
function prepare();
{
document.getElementById('seatsArray').value = seatsArray.join();
return true;
}
</script>
<script type="text/javascript">
var coordinates = document.getElementById("image");
coordinates.onclick = function(e) {
e = e || window.event;
if (e && e.pageX && e.pageX) {
e.posX = e.pageX;
e.posY = e.pageY;
} else if (e && e.clientX && e.clientY) {
var scr = {x:0,y:0},
object = e.srcElement || e.target;
//legendary get scrolled
for (;object.parentNode;object = object.parentNode) {
scr['x'] += object.scrollLeft;
scr['y'] += object.scrollTop;
}
e.posX = e.clientX + scr.x;
e.posY = e.clientY + scr.y;
}
var desc = "";
if(document.getElementByID("backnave").checked) {
desc = "BN, "+desc;
} else if(document.getElementByID("middlenave").checked) {
desc = "MN, "+desc;
} else if(document.getElementByID("frontnave").checked) {
desc = "FN, "+desc;
}
if(document.getElementById('wheelchairseat').checked) {
//Wheelchair seat is checked
desc = "Wheelchair "+desc;
}
seatsArray.push(desc + e.posX, e.posY);
}
</script>

But simply nothing is getting pushed to the array. I can tell this as I am using the following ASP.NET to write the array to a text file:

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
string path = Server.MapPath(".")+"/"+Request.Form["file_name"] + ".txt";
if (!File.Exists(path))
{
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(Request.Form["seatsArray"]);
sw.WriteLine("");
}
}
using (StreamReader sr = File.OpenText(path))
{
string s = "";
while ((s = sr.ReadLine()) != null)
{
Response.Write(s);
}
}
}
</script>

The name of the text file is correct according to what the user put in the form "file_name". As you can see I made seatsArray a hidden form object so thats what the ASP.NET is trying to call.

Is something in the javascript in the wrong order or something? Because I just can't get it to fill up that text file.

View 2 Replies

Fill Javascript Array With C#

Aug 7, 2010

How Can i fill an array that defined in javascript with c# in behind code?

EDIT:

here is my code

protected void Page_Load(object sender, System.EventArgs e)
{
string[] locations = new string[] {
"Las Vegas",
"Los Angeles",

[Code]....

View 2 Replies

Progress Updates On Long Process With JavaScript?

Mar 7, 2010

I have an asp.net page that calls a dll that will start a long process that updates product information. As the process is running, I want to provide the user with constant updates on which product that process is on and the status of the products. I've been having trouble getting this to work. I add information to a log text file and I was thinking that I'd redirect to a new page and have that page use Javascript to read from the text file every few seconds. My question is has anyone else tried this and does it work fairly well?

View 3 Replies

Javascript - Process Html Form Response?

Nov 14, 2010

I have an html form that looks like this:

<form name="form_" method="post" id="contactUs" action="myPage.aspx" enctype="text/plain">
<input type="text" class="acc_input" name="mail" id="emailadress" />
<input type="text" class="acc_input" name="name" id="firstName" />
<input type="button" value="Send" />
</form>

Now lets assume that "myPage.aspx" returns "Done" if success or returns "Error" if fails.I want to display an alert showing the result.How do i handle the myPage.aspx response?

View 1 Replies

MVC :: How To Send Javascript Array To Server

Oct 25, 2010

i have a array in javascript and need to send to server how i can send it in jquery and get them in controller . to send javascript array and get them in controller [c#]

View 2 Replies

C# - Send A Variable Or Array From Javascript?

Feb 28, 2011

I would to know how to pass variables. I have a variable in javascript but I dont know how to pass it to a textbox. I have read it is so easy using ajax, but I dont know how to use it. I believed this was just for not to have reload. Well, then how do I do it? I read I must use get and post, but I dont know how to use it.. for example I have the code:

function guardar() {
var completo = "hola mundo";
}

How do I get the variable completo to pass it in a textbox?

View 1 Replies

Web Forms :: Get An Array Width In Javascript?

Jan 23, 2011

If I have an array with 1 row of 20 items, how can I get the width (20).

I know I can get the length with array.length.

I have tried getting it with array.width"

View 6 Replies

Web Forms :: Add The Numbers To An Array In Javascript?

Jan 19, 2011

I know that I can declare an array using the following method, but assume there is an easier way.

var elem as new Array();

elem[0] = 1;
elem[1] = 2;
elem[2] = 3;
and so on......

Is there a short cut to simply adding the numbers 0 -20 to an array, and is there a shotcut to adding the 20 nuumbers minus a few such as 3, 9, and 17?

View 4 Replies

Serializing A Javascript Array With Jquery?

Sep 28, 2010

I have the following code:

<script type="text/javascript">
var checksSinceLastPostBack = new Array();
function clientSelectedIndexChanged(sender, eventArgs) {
var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
var serializedCheckData = checksSinceLastPostBack.serializeArray();
if (ajaxManager != null)
ajaxManager.ajaxRequest(serializedCheckData);
}
</script>

The

var serializedCheckData = checksSinceLastPostBack.serializeArray();

doesn't seem to work. Am I misunderstanding this?

Also if this works, how would I deserialize it in the code behind?

View 1 Replies

Convert Datatable To JavaScript Array

Jul 11, 2011

I have a datatable that I need to convert into a javascript array. This will allow me to do client-side validations on my webpage.

My datatable has 6 columns. X rows depending of the query results.

I was looking to use Me.ClientScript.RegisterArrayDeclaration but I just can't find how to build my 2-dimentional array to feed to this declaration.

On google I found some exemple for a 1-dimensional array, but nothing for 2-dimentional and I am not good enough in Jscript to figure it out myself.

View 5 Replies

AJAX :: Active Tab Change Using Javascript?

May 20, 2010

Im having a tabcontainer in which im having one more tab container which consist of 3 tab panels.what i want that when i click the parent tab panel i want to change the child tab container's activetabindex.

[Code]....
[Code]....

Im getting activeTab NULL.

View 3 Replies







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