Showing posts with label call. Show all posts
Showing posts with label call. Show all posts

Monday, March 26, 2012

Updating controlls outside the UpdatePanel?

Hello,

I need to update a label that is NOT within my updatepanel control..
If I just try to modify it in the codebehind call of my trigger button, nothing happens... makes sense for me because its not included to the panel.

Is there a possibility to manage this?

Thanks in advance,
Andy

If there is some reason why it isn't in the updatepanel, you could put it in its own updatepanel that is set to conditional with a trigger to that button.

Hi Andy,

You can place the label inside an another UpdatePanel and setup the button as the AsyncPostBackTrigger for both UpdatePanels.

Hope this helps,

Saturday, March 24, 2012

Uploading file in chunks using AJAX (or asynchronous call)

Hiya guys,

Just done some work with FileUpload in my AJAX-enabled web application, unfortunately using full-postback, so want to change it using AJAX.

Got some ideas, but not if that way will work, so need some bright ideas maybe from someone who already done something similar. Basically I want to achieve partial postback on uploading files in chunks, so not using the server's memory which can lead to server restart... Just saw some very interesting code snippets, but those were using ActiveXObject, which I would like to avoid.Is it possible to use a ScriptManager in some way to achieve similar results?
I guess it would be using XMLHTTP, as I already did some digging, but I mainly seen this using ActiveXObject.

Anyone with such an experience?

Thanks

Ben

hello.

old ajax code that needs to be ported to the asp.net ajax version, but it might still point you in the right direction:

http://msmvps.com/blogs/luisabreu/archive/2006/12/14/uploading-files-without-a-full-postback.aspx


Hi,

Here is a sample:

PageA.aspx:

<%@. Page Language="C#" %>

<%@. Register src="http://pics.10026.com/?src=Gallery.ascx" TagName="Gallery" TagPrefix="uc1" %>
<%@. Register src="http://pics.10026.com/?src=Upload.ascx" TagName="Upload" TagPrefix="uc2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
Upload1.Button1clientID = Gallery1.Button1clientID;
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

</div>
<uc1:Gallery ID="Gallery1" runat="server" />
<uc2:Upload ID="Upload1" runat="server" />
</form>
</body>
</html>

Gallery.ascx:

<%@. Control Language="C#" ClassName="Gallery" %>

<script runat="server">

protected void Button1_Click(object sender, EventArgs e)
{
}

protected void Page_Load(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}

public string Button1clientID
{
get
{
return Button1.ClientID;
}
}

</script>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<div style="visibility:hidden"><asp:Button ID="Button1" runat="server" OnClick="Button1_Click" UseSubmitBehavior="false" Text="Button" /></div>
</ContentTemplate>
</asp:UpdatePanel>

Upload.ascx:

<%@. Control Language="C#" ClassName="Upload" %>

<script runat="server">
private string buttonclientID = "";
public string Button1clientID
{
set
{
buttonclientID = value;
}
}
</script>

<script type="text/javascript">
function submitForm(frameName,upload){
document.forms[0].action="PageA.aspx"
document.forms[0].target=frameName;
window.setTimeout(function(){
var uploadE=document.getElementById(upload);
uploadE.parentElement.appendChild(document.createTextNode(uploadE.value));
uploadE.parentElement.replaceChild(uploadE.cloneNode(true),uploadE);
},100);
document.forms[0].submit();
document.getElementById("<%=buttonclientID %>").click();
}
</script>

<div id="Div1">
<input type="file" name="upload" id="upload" />
<button onclick="javascript:submitForm('hiddenFrame','upload')">Upload</button>
<iframe name="hiddenFrame" src="http://pics.10026.com/?src=blank.htm" id="hiddenFrame" style="display: none">
</iframe>
</div>

An Ajax Alternative for FileUpload:

We've all embraced Ajax as a revolutionary technology, but many of us forget (or are not aware) of asynchronous posts in the times before XmlHttp requests. Our good old friend the IFrame used to be the preferred option for asynchronous http communications. Because an iframe is in essence it's own browser window, it can be used to fire off asynchronous requests (both POST and GET). However, even more important is an IFrame's ability to be a 'target' of a form POST. By adding an IFrame to the page and setting it as the target of the form post, you can in essence create an asynchronous file transfer.

For more help about Ajax Alternative for FileUpload, Please check: http://blogs.infragistics.com/blogs/tony_lombardo/archive/2007/04/09/file-uploads-where-s-the-ajax.aspx

NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you.

Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations

regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet,

and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

Best Regards,


hello.

well, simple code, but i still prefer my code since it'll return the response for the upload.

Wednesday, March 21, 2012

Urgent AutocompleteExtender Does not work

Hello ,

I have aproblem with autocomplete extender in Vb website , it does not work at all never call the webservice

here is the code for the page

<asp:TextBox id="TxtITEM_NO" runat="server" CssClass="dbn_tb" Width="225px" autocomplete="off"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AUTOCOMP" runat="server" ServicePath ="MESCService.asmx" ServiceMethod ="GetItemCompletionList"
MinimumPrefixLength="2" CompletionInterval="1000" EnableCaching="true" TargetControlID="TxtITEM_NO" CompletionSetCount="12" />

and this is the code inside MESCService.asmx

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Collections.Generic

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class MESCService
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Shared Function GetItemCompletionList(ByVal prefixText As String, ByVal count As Integer) As String()
If count = 0 Then count = 20
Dim x As New ikrima.DAL.DBAccess
Dim ds As New System.Data.DataSet
ds = x.ExecuteDataSet("select ITEM_ID FROM ITEM_MASTER ")
Dim items As List(Of String) = New List(Of String)

Dim words As Data.DataRow() = ds.Tables(0).Select("ITEM_ID LIKE '" + prefixText + "%'")
Dim num, i As Integer
num = IIf(words.Length < count, words.Length, count)
For i = 0 To num - 1
items.Add(words(i).Item("ITEM_ID").ToString)
Next
Return items.ToArray
End Function

End Class

can any one help me , why this is not work ,

hi ikrima,

Add the following attribute above your webservice class

[ScriptService]

Regards,


Replace this"<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _"line of yours with -----> <ScriptService()> _


Thanks for our replies

i replace my code and change it to <scriptservice()>_ but till now it does not work , and when try to trace my code i found that the autocompleteExtender does not call the webservice , when ever all other ajaxtoolkit is running well

so what is your suggession to solve this ?


HI Ikrima,

Why do you set the propertyautocomplete="off"> ??

Regards,


HI ,

if you rfer to the samplewebsite which is download with AjaxcontrolToolkit source , you will find in the Autocomplete sample they use it ,

actually i try to remove it also but nothing happend

Thanks


Move your MESCService.asmx to your ScriptManager

e.g.

<asp:ScriptManager runat="server" ID="ScriptManager1" EnablePartialRendering="true">
<services>
<asp:servicereference path="~/MESCService.asmx" />
</services>
</asp:ScriptManager>

Hope it works. For it works. For me it does.


Sad , still not working................

Even there is no query on server or any response/request from the page it just ignore it


Sad , still not working................

Even there is no query on server or any response/request from the page it just ignore it


hi i have the same problem in c#,so if u find any solution,please post it here

thanx


replace "<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _" with "<System.Web.Script.Services.ScriptService()> _"


Have you found a solution to your problem?

I found the solution, it seems that the Function name DOES matter. Here is my webservice code returning a generic string array:

Imports

System

Imports

System.Web

Imports

System.Collections

Imports

System.Web.Services

Imports

System.Web.Script.Services

Imports

System.Web.Services.Protocols

Imports

System.Data.SqlClient

<System.Web.Script.Services.ScriptService()> _

<WebService(Namespace:=

"http://tempuri.org/")> _

<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _

<

Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _

Public

Class WebServiceInherits System.Web.Services.WebService

<WebMethod()> _

<ScriptMethod()> _

PublicFunction GetCompletionList(ByVal prefixTextAsString,ByVal countAsInteger)AsString()Dim strArray(2)AsString

strArray(0) =

"abc"

strArray(1) =

"def"

strArray(2) =

"ghi"Return strArrayEndFunction

End

Class

Urgent: Serverside object is null, while calling from an Ajax script

Hi there,

I try to call a method from the an ajaxscript

Sys.Net.WebServiceProxy.invoke(this._servicePath,
this._serviceMethod,
false,
{"MethodInformation":this._MethodInformationValue},
Function.createDelegate(this,this._onMethodComplete),
Function.createDelegate(this,this._onMethodError),
this._currentCallID);
 
you cannot see it, buit these method calls a method on the serverside which is placed in
the Default.aspx.cs, I have also an table object there...
 
 
protected void Page_Load(object sender, EventArgs e)
{
CustomTableControll table =new TabelCustomControll();
...
}
 
