AJAX :: TextBox Control Value Resets To Initial Value, Using WebMethod?

Feb 25, 2010

I need to assign a textbox value selected from a modal dialog. The modal dialog displays a list of addresses. I select a particular locationID from the addresslist launched.

I launch the modal dialog from a Link button.

There are Number and street ,city,postocde fields on the .aspx form. I should extract the Number and steet field from the database for which I use the Webmethod. I set the EnablePageMethods value to true of the Scriptmanager control.

I see that the value gets assigned , but resets to the initial value of the NumberandStreet field before the modal dialog is launched.

I am not able to trace as to what could lead to this. Please find the code attached.

<asp:LinkButton ID="LinkButtonPickUpAddress" runat="server" OnClientClick="OpenAddressList()">Select</asp:LinkButton>
<script type ="text/javascript" language="javascript" >
var locationID;
function OpenAddressList() {
var NumberAndStreet;
locationID = window.showModalDialog('AddressList.aspx', null, 'scroll:no;dialogHeight:330px;dialogWidth:500px;centre:yes');
PageMethods.GetNumberAndStreet(locationID, SetNumberAndStreet);
}
function SetNumberAndStreet(ResultNumberAndStreet) {
document.getElementById('<%=TextBoxNumberAndStreet.ClientID %>').value = ResultNumberAndStreet;
}

In the .vb form i have the web method declared this way

<System.Web.Services.WebMethod()> _
Public Shared Function GetNumberAndStreet(ByVal locationID As Integer) As String
Try
Dim theAddress As New IDAL.Address
theAddress = Utilities.m_objDAL.GetAddress(locationID)
Return theAddress.NumberAndStreet
Catch ex As Exception
Return Nothing
End Try
End Function

Note : The above code is placed in the content place holder of a content page

View 2 Replies


Similar Messages:

AJAX :: ASPX WebMethod Not Running The WebService Webmethod Returning The Page?

May 19, 2010

I have a service that works great on my development box. It uses JQuery to hit my web service, and then the JSON results are sent back.

The web service is located on our basePage.cs. We didn't want to put out an external WebService for this. Our on beta box something different is happening.

The web page seems to be trying to call the web method correctly - the JSON data is being sent... but the server doesn't seem to know it's a webmethod. here's my service function (it's in our basepage.cs which inherits from Page).

[Code]....

View 2 Replies

AJAX :: How To Pass More Than One Control Values To Webmethod For AutoCompleteExtender

Apr 5, 2010

I am developing a user control. This user control is having 2 Dropdown controls and one textbox('txtCustomer'). I am using autocompleteextender for the text box. This 'txtCustomer' control populates the data based on the value selected in 2 dropdowns.

I need to pass the selected value of this 2 dropdown to my meb method. I am not using web service(.asmx page) for this application instead i am using page level web method. I tried to access the controls from the web method inside the Page. but all the identifiers and controls of the page returning null in the web mothod. I have analysed it is because the events "page_Load and page_Init" are not getting fired.

View 6 Replies

AJAX :: Page Flicker And Resets Scroll Bars?

Feb 25, 2011

I have a page with two updatepanels both using a timer's tick event to do various bits. The script manager is set to conditional updates and the panels are set up to use specified triggers but when the tick event fires for either the page flickers and the scrollbars reset to midway down the page. This renders my application unusuable.

View 4 Replies

Web Forms :: Call MsCaptcha Control In Static WebMethod Jquery Ajax

Dec 1, 2010

I want to call MsCaptcha Control in Static WebMethod,for validating. so,I want to check mscaptcha value in javascript or jquery without refresh the page.I think it is my solution that i use JqueryAjax.

View 7 Replies

AJAX :: Rating Controls Added Programmatically, Resets CurrentValue?

May 6, 2010

I've looked all over for a solution to my problem and i haven't come across a solution that works for me, at least i can't figure out how to make them work for me.I am creating a group of rating controls and adding them to a placeholder. I want to retrieve all ratings and update my database after a button clickall worked wonderfully, i thought i was making some real progress but then i noticed i could not get the value on the server side no matter what i tried... i noticed it's overwriting the value on a postback(i am assuming) i tried adding a if not isPostback statement but then it threw a callback error. anyway here is some code:

Sub Page_Load(sender as object, e as eventArgs) Handles Me.Load
For Each DataRow As Row In DataTable

Dim r As New AjaxControltoolkit.Rating
r.MaxRating = "5"
r.CurrentValue = "0"

[code]...

View 2 Replies

Web Forms :: Error While Accessing Page Label Control In WebMethod During AJAX PageMethods Call

