I am sure it's something dumb.
Using the december preview. How do I update a panel on page load without a timer or a button? Obviously I want this done after the page loads and renders.
Thx
dB.
I am sure it's something dumb.
Using the december preview. How do I update a panel on page load without a timer or a button? Obviously I want this done after the page loads and renders.
Thx
dB.
My goal is to show the serach results in a grid view on a model popup after the user enters the search criteria on a page and presses the search button. The OnClick event handler needs to collect the search criteria, get the dataset after querying the database and bind the data to the gridview before displaying the modal popup.
My problem is that the search button's id can't be assigned to the TargetControlID of the ModalPopupProperties as it will not let the OnClick event be fired and process the postback.
Please suggest the solution/workaround.
Thanks much
Display the ModalPopup via script instead?David,
Do you have an example or a sample of the script that I can take a look at?
The other option would be to dynamically create the popup, after I process my search funcationility. But the question is, how do I invoke the display of the popup after associating the TargetID of the search button to the dynamically created ModelPopup?
Thanks for looking into it.
Vijay
I think this should be a simple task: I have a page that does some lengthy processing and I am using an update panel to show the user that something is happening. Currently, I have to load the page and the user has to press a buttong to start processing. Now, for me, this is a pointless step.. I want the page to kick off the server processing on page load and then display a page with the UpdatePanel which is then updated when the process is complete.
What is the best way to do this?.. Any suggestions?
:)
let me try this idea. once processing starts, you had the actual update panel, and show the update progress control, which gives the idea that processing is going on another page, then show the panel back again.
just a suggestion, since Atlas allows us to work with different parts of the page, somewhat like in windows forms.
a trial.
Regards,
formationusa
repost
Hide instead of had
sorry for the mistake, i have to check my spelling more often.
let me try this idea. once processing starts, you hide the actual update panel, and show the update progress control, which gives the idea that processing is going on another page, then show the panel back again.
just a suggestion, since Atlas allows us to work with different parts of the page, somewhat like in windows forms.
a trial.
Regards,
formationusa
Hi All,
So, I'm starting a new post that is related to my initial post from approximately 7 months ago (http://forums.asp.net/t/1040392.aspx). My hope is to finally find a solution to this problem... here is the issue:
A couple of our Ajax enabled pages have a lot of form fields, thus a user has to scroll to the bottom of the page to view the Submit button. When a control's RequireFieldValidator's EnableClientScript property is set to"true", upon a validation error the page will scroll up to the ValidationSummary. This is the functionality that I desire. But, when a control's RequireFieldValidator's EnableClientScript property is set to"false", upon a validation error the page does NOT scroll up to the ValidationSummary. Why not?
Here is a quick code sample to illustrate the problem:
<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="ValidationTest.aspx.cs"Inherits="Register_Playground_Shamus_ValidationTest" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Validation Test</title>
</head>
<body>
<formid="form1"runat="server">
<div>
<asp:ScriptManagerID="asmScriptManager"EnablePartialRendering="true"runat="server"/>
<asp:UpdatePanelID="udpUpdatePanel"runat="server">
<ContentTemplate>
<asp:ValidationSummaryID="valSummary"runat="server"/>
<!-- Lots of space to induce scrolling upon a validation error. -->
<p>Scroll Down</p>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<asp:TextBoxID="TextBox1"runat="server"/><asp:RequiredFieldValidatorID="RequiredFieldValidator1"EnableClientScript="true"ControlToValidate="TextBox1"runat="server"ErrorMessage="* TextBox1"/><br/>
<asp:TextBoxID="TextBox2"runat="server"/><asp:RequiredFieldValidatorID="RequiredFieldValidator2"EnableClientScript="false"ControlToValidate="TextBox2"runat="server"ErrorMessage="* TextBox2"/><br/>
<asp:ButtonID="Button1"runat="server"Text="Button"/>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
And, the codebehind...
using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partialclass Register_Playground_Shamus_ValidationTest : System.Web.UI.Page{protected void Page_Load(object sender, EventArgs e) { }}The only difference between TextBox1 and TextBox2 is their RequiredFieldValidator's EnableClientScript property (TextBox1 is true and TextBox2 is false). To reproduce the issue:
All I want is for the page to scroll to the top in both scenarios.
Thanks,
-Shamus
So, I fixed the problem with a hack... here is the new codebehind code:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partialclass Register_Playground_Shamus_ValidationTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Page.IsPostBack)
{
Page.Validate();
if (!Page.IsValid)
{
ScriptManager.RegisterStartupScript(this,this.GetType(),"ReturnToTop","setTimeout(\"window.scrollTo(0,0)\",1);",true);
}
}
}
}
By adding a 1 millisecond timeout before calling window.scrollTo() it now works. If you remove the timeout, then when there is a validation error on Textbox2 the page will not scroll to the top. Personally, I hate hacks like this... I would still love to understand why the client vs. server-side validators behave so differently.
I hope this hack helps somebody else...
-Shamus
Yes sure, it will help for others
I have two updatepanels on a page each with a datagrid inside the panels. I need updatepanel B to update it's datagrid when a LinkButton is clicked inside udatepanel A's datagrid. The linkbuttons are dynamically generated for each row of the datagrid.
Thanks
Braden
Stripped Down Example:
<asp:UpdatePanel id="pnl1" runat="server">
<ContentTemplate>
<asp:datagrid id="dgA" runat="server" > ... <asp:LinkButton ID="lbtnSelect" CommandArgument=' ... ' runat="server">...</asp:LinkButton> ... </asp:datagrid>
</ContentTemplate>
</asp:UpdatePanel>
<!-- Next Panel -->
<asp:UpdatePanel id="pnl2" runat="server">
<ContentTemplate>
<asp:datagrid id="dgB" runat="server" > ... </asp:datagrid>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lbtnSelect" EventName=" ... "/>
</Triggers>
</asp:UpdatePanel>
Unless I misread your post, I think that all you need to do is add the following line inside of your event handler for the link buttons (lbtnSelect_Click, or similar):
pnl2.update();
This should update your pnl1 because the linkbutton's click event fired inside of pnl1, andprogrammatically updating pnl2 with pnl2.update() should take care of updating the other datagrid (dgB). You can get rid of the <Triggers> definition too.
I have my web pages that are using web services via atlas technology. when page loads users can click on the links but get error because page has not been loaded yet. How do I know that page loaded on atlas? How do I know that procies are created? can someone provide me some working javascript or what ever is possible to detect it?
thanks and greately appreaciated
Hi,just hook up the load event raised by the global Sys.Application instance. Here's the code to add to your page:
<script type="text/javascript">
<!--
function onLoad() {
// Put your Atlas stuff here.
}
//-->
</script>
<script type="text/xml-script">
<page>
<components>
<application load="onLoad" />
</components>
</page>
</script>
The above code will call the onLoad function (it's a javascript function that you have to define) when all the framework stuff is initialized.
I am sending a webrequest to an aspx page that expects a cookie to exist.
If I access the page directly, it can access the cookie fine. If I access the page over the webrequest, the cookie count is 0 (according to HttpContext.Current.Response.Cookies.Count.ToString()).
Now, on the serverside examples, it seems people have to set the CookieColelction property of the WebRequest obejct. Unfortuantly, according to the documentation -http://ajax.asp.net/docs/ClientReference/Sys.Net/WebRequestClass/default.aspx there is no such property to set in the ajax clientside version of webrequest.
How do I send cookies over a clientside webrequest?
HTTP Cookies are a state management implementation of the HTTP protocol and many Web pages require them. If you're using remote HTTP functionality to drive a Web site (following URLs and the like) you will in many case have to be able to support cookies.I am trying to scroll the page after it loads between postbacks within an Update Panel. I used to have this work with beta 1
<script type="text/xml-script">
<page xmlns:script="http://schemas.microsoft.com/xml-script/2005">
<components>
<application load="onAutoScrollControlLoad" />
</components>
</page>
</script>
I am not sure how I came up with this, but it doesn't work with Beta 2 any more. Any ideas of how to implement the same functionality?
Thx
dB.
found a solution for this -http://forums.asp.net/thread/1418207.aspx
<scripttype="text/javascript">
function onAutoScrollControlLoad() { window.location.href ='#<% Response.Write(ScrollLocation); %>'; }
Sys.Application.add_load(function() { onAutoScrollControlLoad(); });
</script>
I have a fairly large project that is an standard ASP.NET C# site and I'd like to be able to use soem ajax on the main page, nothing big. I've installed ajax and the sample site runs fine, (of course it's been created as an ASP AJAX site from the beginning though). How do I make my ASP site work with ajax? The web config file?
Checkout these videos:
http://www.asp.net/learn/videos/view.aspx?tabid=63&id=81
http://www.asp.net/learn/videos/view.aspx?tabid=63&id=82
I followed the steps in the first video but when I try to add a ScriptManager to a page on my site I get the following error
Error 29 The type or namespace name 'ScriptManager' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?) C:\Path\Default.aspx.designer.cs 74 41
EDIT: I found out how to fix it. The video doesn't say that you had to add a ref to the dll. So after adding a ref toMicrosoft.Web.Extensions.dll, everything seems to work
Hello,
I am using the ASP.Net AJAX client side libraries, and I want to be able to write Web User Controls (ASCX) that I dynamically load into my site. I want to be able to have a global object in my main page that is used by each ASCX control that is loaded into the page. As soon as the ASCX control is loaded, I want it run its script to call a method in the global object.
I am having a "timing problem" with my code. In order to use the ASP.Net AJAX libraries (like the "Type" object to register namespaces, etc.), I have placed the JavaScript on the main page in the "pageLoad" function.
Right now I am using the "setTimeout" function in my ASCX script to delay it a few seconds so I can be sure that the script in the main page has completely loaded before I make a call to the global object.
Is there any way that I can ensure that the script on the main page has loaded and stop using the "setTimeout" method in my ASCX script?
Here is the markup for my main page…
1<%@dotnet.itags.org. Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="StartupScriptTest._Default" %>23<%@dotnet.itags.org. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>45<%@dotnet.itags.org. Register src="WebUserControl1.ascx" tagname="WebUserControl1" tagprefix="uc1" %>67<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">89<html xmlns="http://www.w3.org/1999/xhtml" >10<head runat="server">11 <title>Untitled Page</title>12 <script type="text/javascript">1314 var x = null; // <- I want to access this in the ascx control after pageLoad is finished1516 function pageLoad()17 {18 Type.registerNamespace('MyNamespace');1920 MyNamespace.MyClass = function()21 {22 MyNamespace.MyClass.initializeBase(this);23 }2425 MyNamespace.MyClass.prototype =26 {27 sayHello : function(message)28 {29 alert(message);30 }31 }3233 MyNamespace.MyClass.registerClass("MyNamespace.MyClass");3435 x = new MyNamespace.MyClass();36 }3738</head>39<body>40 <form id="form1" runat="server">41 <div42"ToolkitScriptManager1" runat="server">43 </cc1:ToolkitScriptManager>44 </div>45 <uc1:WebUserControl1 ID="WebUserControl11" runat="server" />46 </form>47</body>48</html>49 …and here is the markup for my ASCX control…
1<%@dotnet.itags.org. Control Language="C#" AutoEventWireup="true" CodeBehind="WebUserControl1.ascx.cs" Inherits="StartupScriptTest.WebUserControl1" %>2<script type="text/javascript">34 setTimeout('x.sayHello("hello")', 1000); // <- Any way to not use 'setTimeout'?56<>
Thank you for your help,
Dave
hello.
i'll just enumerate the things i think that are important:
1. do you need to define the class in the load event? I think that you can put it outside, in an external file and load it so that it's available at the begining of the page
2. are you wrapping any html control or behavior that exists on the page? if not, then i think that you can also insert your x = new class() at the begining of the class declaration.
Hi restating what Luis has said, you gotto implement something like this.,
Create a .js file consider sample.js.
Put this code inside
Type.registerNamespace('MyNamespace');
MyNamespace.MyClass = function() { MyNamespace.MyClass.initializeBase(this); } MyNamespace.MyClass.prototype = { sayHello : function(message) { alert(message); } } if ( typeof (Sys) !== 'undefined' ) Sys.Application.notifyScriptLoaded();
register this sample.js in the scriptmanager.
<asp:ScriptManager ID="ScriptManager1" runat="server" >
<Scripts>
<asp:ScriptReference Path="../../client_scripts/sample.js" />
</Scripts>
</asp:ScriptManager>
Then create the global variable inside your function. var x = new MyNamespace.MyClass();
here's a little more detail...
The app is hosted in a portal environment. The portal appends a "token" number to each form on the page to ensure unique form names (the portal page could have more than one form). For example, if I have <form id="form1"> it will change it to something like <form id="form1_1458">. A javascript error occurs after the page loads saying "'this._form' is null or not an object."
I did a viewsource of the page and I see the following:
<script type="text/javascript">//<![CDATA[Sys.WebForms.PageRequestManager._initialize('form1_1458', document.getElementById('form1'));Sys.WebForms.PageRequestManager.getInstance()._updateControls([], [], [], 90);//]]></script>
I'm not sure if this is the issue but the scriptmanager is referencing to form1.
What I want to do is force the scriptmanager to get document.getElementById('form1_1458'). How can I accomplish this?
the cz of the problem not tht u have a form name inconveniance its about an html error u can run ur page under firefox successfully
u can fix ur prob by checking the syntax b4 the form tag the body tag or another tag check for html syntax errors like added " or unclosed tags
hope being usefull......
I'm surprised this hasn't caused you issues before. If you think about it the server ID is changed which could throw off all control names and references.
I'm not sure that you can change this at run-time without some serious manipulation to the AJAX framework. My thought is that you could get access to form1 using something like document.forms[0] which will get the first form (without using the ID)
-Damien
where/how do I tell the scriptmanager to use document.forms[0]?
Not sure... from my last post: "I'm not sure that you can change this at run-time without some serious manipulation to the AJAX framework..."
The form reference gets set by the ASP.NET AJAX Framework's client scripts; you don't specify the form. Seehttp://www.asp.net/ajax/documentation/live/overview/ScriptManagerOverview.aspx for more info on the ScriptManager
-Damien
finally figured this one out. Many thanks to http://aspnetresources.com/articles/HttpFilters.aspx
I have a quite simple problem I guess.
My master page has a menu on it, and I want to call my animation fade sequence when hovering over the menu, and call the unfade seqence when the mouse is removed from the menu.
I would have no problem to have the update panel on either my normal pages, or on the master page, as I want to fade everything within the update panel.
Any hints or suggestions are very much appreciated. I would like to name my fade sequence FadePage and call it when hovering. I just can't figure out how to do this, or fade it in any other way.
Thanks
/Jonas
Hi Jonas,
I think I might have misunderstood the problem , but I feel this link will be helpful :
http://blogs.gotdotnet.com/phaniraj/archive/2007/04/13/animations-how-many-ways-do-i-call-thee.aspx
Hope this helps
So if I do like this:
<formid="form1"runat="server">
<scriptlanguage="javascript"type="text/javascript">
function DoTheAnimation(){//Play the Animation by calling its static methods
AjaxControlToolkit.Animation.ResizeAnimation.play( $get("queryReply") , 0.2 , 45 , 200 , 100 ,"px" );}
</script>
<asp:scriptmanagerID="Scriptmanager1"runat="server"></asp:scriptmanager>
<asp:MenuID="MainMenu"runat="server".....................>
<ajaxToolkit:AnimationExtenderID="animateReplyPanes"runat="server"TargetControlID="MainPage"BehaviorID="animateReplyPanesBehavior">
<Animations>
<OnClick>
<ResizeHeight="100"FPS="25"Width="200"duration="0.3"unit="px"/>
</OnClick>
</Animations>
</ajaxToolkit:AnimationExtender>
How can I then call the DoTheAnimation function when user hovers over the menu?
Also: what should I write instead ofqueryReply?
Thanks /Jonas
This is probably a much simler and better explanation of what I want to do:
<body>
<formid="form1"runat="server">
<asp:scriptmanagerID="Scriptmanager1"runat="server"></asp:scriptmanager>
<asp:MenuID="MainMenu"runat="server" ........ ..........................></asp:Menu>
<divclass="MainPage" id="MainPage"runat="server">
<asp:contentplaceholderid="ContentPlaceHolder1"runat="server">
</asp:contentplaceholder>
</div>
<ajaxToolkit:AnimationExtenderID="animateReplyPanes"runat="server"TargetControlID="MainMenu"BehaviorID="animateReplyPanesBehavior">
<Animations>
<OnHoverOver>
<FadeOut/>
</OnHoverOver>
<OnHoverOut>
<FadeIn/>
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender>
So If I have this code, but I want the animation to play on my "MainPage" div instead of the "MainMenu", how can I do that?
Thanks!
I have a page with a gridview which is inside a tab panel.
Depending upon the selection in the GridView I need to set a Select Parameter for a FormView on another area of the page.
I simply get the error "Could not find control 'GridView2' in ControlParameter 'PoemID'"
Any suggestions ?
i got the same problem trying to access a label inside a tabcontainer...
someone pease help us!
I have had some success with resolving a similar problem by adding the name of the container to to the ControlId parameter as follows: ContainerName$Gridview2
I have an UpdatePanel with a textbox inside, further down the page I have a tab panel that needs to reference the value entered into the textbox and was able to get it to work by having the following syntax:<asp:ControlParameterControlID="UpdatePanel1$TextBox1" ...... what I can't work out is how to reference the same textbox from the tabpanel if it was placed within another tabpanel above or a different container such as an accordion panel. let me know if this gives you any clues...
Men, thanks to you I could fix my application...
You just have to do the same with all the controls of the panel, but remember to use the tab container and the tab panel, OK... Here my example... Thnaks
--
SelectMethod="GetEmpleado_MByNumero"TypeName="RecursosHumanoBLL"UpdateMethod="UpdateEmpleadosMByNumeroEmpleado"OldValuesParameterFormatString="{0}">
<SelectParameters>
<asp:ControlParameterControlID="udpConsultaEmpleado$tcEmpleados$tpFiltro$gvEmpleados"DefaultValue="1"Name="Numero"
PropertyName="SelectedValue"Type="Int32"/>
</SelectParameters>
--
I hope it work for you too
I'm trying to use HttpContext.Current.Profile.GetPropertyValue() but it's returning empty data. Is there anything that I have to set up?
Hi Zephyr,
Can you check to see whether the User.Identity.Name property is available in your web-service? This will indicate whether the user is logged in when the web-service is called. My guess is that they aren't - which is why the Profiloe is coming back null.
Thanks,
Scott
I have created a modal popup to show up during page load. It is my logon dialog box. Anyways, I have set the OkControl property to my logon button to execute some codes through the ModalPopupExtender control staticly and dynamically through Page_Load but both didn't work..
What is my problem?
Thanks!
Ok, I follow the flow from this person website.http://blogs.vertigosoftware.com/alanl/archive/2006/07/25/Creating_a_Confirmation_Using_the_ModalPopup_Extender.aspx It works with a button.
I want to use the SHOW event when the page load but it doesn't work. It seem like it is not rendering the javascript or couldn't find it.
What is my problem?
Hi,
Have you tried this link?
http://blogs.msdn.com/phaniraj/archive/2007/02/20/show-and-hide-modalpopupextender-from-javascript.aspx
I use asp.net ajax client method to do member Authentication
Sys.Services.AuthenticationService.login(username.value,password.value, true ,null,null,null,null,"User Context");
It successed in current page. but when I redirecit to another page, the Authentication dissapeard
How clientscript member Authentication last the whole browse session
I found I have wrong setting in my config files
Take a very simple example, i have a button inside the update panel along with other controls and i have a textbox on the page.What i want is that when i click the button inside the update panel,it should update the textbox which is present outside the update panel.How can i do this?
To my knowledge you cannot update any control outside of the update panel. If you want to update the control move it inside the update panel.Do you want to modify the text box with server-side code? If so, put it in its own UpdatePanel. Set the UpdateMode on the panel to Conditional. Then you can either add the button in the other UpdatePanel as an AsyncPostBackTrigger to the new UpdatePanel or invoke the Update method on the new UpdatePanel in your button's Click event handler.
If you want to modify the text box on the client, you're going to have to write JavaScript.
Can you please tell me what javascript should i write for the sition i mentioned in the above example.
I am not getting the idea using javascript for a control inside the update panel.
Are you sure you need to write JavaScript? I gave you the steps to modify the text box using purely server-side code by using a second UpdatePanel control. I highly recommend you read theUpdatePanel tutorials and then re-read what I suggested. This path doesn't require JavaScript, but does require a round-trip to the server which is where your code will be executing.
If you do need to use JavaScript, you're going to need to handle the button's click event, modify the other control, and then prevent the default action for clicking the button from occurring (if necessary). This would all be done on the client so wouldn't require a round-trip to the server, but involves learning JavaScript and the DOM API (which you should want to learn as a web developer, anyways).
Hello,
I am new to AJAX and know I must be missing the obvious with this question. I would like to dynamically change the HTML content between opening and closing HTML DIV tag. The partial page update examples that I have seen, update controls rather than content such as HTML with in a division. The example used to illustrate the problem is trivial. In my actual application, the updated content will actually come from a database and include HTML tags.
Thanks in advance for your assistance.
The following steps lead to an example of my question:
Start a new AJAXEnabled Web Application using Visual Studio 2005.
In design mode, drag an Updatepanel from the AJAX Extensions tools to the designer.
Drag a DIV from the HTML Tools to the Updatepanel.
Drag a Button from the Standard Tools to the Updatepanel, but outside the DIV box.
Switch from Design to Source Mode and type the following line between the Opening and Closing Div tags:
This is the link displayed when the page is loaded: <ahref="http://www.someplace.com">someplace</a><br/>
Here is all of the generated code up to and including step 6:
<%@dotnet.itags.org.PageLanguage="vb"AutoEventWireup="false"CodeBehind="Default.aspx.vb"Inherits="AJAXEnabledWebApplication1._Default" %>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><htmlxmlns="http://www.w3.org/1999/xhtml">
<headrunat="server">
<title>Untitled Page</title></head>
<body>
<formid="form1"runat="server">
<asp:ScriptManagerID="ScriptManager1"runat="server"/>
<div>
<asp:UpdatePanelID="UpdatePanel1"runat="server">
<ContentTemplate>
<divstyle="width: 160px; height: 100px">
This is the link displayed when the page is loaded:<ahref="http://www.someplace.com">someplace</a><br/>
</div>
<asp:ButtonID="Button1"runat="server"Text="Button"OnClick="Button1_Click"/>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form></body>
</html>
Looks like duplicate post
http://forums.asp.net/t/1125367.aspx
such as
<dataSource id="listDataSource" autoLoad="true" serviceURL="MyService.asmx" />
it binding to a web service named MyService.asmx,How can i binding it to a page method?
thanks
A data source can only declaratively bind to a DataService.
To bind it to other data, you can obtain the data programmatically (e.g. from a page method), and set the data property of the data source to the returned data.
Alternatively, you could directly bind the content (e.g. the ListView control) directly to the data, without using the data source control.
Thanks,
Now I have a aspx page to show the department employee list. At the above of the page is the query section in which I can choose a department from a dropdownlist and a textbox for typing employee name. Since the signature of the autocomplete controlwebserviceis
"public string[] GetPersonNameHasCertainPrefix(string prefixText, int count)"
So the only query condition I can get is the 'Person Name', when I type "John" in the textbox the list I get is the person name start with 'John' fromall of the company. but now I just want to get the person name start with 'John'in certain department.
I don't know how to get this.
Any help and suggestions are apperciated. Thank you all:)
"public string[] GetPersonNameHasCertainPrefix(string prefixText, int count)"
what is this ? is this method they are given (i.e u r database layer developer)
it is wrong .we must send department name to database query is must
or
send department name concadinating with name
like this
u selected software department
and u type john
send to this method as sofware+john as a one string .
change query to saprate that string
it is not suitable to u let inform briefly
Thank yousudhakargroup。
Maybe I didn't express myself clearly.
Anyway I have found the solution for this problem. The Ajax toolkit developer have left another overload method have a "contextkey" parameter, the type of it is STRING, so you can assign this parameter either in client or server side and pass it to the webservice.
Since it is a string, so you can pass almost everything, that's really great!^_^
Going For AJAX