AJAX :: Multiple Instances Of A Same Usercontrol With Javascript Pageload Method
Nov 15, 2010
I have a usercontrol that wprks fine as along as one instance is on a pageut as soon as i have two instances of it nothing works. I figured out that it could be the pageload function that adds handler for keydown and other that is the cause.As each instance is reproducing the same javascript in the viewsource.So can you tell me how can i make the usercontrol that it can have multiple nstances that have their own javascript pageload
View 4 Replies
Similar Messages:
May 19, 2010
I've been working on an usercontrol with a jquery timer in it. At first I had the jquery within the usercontrol. But when I add 2 of those controls to my page the second usercontrol isn't showing it's data very well.Now I've put the jquery into the mainpage and the usercontrol only uses the id's of the jquery.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs"
Inherits="WebUserControl" %>
<style type="text/css">
[code]...
View 2 Replies
Aug 13, 2010
As you said that for storing use data table and make property in the .ascx.cs file but I have problem that I m not able to get that property in the .aspx page. How to add multiple instances of web usercontrol on page on button click event?
View 1 Replies
May 10, 2010
I have created a Web Control in ASP for use in integrating with Telligent CommunityServer. The control is written in ASP with some 10 lines of C# backend for controlling visibility of the UI elements based on permissions, but I'd say 90% of the functionality is straight-up Javascript. The control works beautifully, until you drop two instances of the Control on the same page--since they reference the exact same Javascript functions, only one control works. How can I take this functionality that I have, this 1200 lines of Javascript, and make it so that each instance of the control can reference its each unique instance of Javascript?
View 2 Replies
Apr 16, 2010
I have more than one user control and those user controls have extenders of the ajaxcontroltoolkit. The problem is that each one has a javascript that writes "function PageLoad"... and as I have more than one user control in the same aspx, more than one of those javascript functions is written in the output. Is there anyway to combine all of them in just one function? (bear in mind that the javascript code is written within the user control and the user control doesn't know anything about what other control are in the container aspx). If I have more than one function PageLoad they will not work then, right?
View 5 Replies
Nov 15, 2010
I have two instances of a usercontrol on a page. No matter which usercontrol's (uc_Addr1 or uc_Addr2 ) button I click, it always dispalys the second usercontrol's text.If I click uc_Addr1 button I need uc_Addr1 TextBox's text to be displayed. And same with uc_Addr2.
View 2 Replies
Aug 16, 2010
I need change htmleditor height in javascript function in pageload.
View 2 Replies
Oct 12, 2010
I have 1 ModalPopupExtender inside a UserControl. Everything works great until I start adding the same usercontrol to the page. I am getting this error message in the javascript console::
Message: Sys.InvalidOperationException: Two components with the same id 'MPE1' can't be added to the application. I understand the error, it obvious that the framework wants unique IDs. What I can't figure out is how to give them unique name.
View 2 Replies
Feb 16, 2010
I have a user control, that has an update panel and update progress control in it.
I use this user control in more than 1 location on the same page.... problem is, when ucA posts back, I see the update progress control for both ucA and ucB. I assume this is because it is a user control and the update panel and progress are named the same?
Either way - how do I make it so that the update progress only displays for the proper user control?
View 3 Replies
Aug 26, 2010
I have an application that has JS calling ASMX files to do asyncronous requests, using ASP.NET AJAX.
The problem is that I use always the same "onError" function, and now I don't know how to identify the method that rised the error, and it is giving me a lot of problems to debug errors. The parameter "data" of the onError method does not give enough information, for
example:
en System.ComponentModel.BaseNumberConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
en System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeInternal(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
en System.Web.Script.Serialization.ObjectConverter.ConvertObjectToTypeMain(Object o, Type type, JavaScriptSerializer serializer, Boolean throwOnError, Object& convertedObject)
en System.Web.Script.Serialization.ObjectConverter.ConvertObjectToType(Object o, Type type, JavaScriptSerializer serializer)
en System.Web.Script.Services.WebServiceMethodData.StrongTypeParameters(IDictionary`2 rawParams)
en System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters)
en System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)
en System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)
Is there any way to know the webmethod that raised the error?
View 1 Replies
Oct 18, 2010
Is it possible to use PageLoad as a method? I want to load the page in some button clicks, and Page_Load(); doesn't work (the page doesn't load).
View 2 Replies
Sep 22, 2010
When this function is hit , it does not call my function in code behind? Why could it be doing this? How can I fix this error.
$(document).ready(function() {
$('[id$=btn_Update]').click(function() {
var reten = $('[id$=txt_Reten]').val();
var i=0;
var selectValues = "";
var ProdID = new Array();
$("#lst_ProdId option").each(function() {
selectValues = selectValues + $(this).text() + ",";
ProdID[i] = $(this).text();
i++;
});
for(var j=0; j < ProdID.length;j++)
{
// alert(ProdID[j]);
}
var params = "{'ProdID':'" + ProdID + "','RetenP':'" + reten + "'}";
$.ajax({
type: "POST",
url: "/ProductPricing/Products/RetenPeriod.aspx/UpdateRetenPeriod",
data: params,
contentType: "application/json; charset=utf-8",
datatype: "json",
success: function(result) {
alert("sucess");
},
error:function(e) {
alert(e.statusText);
// if(errorThrown != null)
// alert(textStatus+ ":"+errorThrown);
// else
// alert("fail");
}
});
return false;
});
return false;
});
This is my webmethod in code behind:
[WebMethod]
public static bool UpdateRetenPeriod(string[] ProdID,string RetenP)
{
for (int i = 0; i < ProdID.Length; i++)
{
update(ProdID[i],RetenP);
}
return true;
}
View 3 Replies
Feb 11, 2011
have a wizard control in an aspx page which is enclosed in a update panel. Each step in the wizard control is a user control. In one of the user controls I am using syncFileUpload control, and I am calling a JavaScript function "UploadComplete" on the
"OnClientUploadComplete". But when I run the program I am getting a javascript error "UploadComplete" not found.In the main user page I have
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Wizard ID="wzdDocAdmin" runat="server" ActiveStepIndex="0" BackColor="#F7F6F3" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" Width="100%" DisplaySideBar="False"> <StepStyle BorderWidth="0px" ForeColor="#5D7B9D"
HorizontalAlign="Left" VerticalAlign="Top" />
[code]...
View 3 Replies
Apr 1, 2010
Is there an easy way to prevent users from opening multiple instances of the same web application? Can I add something to the application start section of the global page which would prevent this?
View 4 Replies
Jan 10, 2011
I have a main page with one update panel
Inside that I have registered usercontrol. within this user control I have written some javascript
This js does not get rendered when page is loaded/opened.
View 2 Replies
Dec 9, 2010
I'm calling PageMethod "SameMethod" from javascript method "caller" so that I can get some values from DB. After I get values, control is continuing in "onSuccess" method. Problem is that I need to use some variable values ("importantValue") from javascript method "caller" in "onSuccess" method.
function caller(){
var importantValue = 1984;
PageMethod.SomeMethod(param1,..., onSuccess, onFailure)
}
onSuccess method should be something like this:
function onSuccess(pageMethodReturnValue, importantValue ){
}
Is it possible and, if it is, how to pass multiple parameters (besides return values of page method) to "onSuccess" method of PageMethod?
View 2 Replies
Oct 15, 2010
In an aspx page I am calling a jquery plugin for two listboxes as below.
$(document).ready(function() {
$("select.select_AdditionalLanguages").custSelectBox();
$("select.select_Organisations").custSelectBox();
});
[code]...
Managed to solved this issue by having same class name for both the listboxes and then passing both the list box objects to the plugin
$('select.select_field').custSelectBox(null, $('#EditUsers_Organisations'), $('#EditUsers_AdditionalLanguages'));
This might not be the best solution but nothing else worked for me.
View 2 Replies
Mar 7, 2011
YARPQ - Yet Another Regex Pattern Question:
What I am trying to figure out is how to use a custom delimiter, single character or set of characters, to wrap a block of text inside a larger body of text and then pull that text out via regex. I have successfully done this with a single instance of wrapped text. If I have multiple instances, it blows up. Here is an example.
This would be my text block with the internally wrapped text:
[Code]....
When my current regex runs on this block, the greedy nature gives me a match starting with my first wrapped block delimeter and ending with my second wrapped block end delimeter. So my regex of @"#Delim(.*)#EndDelim" doesn't work in this instance. I am trying to figure out how to exclude the #EndDelim from my grouping. Simply using ([^#EndDelim]*) doesn't work as it tells regex to ignore the individual characters inside the brackets and not the actual word so this breaks if I have any of those characters inside my wrapped block of text.
I am probably making this harder than it needs to be. Does anyone know of a good solution or how to ignore entire words in regex?
View 3 Replies
May 4, 2010
I have a link button inside a repeater. How would I directly call the serverside (ItemCommand) method during postback. I want to skip the page_load. The wierd thing happening is, if I put (!Postback) it doesn't execute other methods on postback but it does if I don't set the !postback condition. I have repeater inside a updatepanel in UserControl.
View 1 Replies
Aug 10, 2010
How to call a Javacript method in a PageLoad of a Page?
View 5 Replies
Jul 28, 2010
I have a page that contains a user control. Can i make an ajax request directly to the control? I know I can make an ajax request to .aspx or .ashx; however, is it possible to go direct to the .ascx?
View 2 Replies
Mar 16, 2010
I'm having problems with retrieving multiple instances of a session variable from an InProc session state. In the following code I persist a simple BusinessObject into a session variable on the Page_Load event. On the click of a button I try to retrieve the object back into 2 new declared instances of the same BusinessObject. All works great until I change one of the properties in the first instance, it changes the second instance as well. Is this normal behaviour? I would have thought as these were new instances they wouldn't demonstrate static behaviour?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
' create a new instance of a business object and set a containg variable
Dim BO As New BusinessObject
BO.SomeVariable = "test"
' persist to inproc session
Session("BO") = BO
End If
End Sub
Protected Sub btnRetrieveSessionVariable_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnRetrieveSessionVariable.Click
' retrieve the session variable to a new instance of BusinessObject
Dim BO1 As New BusinessObject
If Not Session("BO") Is Nothing Then BO1 = Session("BO")
' retrieve the session variable to a new instance of BusinessObject...............................
View 2 Replies
Aug 20, 2010
I have a user control that I place on a page severl times. When I make a selection on a ddl in one one control the SelectedIndexChanged event fires for all the control on the page for that ddl. So I get duplication of an insert that I do. Is there a ay to make sure these events are isolated so this doesn't happen.
View 8 Replies
Sep 10, 2010
I have an ASP.NET page inside of an ASP.NET Master page, and inside the page I have two instances of the same web user control. I have given them different IDs, but when I click a button on the first user control it causes the second user control to do the expected activity and the first one does nothing. Is there something I need to do to make sure that the controls don't get confused?
View 2 Replies
Feb 17, 2010
is there any way to stop share the static variable at multiple users....I need to create a new insatnce of static variables or not accessing the same static variables across multiple who are using the same site.....while googling i found like hisSystem.Threading.Interlocked.Increment(ref MyClass.InstanceCounter); by using can I do....or is there any other way to stop accessing the static variables accross multiple instances of my site......and in my scenario i cannot use rely on session variable also
View 2 Replies