Jul 16, 2012

I found this Article from link : [URL] .... that explains how to call server-side Method from javascript,

I used your code, my server-side function is static, public, and also I added

[System.Web.Services.WebMethod] 
and
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">

View 1 Replies

Control Initial Value Not Display After 1st Run?

Aug 24, 2010

I encounter a weird problem when I am run the app via F5 or View In Browser. When I run the following page for the first time, "Hello" is shown on the textbox. Clicked on the 'Click Me' button, the text is changed to "Clicked!". That's fine. Close the brower and run F5 (or View in Browser) again, the Textbox shows "Clicked!". It doesn't display the initial value anymore. I see this problem on IE6 (and thatis the only option for my employer), but not on FF3.6 nor Googgle Chrome 4.x. I thought it could be related ViewState. But, the problem persists after ViewState is disable.

Default.aspx File below:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

[Code].....

View 1 Replies

AJAX :: Set Calendar Extender Initial Value?

Nov 21, 2010

When I am in edit mode, how can I set the calendar that is displayed to the value that is in the Text box ?

How I did it below with SelectedDate="DatePaid" is not corect

VS2010 VB

[Code]....

View 2 Replies

AJAX :: AsyncFileUpload - Must Exist On Initial Load?

Oct 5, 2010

I've stumbled across a strange problem with the AsyncFileUpload control: if the control doesn't exist on the initial load, the UploadedComplete event does not fire. For example, the following code works just fine:

[Code]....

But as soon as the code is wrapped in an if (IsPostBack) condition as shown below, FileUploaded no longer fires, even though the code is otherwise identical:

[Code]....

Would anyone be able to shed some light on why this is happening?

View 3 Replies

AJAX :: UpdatePanel - UpdateProgress Only Displays On Initial Postback?

Jul 30, 2010

In a nutshell I have an UpdatePanel with an UpdateProgress item, first postback checks for warnings, if there are any they will be be displayed to the user as a JavaScript 'confirm' box. If the user clicks OK the next postback occurs to commit the change.

The UpdateProgress loading notification appears on the first postback but not on the second, even though both of them function correctly. The buttons that trigger both postbacks are async postback triggers in the update panel, and both are inside the ContentTemplate.

View 5 Replies

Security :: Change Password Template - Reset The Control To Initial Stage?

Jul 10, 2010

I have converted the change password control to a template. It is inside an update panel. After changing the password the confirm button takes the user to the success step by updating the update panel. Then by clicking the OK button, I would like to reset the password changer to its initial state so that the user can change the password again. Right now I am not sure how this is done and the control simply remains at the second step, telling the user "password has been changed" . User can press OK. What must I write in the OK button click event to reset the password control to its original state?

View 3 Replies

WCF / ASMX :: [WebMethod] Alternative / Use AJAX, Primarily With JQuery .ajax Function?

Feb 22, 2011

HWhen I want to use AJAX, primarily with JQuery .ajax function, I use functions within the .aspx.cs of the same page with [WebMethod].

I dont like this method very much because everyone can tell which function I use, and with no problem they can use it too.

My guess is that theres a better way to do this, Am I right?

View 3 Replies

AJAX :: Color Box Jquery Not Working In Update Panel After The Initial Postback

Sep 30, 2010

I have an UpdatePane that contains a Listview

<ItemTemplate>

[Code]....

This linkButton will serves as the trigger to call my color box jquery. Function stated below

[Code]....

[Code]....

[Code]....

[Code]....

View 2 Replies

AJAX :: MaskedEditExtender - Using Mask With Number With Decimal Get The Wrong Initial Bind Value

Apr 26, 2010

I have confronted a problem of using MaskedEditExtender when try to restrict user to input a number mask with mask. User input of course has no problem. The problem is when the system get the value from database or somewhere (doing assignation), the textbox show the wrong value with the following mask setting: I am writing to contribute and share my solution: example:

textbox1: 1.1 (user input) by using the following mask:
<asp:MaskedEditExtender ID="meeXML" runat="server"
TargetControlID="textbox1"
Mask="999.99"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Number"
InputDirection="RightToLeft"
AcceptNegative="Left"
ClearMaskOnLostFocus="True"
ErrorTooltipEnabled="True"/>
When the system get back the data, textbox1 will show:
textbox1: 0.11 <- that is not the actual what I want:
==========================================
the solution:
==========================================
<asp:MaskedEditExtender ID="meeXML" runat="server"
TargetControlID="textbox1"
Mask="NNNNNNNNNNNN"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError"
MaskType="Number"
InputDirection="RightToLeft"
AcceptNegative="Left"
ClearMaskOnLostFocus="True"
Filtered="."
ErrorTooltipEnabled="True"/>