know when I try to access the table, I get an NullPointerException...
Where is my faillure there?
Please give me some Advices... its very urgent...
 
thanks in advance,
 
Omid 

Hi Omid,

How is the method defined in the default.aspx.cs?

Are you sure that the request made by the javascript experienced a full life cycle of a normal page? That's to say, is the page_load method fired?


Hi Raymond,

first of all, thank you for your response...

that's the way I defined the method:

 [System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string executeCommand(Object[] MethodInformation)
{
Object[] obj =new Object[MethodInformation.Length - 1];
obj[0] = MethodInformation[0];
string bla = reg.execute(MethodInformation[1]as string , obj)as string;
return bla;
}

and reg.execute looks like these:

public Object execute(string methodName, Object[] args)
{
MethodCallInfo mci =null;
Object ret =null;
try {foreach (DictionaryEntry dein _hash)
{
if ((de.Keyas string).Equals(methodName))
{
mci = de.Valueas MethodCallInfo;
break;
}
}

if (mci ==null)
throw new Exception("method not Found");

Object obj = Activator.CreateInstance(mci.ClassType);
MethodInfo dynMethod = mci.ClassType.GetMethod(mci.MethodName);
if (dynMethod !=null && checkMethodInfo(dynMethod))
{
if (args !=null)
ret = dynMethod.Invoke(obj, args);
else ret = dynMethod.Invoke(obj, mci.MethodArgs); } }catch (ArgumentNullException ae)
{
Console.Error.WriteLine("Please check the MethodName.\n" + ae.StackTrace);
return null;
}
catch (TargetParameterCountException tpce)
{
Console.Error.WriteLine("Number of Parameters passed to MethodInfo.Invoke does not match the number of " +"parameters required by the method declaration. \n" + tpce.StackTrace);
return null;
}
catch (Exception e)
{
Console.Error.WriteLine("ERROR: " + e.Message +" - " + e.StackTrace);
return null;
}

return ret;
}

so as you can see i try to execute the method placed in the Derfault.aspx.cs dynamically.

the method I try to exexute is these:

public string sayHello(string ID)
{

Control c = TimeLineGrid1.FindControl(ID);// HERE I GET NULLPOINTER EXCEPTIONreturn"Hello" + ID;
}

how can I make sure to stay in a page life-cycle?

regards Omid


Omid,

Execuse me, I don't quite understand the logic in your code.

You showed 3 method here, but I don't know what's the relation between them. Can you elaborate it?


Hi Raymond,

I know the hole thing is a little bit confusing... so I try to explain it as we would debug the code.

Lets say we have a Control which produces a table

<cc3:TimeLineGrid ID="TimeLineGrid1" runat="server" OnMouseOverColumn="document.current_id = this.id;" EndTimeperiod="17:00" FixedTimeperiod=true StartTimeperiod="08:00" TimePeriod="60" EndDateTimescale="2007-06-05" FixedTimescale=true StartDateTimescale="2007-06-04"
Header="Bla Test" ShowHeader="True" OnMouseOverRow="document.current_id = this.id;" AutoPostBack="True" />
 
and the generated Row from the table looks like these:
 
<tr id="TimeLineGrid1_1" class="DEFAULT">
<td id="TimeLineGrid1_1_0" class="CARER">Omid</td>
<td id="TimeLineGrid1_1_1" colspan="10">
<div id="div_working_1_1_1" class="working" style=" width:618px; "
methodName="sayHello" onmouseover="document.current_id = this.id;" >
9:0
</div>
</td>
<td id="TimeLineGrid1_1_2" colspan="10">
<div id="div_notworking_1_2_2"
class="notworking"
style=" width:96px;float:left; "
onmouseover="document.current_id = this.id;" >
</div>
<div id="div_working_1_2_3"
class="working"
style=" width:520px;float:left; "
onmouseover="document.current_id = this.id;" >
9:0
</div>
</td>
</tr>
ok and than we have an AjaxExtender for the Control:
 
<cc2:AjaxControl4WebGridExtender ID="AjaxControl4WebGridExtender1" runat="server" TargetControlID="TimeLineGrid1"ServiceMethod="executeCommand">
</cc2:AjaxControl4WebGridExtender>
  and know the extender calls on a click event the following code:
 
populate : function(_MethodValue) {
if (this._servicePath &&this._serviceMethod) {
var m = document.getElementById(_MethodValue).attributes["methodName"].nodeValue;
alert(m);
this._MethodInformationValue =new Array(_MethodValue, m);this._CallerIDValue = _MethodValue;
Sys.Net.WebServiceProxy.invoke(this._servicePath,
this._serviceMethod,
false,
{"MethodInformation":this._MethodInformationValue},
Function.createDelegate(this,this._onMethodComplete),
Function.createDelegate(this,this._onMethodError),
this._currentCallID);
}
},
  so what I am doing upto yet is just calling a JS-method (populate) on a clickEvent,
these method reads the value ob metodName and some other information, put them together and sends them to
the server, that's all...
 
Know we are on the serverside:
 
 here the method inthis._serviceMethod is called, in our case: executeCommand, which is defined as follows:
 
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string executeCommand(Object[] MethodInformation)
{
Object[] obj =new Object[MethodInformation.Length - 1];
obj[0] = MethodInformation[0];
string bla = reg.execute(MethodInformation[1]as string , obj)as string;
return bla;
}

what the method is doing, is just calling a method dynamically and returns its return value...

in our case the executeCommand is calling the sayHello method as defined in the generated code (methodName="sayHello").

and here sayHello trys to access the control object and gets a nullpointerException...

I hope these will help both of us a littlebit out ;) ...

