hi
thanx for reply vinay
I guess here you are passing just one value to the UseCallback function what
i want is how can i pass a object array & return the same object array

my object is like as follows

function DDElements(Name,Type,Height,Width,X,Y,PageNumber)
        {
            this.name = Name;
            this.type = Type;
            this.height = Height;
            this.widht = Width;
            this.x = X;
            this.y = Y;
            this.pageNo = PageNumber;
        }

var element = new
DDElements(key,"sign",dd.elements[key].w,dd.elements[key].h,dd.elements[key].x,dd.elements[key].y,indexArray[key]);

after this code I am creating a array
that array i want to pass it to web service method



Thanks & Regards,
Shrinivas Mada,




On Mon, Dec 28, 2009 at 8:52 PM, vinay kumar <[email protected]>wrote:

> <%@ Page Language="VB" AutoEventWireup="false"
>
> CodeFile="Default.aspx.vb" Inherits="_Default" %>
>
> <html xmlns="http://www.w3.org/1999/xhtml";>
>
> <head runat="server">
>
> <title>Customer Details</title>
>
> <script type="text/javascript">
>
> function GetCustomer(){
>
> var customerCode = document.forms[0].TextBox1.value;
>
> UseCallback(customerCode, "");
>
> }
>
> function GetCustDetailsFromServer(result, context){
>
> var i = result.split("|");
>
> customerID.innerHTML = i[0];
>
> companyName.innerHTML = i[1];
>
> contactName.innerHTML = i[2];
>
> contactTitle.innerHTML = i[3];
>
> address.innerHTML = i[4];
>
> city.innerHTML = i[5];
>
> region.innerHTML = i[6];
>
> postalCode.innerHTML = i[7];
>
> country.innerHTML = i[8];
>
> phone.innerHTML = i[9];
>
> fax.innerHTML = i[10];
>
> }
>
> </script>
>
> </head>
>
> <body>
>
> <form id="form1" runat="server">
>
> <div>
>
> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>&nbsp;
>
> <input id="Button1" type="button" value="Get Customer Details"
>
> onclick="GetCustomer()" /><br />
>
> <br />
>
> <table cellspacing="0" cellpadding="4" rules="all" border="1"
>
> id="DetailsView1"
>
> style="background-color:White;border-color:#3366CC;border-width:1px;
>
> border-style:None;height:50px;width:400px;border-collapse:collapse;">
>
> <tr style="color:#003399;background-color:White;">
>
> <td>CustomerID</td><td><span id="customerID" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>CompanyName</td><td><span id="companyName" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>ContactName</td><td><span id="contactName" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>ContactTitle</td><td><span id="contactTitle" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>Address</td><td><span id="address" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>City</td><td><span id="city" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>Region</td><td><span id="region" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>PostalCode</td><td><span id="postalCode" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>Country</td><td><span id="country" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>Phone</td><td><span id="phone" /></td>
>
> </tr><tr style="color:#003399;background-color:White;">
>
> <td>Fax</td><td><span id="fax" /></td>
>
> </tr>
>
> </table>
>
> </div>
>
> </form>
>
> </body>
>
> </html>
>
> Imports System.Data
>
> Imports System.Data.SqlClient
>
> Partial Class _Default
>
> Inherits System.Web.UI.Page
>
> Implements System.Web.UI.ICallbackEventHandler
>
> Dim _callbackResult As String = Nothing
>
> Public Function GetCallbackResult() As String _
>
> Implements System.Web.UI.ICallbackEventHandler.GetCallbackResult
>
> Return _callbackResult
>
> End Function
>
> Public Sub RaiseCallbackEvent(ByVal eventArgument As String) _
>
> Implements System.Web.UI.ICallbackEventHandler.RaiseCallbackEvent
>
> Dim conn As SqlConnection = New _
>
> SqlConnection("Data Source=.;Initial Catalog=Northwind;User ID=sa")
>
> Dim cmd As SqlCommand = New _
>
> SqlCommand("Select * From Customers Where CustomerID = ’" & _
>
> eventArgument & "’", conn)
>
> conn.Open()
>
> Dim MyReader As SqlDataReader
>
> MyReader = cmd.ExecuteReader(CommandBehavior.CloseConnection)
>
> Dim MyValues(10) As String
>
> While MyReader.Read()
>
> MyValues(0) = MyReader("CustomerID").ToString()
>
> MyValues(1) = MyReader("CompanyName").ToString()
>
> MyValues(2) = MyReader("ContactName").ToString()
>
> MyValues(3) = MyReader("ContactTitle").ToString()
>
> MyValues(4) = MyReader("Address").ToString()
>
> MyValues(5) = MyReader("City").ToString()
>
> MyValues(6) = MyReader("Region").ToString()
>
> MyValues(7) = MyReader("PostalCode").ToString()
>
> MyValues(8) = MyReader("Country").ToString()
>
> MyValues(9) = MyReader("Phone").ToString()
>
> MyValues(10) = MyReader("Fax").ToString()
>
> End While
>
> Conn.Close()
>
> _callbackResult = String.Join("|", MyValues)
>
> End Sub
>
> Protected Sub Page_Load(ByVal sender As Object, _
>
> ByVal e As System.EventArgs) Handles Me.Load
>
> Dim cbReference As String = _
>
> Page.ClientScript.GetCallbackEventReference(Me, "arg", _
>
> "GetCustDetailsFromServer", "context")
>
> Dim cbScript As String = "function UseCallback(arg, context)" & _
>
> "{" & cbReference & ";" & "}"
>
> Page.ClientScript.RegisterClientScriptBlock(Me.GetType(), _
>
> "UseCallback", cbScript, True)
>
> End Sub
>
> End Class
> check this some what helpful
>
>
> On Mon, Dec 28, 2009 at 4:05 PM, shree <[email protected]> wrote:
>
>> hello folks ,
>>
>> hope you all doing well ,
>>
>> can I pass array object to from javascript to database and vice versa
>>
>> can we achieve it by using web service . If any one know please let me
>> know ...
>>
>
>

Reply via email to