View 1 Replies

AJAX :: How To Get An Array Of All The Textbox Control Inside Create User Wizard Control

Aug 10, 2010

How can I get all the textboxes inside a create user wizard control using getElementsByTagName().

Below is my JQuery code:

[Code]....

The above code isn't displaying hint text when the textbox retreives focus.

I think there is something wrong with this getElementsByTagName("asp:TextBox"); , I have also tried getElementsByTagName("TextBox"); , getElementsByTagName(":textbox"); and getElementsByTagName("input"); .

But no one of them gets the textboxes array.

Can anyone tell what will be the correct syntax for getting all the textboxes inside a create user wizard control using getElementsByTagName()?

View 3 Replies

AJAX :: How To Bind Textbox Control To ComboBox/DropDown Control

Jul 12, 2010

I am using AJAX ComboBox control (or I can use simple ASP.NET DropDown Control it does not matter) in my form. What I do is, I bind combo box control to my database and retrieve client names:

[Code]....

But here is the problem. I want First and Last names to go into separate TextBox controls (txtFirstName and txtLastName). Now it inserts Last Name and Firts Name in txtLastName control. At the same time I would really like to keep LastName + FirstName together in Combo Box.

View 2 Replies

AJAX :: Save Changes Made To The Initial Order Presented In A ReorderList On Button Click?

Jun 30, 2010

I have a reorderlist hooked up with database. I want myself to reorder the stuff in it. Rather than posting the page back everytime when i reorder the stuff, I should be able to make all the changes in my database on button click.

(Basically I dont want my page to post back everytime when I reorde, all the changes made to the list should be commited at the end when Button is clicked)

View 2 Replies

AJAX :: How To Create Collapsible Textbox With Jquery Or Ajax Control Toolkit

Apr 6, 2010

How i can create collapsible textbox with jquery or ajax control toolkit.

View 1 Replies

AJAX :: AJAX Calendar Control -show Year Only In Textbox?

Mar 16, 2011

define OnClientShown client event for calendar, and you can set the mode to "year only" in this event,

[Code]....

View 1 Replies

How To Call WebMethod For Control In Javascript

Jan 27, 2011

I'm trying to call a WebMethod (GetData()) for a control in a web page using javascript.

<script type="text/javascript">
$(document).ready(function () {
//this selector needs fixed
$('<%= Control1.ClientID %>').GetData(); });
</script>
<tel:RadScriptManager ID="RadScriptManager1" runat="server" />
<tel:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
<uc1:Control ID="Control1" runat="server" />
</tel:RadAjaxPanel>

The uc:Control code:
[WebMethod()] [ScriptMethod()]
protected void LoadData() {
//stuff happens here }

I can't figure out what kind of selector to use. I have multiple controls on the page, and I want to call them at different times. What kind of selector or what command do I use to run this WebMethod?

View 4 Replies

AJAX :: AutoCompleteExtender Not Calling WebMethod

Sep 10, 2010

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

View 3 Replies

JQuery :: Loading From [webmethod] Using Ajax

Mar 26, 2011

I am using a webform and trying to use a $.ajax call a webmethod on my code behind to format and return some data. It sounded easy but I need the help of an expert. Here is what I have and perhaps someone could steer me in the right direction to solving this problem. for the time being all I want the [webmethod] to return is some dummy data so the jqgrid displays, after I get it displaying correctly I will work on the data column format. So for this sample to work correctly user would open web from and click on button "Load Grid" when this is clicked it calls the the [webmethod] on the server, the sever then gets the data and passes it back to the jquery .ajax call and then it gets loaded into the jqGrid.

[Code]....

and the codebehind

[Code]....

View 2 Replies

AJAX :: Access UI Element Through Webmethod?

Jan 7, 2011

I would like to write some html content to div element through web method. The web method should be like

[System.Web.Services.WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public static string LoadImages1()
{

[Code]....

without passing data to success block, I have to write at webmethod it self.

View 1 Replies

AJAX :: Get Page Controls In WebMethod?

Mar 1, 2010

I'm passing a value from a JQuery to the serverside & now i have to update with the database by looping through all the datalist items...

JQuery:

PageMethods.addRoomAndBed(empname,Number(roomId));

C#:

[WebMethod]
public static string addRoomAndBed(string name, int dutyid)
{
// MANIPULATE DATALIST AND UPDATE DATABASE HERE
return null ;
}

View 7 Replies







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