regards Omid


It's quite clear now.

Please note that executeCommand is a static method. And the control it tries to visit isn't instantiated, thus an exception is thrown.


sorry for my asininity,

but it's not so clear for me, what you want me to sayCrying

could you please give me a code example / or some more words ...

what I don't understand is why the table is created, but by comming back to the serverside it

doesn't exists anymore...

when I remove the static tag I get an:Web Service call failed: 500

so should I create every time I get an server side call a new Object of the Control?

regards Omid


An easier explanation is that a regular request for the page has a different life cycle to the request made by the javascript.

The control isn't created in the later situation, so can't be used.

May be you can tell me more about your requirements, then we can try to find a solution.


Hi again,

what I aim to do is, that each cell in the table, must have the possibility to execute

a different method on a specific Event (e.g. onClick) on the serverside... I think thats the

hole story Wink. That's why I wrote an Register, where the developer cann register some methods and in

the generated tag there is the method that should be executed (methodName)...

hopefully you have the ultimate solution, I'd be gladEmbarrassed

thanks for helping me so much,

Omid


And is this method able to control the layout/content of a control on the page?


My idea is that this method should be independent of the controls on the page. Any control it tries to access should be instantiate in the method itself.


Hi Raymond,

the problem is when I instantiate the control each time, then I don't / can't recreate the actual state of the control, since many things

are created by the developer from "the outside".

What do you think about a partial (asynchronous)PostBack? By the way, you know any rsources, how it works and how to implement it...

regards Omid


Omid,

If you want to make your extender user get rid of caring about the state of the control totally, you need to add a hiddenfield on the page. Save the control's state in it. And send its value to the server everytime.

Regarding your second question, I'm not quite sure what is it about. It's a little bit too common to answer. Can you be more specific?


Hi Raymond,

I decided to do it as you said, to save the state of the control in a hiddenfield:

HiddenField _hiddentbl =new HiddenField();
_hiddentbl.ID ="htbl";
_hiddentbl.Value =this._tbl;
Controls.Add(_hiddentbl);

but I get the following Errror:

Error 2 Cannot implicitly convert type 'System.Web.UI.WebControls.Table' to 'string' C:\Dokumente und Einstellungen\Administrator\Eigene Dateien\Visual Studio 2005\Projects\AJAXEnabledWebControl\TimeLineGrid\TimeLineGrid.cs 231 32 TimeLineGrid

is there a way to save the object in such a hiddenfield? do I have to override the toString() method and create a new Object from the String?

thanks,

Omid


Omid, the code you posted won't generate this error, please post the code the code in TimeLineGrid.cs. It's where the error occurred.

URL WebRequest & cross domain web services

Initially, I would like make a web services call with cross domain (ajax). Since RC doesnt support it at the moment. So, I'm looking for an alternative.

- One is a bridge method,http://forums.asp.net/thread/1510827.aspx
But when will CTP support it?

- Another way to use WebRequest. However, there is an error "Access is denied" when I trying to access standard URL. ( change L17 to L16)

Please take a look at L16, L17

1<%@dotnet.itags.org. Page Language="C#" %>23<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">45<html xmlns="http://www.w3.org/1999/xhtml" >6<head runat="server">7 <title>Web Request</title>8 <script type="text/javascript">9 function MakeWebRequest()10 {11 var displayElement = document.getElementById("ResultId");12 displayElement.innerHTML = "";13 wRequest = new Sys.Net.WebRequest();14 Sys.Net.WebRequestManager.add_completedRequest(On_WebRequestCompleted);1516 wRequest.set_url("http://www.asp.net");17 //wRequest.set_url("getTarget.htm");1819 Sys.Net.WebRequestManager.executeRequest(wRequest);20 }2122 function On_WebRequestCompleted(executor, eventArgs)23 {24 var displayElement = document.getElementById("ResultId");2526 if(executor.get_responseAvailable())27 {28 displayElement.innerHTML = "";29 displayElement.innerHTML += executor.get_responseData();30 }31 }32 </script>33</head>34<body>35 <form id="form1" runat="server">36 <asp:ScriptManager runat="server" ID="scriptManagerId"/>37 </form>3839 <h1>Make a Web request:</h1>40 <button id="Button1" title="adds and remove handlers, too" onclick="MakeWebRequest();">Web Request</button>41 <hr />42 <div id="ResultId" style="background-color:Aqua;"></div>43</body>44</html>45
Unfortunately, webrequest internally uses XmlHttpRequest which does not work for cross-domain calls for security reasons. BTW The web service proxy layer internally uses WebRequest so it does not work for that too. The CTP versions used to have an IFrameExecutor which mysteriously got removed in the latest CTP. The IFrameExecutor allowed cross-domain calls. Now as far as handling cross-domain calls you can do it from the server. For instance you can develop an Generic HTTP handler which will take the URL of the target cross-domain page and return its contents. Save the code of the following examples in Delegate.ashx in your web site. The you can invoke the request to the following url:

delegate.ashx?url=www.asp.net

The server will then download the contents ofwww.asp.net and return it. Here is the code of the handler:

------

<%@. WebHandler Language="C#" Class="LoadRssFeed" %>using System;using System.Web;using System.Net;public class LoadRssFeed : IHttpHandler{ private HttpContext _context; public HttpContext Context { get { return _context; } } public HttpResponse Response { get { return Context.Response; } } public HttpRequest Request { get { return Context.Request; } } public void ProcessRequest(HttpContext context) { this._context = context; string url = Request.QueryString["url"]; if (String.IsNullOrEmpty(url)) { Response.StatusCode = (int)HttpStatusCode.NotFound; return; } try { WebRequest request = WebRequest.Create(url); HttpWebResponse webResponse = (HttpWebResponse)request.GetResponse(); if (!String.IsNullOrEmpty(webResponse.ContentEncoding)) { try { Response.ContentEncoding = System.Text.Encoding.GetEncoding(webResponse.ContentEncoding); } catch (ArgumentException ex) { System.Diagnostics.Trace.WriteLine(ex.ToString()); } } Response.ContentType = webResponse.ContentType; Response.StatusCode = (int)webResponse.StatusCode; Response.StatusDescription = webResponse.StatusDescription; byte[] buffer = new byte[4096]; System.IO.Stream stream = webResponse.GetResponseStream(); for (; ; ) { int read = stream.Read(buffer, 0, buffer.Length); if (read == 0) break; if (read > 0) Response.OutputStream.Write(buffer, 0, read); } } catch (ArgumentNullException ex) { Response.StatusCode = (int)HttpStatusCode.NotFound; System.Diagnostics.Trace.WriteLine(ex.ToString()); } catch (System.Security.SecurityException ex) { Response.StatusCode = (int)HttpStatusCode.Forbidden; System.Diagnostics.Trace.WriteLine(ex.ToString()); } catch (UriFormatException ex) { Response.StatusCode = (int)HttpStatusCode.BadRequest; System.Diagnostics.Trace.WriteLine(ex.ToString()); } catch (Exception ex) { Response.StatusCode = (int)HttpStatusCode.InternalServerError; System.Diagnostics.Trace.WriteLine(ex.ToString()); } } public bool IsReusable { get { return false; } }}

Thanks Rama Krishna, I would like to ask if there exists any methods so that

"the page sends some data to an external aspx page (using post and get method) and get result page in client side only using js or atlas client"

urlrewriter and Microsoft Ajax gives me a Web Service call failed: 405

I'm using the Dynamic Populate Extender

And it gives me a

Web Service call failed: 405

Error if I'm accessing the page through a rewritten URL

featureD_properties.html
is
index.aspx?PageID=featured&agent=11

rewritten

the html one throws that error the other one doesn't...

why?

I'm using
http://www.urlrewriter.net/

you cannot use "HTML" or anything except "ASPX" as a suffix for your url when you are abut urlredirecting ,

read the PDF available on the http://www.urlrewriter.net/ it is mentioned there .


what?

I have no idea what you're talking about

The Server URL is ASPX and HTML is the URL being rewritten

The Client URL is

featureD_properties.html

and it gets rewritten to without incident

~/index.aspx?PageID=featured

That's what URLrewriting is... I think I completely missed your point or what you're trying to say....


I guess you use visual studio dev server so you can map anything but in the real world we use IIS , and IIS sends only "ASPX" files to asp.net to manage so other things (including HTML ) won't be managed by asp.net so you cannot use any other " extension " except "ASPX". Read the "readme" file on URLrewriting.net website it is clearly motioned there, though you can config your IIS to manage HTML extensions as well so you can map your addresses on HTML extensions(or anything else like .ME ! ) but usually you cannot config your hosting server !


I'm not using the dev server I'm using IIS
URLRewriting HTML extensions to a server extension on the web site is a really common practice especially in SEO scenarios

I could make the extension .Imuhhappymonkey

It doesn't matter it's just some random assortment of letters that you map to something that's it ASPX is just the default that it uses I could map ASPX to anything i want

I'm operating with dedicated Windows 2003 Servers so I can do whatever I want to to the hosting server...

The problem is that the webservices and the asmx files don't want to play nicely with the urlrewriting package...


Hi,

Please refer to this post for the explanations about why ajax extension usually has problem with URL rewriting. http://forums.asp.net/p/1153763/1890972.aspx#1890972

Usage of CallBack Implementation in TAB Control of AJAX

The requirement is like i have to select different selection criteria in different tabs of tab control of ajax.

i have implemented call back functionality in one tab for getting the values of gridview dynamically. in the first tab its all working fine.

but the thing is call back implementation is getting the same value from the selected row of gridview in all tabs.

So can u do the needful so that i can able to get different selected values of gridview in different tabs of tab control using call back implementation.

Hi,

Thank you for your post!

But I am afraid I cann't understand you well, would you please provide with any code or a simple repro?

Best Regards,

Use dynamic parameters when calling web service from javascript

Hello,

I would like to call a web services from javascript with dynamic parameters. I don't know the count and the value of the params that I'll set.

Here is a part of my code :

var serviceMethod =new Sys.Net.ServiceMethod(_servicePath, _serviceMethod, _appUrl);var paramArray =new Array(_serviceMethodParameters.length);for(var i = 0 ; i < _serviceMethodParameters.length ; i++ )

{

var toto = _serviceMethodParameters[i].get_Key();var tata = _serviceMethodParameters[i].get_Value();var elem = { toto : tata };

paramArray.push(elem);

}

_request = serviceMethod.invoke(paramArray, onMethodComplete, onMethodTimeout, onMethodError, onMethodAborted,

this , _timeoutInterval, _priority);

the problem that I have is actually I don't figure out the data format of the parameters

I would like the variable toto to be not interpreted as "toto", but as the content of the variable toto.

I could do this in another way, but I have to use this method to call a web service because I need to abort it if needed.

Any ideas about that?

Thanks in advance

Would something like this do the trick?

var elem = {};
elem[toto] = tata;
paramArray.push(elem);

Hope that helps,
-Hao


yes, it's working now, but now i've another problem : the parameter format is not correct.

When the webservice is called, it returns an error which is :

"error: Invalid object passed in, '{' expected. (1): [{\"last\":\"5000\"}]"


I actullay got it !! :)

I didn't need to use an Array to set the parameter but only a variable, kind of hashtable

I write the code if it could help someone who has the same problem.

here is the code :

var serviceMethod =new Sys.Net.ServiceMethod(_servicePath, _serviceMethod, _appUrl);var elem = {};for(var i = 0 ; i < _serviceMethodParameters.length ; i++ )

{

var toto = _serviceMethodParameters[i].get_Key();var tata = _serviceMethodParameters[i].get_Value();

elem[toto] = tata;

}

_request = serviceMethod.invoke(elem, onMethodComplete, onMethodTimeout, onMethodError, onMethodAborted,

this ,_timeoutInterval, _priority);