AJAX :: Exception While Using Slider Control Multiple Times In A Page?
Jul 19, 2010
I am using slider extender in an user control. I am adding that user control 2 times in a page. At that it gives me an error saying "Two components with the same id 'Slider1' can't be added to the application."
I am using Latest Version of AjaxToolkit and VS 2008 with .NET FWK 3.5.
Im trying to incorporate the ajax controll toolkit slider control within an ascx control so that i can then use that within a repeater on an aspx page. Basically i want to have a number of slider controls rendered to a page with default values based on data from a database. i need to put the slider within a data bound repeater as i wont know until runtime how many sliders i will need (maybe there is a better way?). does anyone know of ay examples of how to do this?
The user will then need to be able to move the slider to the value they are after and on the mouse up event ie when they release the slder I will want to be able to update my database with the value they set it to. This bit i think i am ok with but i cant seem to work out how to build a page where by i can render lots of slider controls wth default valuesset from a database.
I think I summed up the question in the title. Here is some further elaboration...I have a web user control that is used in multiple places, sometimes more than once on a given page.The web user control has a specific set of JavaScript functions (mostly jQuery code) that are containted within *.js files and automatically inserted into page headers.However, when I want to use the control more than once on a page, the *.js files are included 'n' number of times and, rightly so, the browser gets confused as to which control it's meant to be executing which function on.What do I need to do in order to resolve this problem? I've been staring at this all day and I'm at a loss.
I am using Slider Extender for the very first time and i am not able to figure out why am i facing this problem, the problem is mentioned below :I kept the slider extender, Script Manager and 2 text boxes(one for TargetControl and one for BoundControl), i have given all required values (i.e. Maximum, minimum, steps etc.) now the slider should load on page load. Although the slider is loading on page load but the Bar of the slider is coming out of position. The same thing when i did with Orientation as Horizontal it worked properly but for Vertical orientation it is giving the above problem.
I need to control volume of aspnet audio control using the slider extender in ajax. I have a listview in which every item click plays an mp3 file. Also at each click i assign the current value fron slider to the volume of audio control so that the volume is not reset each time the user clicks on an item. But the problem is that the slider extender does not increase the volume but only decreases it from the last value set.
I have a class in my App_Code folder called Order. On one of my pages I am trying to create two different orders using this class.
[Code]....
When I run the page each of the Response.Write statements ouputs a 2. But this is not correct. One should be 3 and the other should be 2. Does anyone know why this is not working?
I have a class in my App_Code folder called Order. On one of my pages I am trying to create two different orders using this class.
Private Order1 As Order Private Order2 As Order Sub Page_Load(ByVal Sender As Object, ByVal E As EventArgs) Handles Me.Load Dim CartID As String = 4525543 Order1 = GetOrderFromDatabase(CartID) Order2 = Order1 Order2.Shipping = 3 Order1.Shipping = 2 Response.Write(o.Shipping) Response.Write(Order2.Shipping) End Sub
When I run the page each of the Response.Write statements ouputs a 2. But this is not correct. One should be 3 and the other should be 2. Does anyone know why this is not working?
I am dynamically changing a slider control's maximum value based on an onchange event on a different control. $find("Slider_13").set_Maximum(ordersPerWeek);
This works successfully. The bar's maximum value has changed, however, my slider can now be moved off of the bar, past the maximum value.
When I add the Slider Extender to the second of two textboxes in the same table cell, the slider wraps below the first textbox (which is the boundcontrol). The cell has alot of space available, so I don't understand the wrapping.If I don't use the slider control, both text boxes line up just ifne.I want the boundtextbox and the slider extender to be on the same line in the cell.
I have the JQuery tab control on my page and each tab will be using the same partial view with a filter set of the model. What is the best way to do this?
The only thing is the data needs to be filtered before it gets to each partial view.
I am currently putting the filtered model data in ViewData but I do not know how to reference that in the partial views.
ClickQuickPick() is the code I will eventually run, but I put in the Alert for testing.
The issue is that when the popup extender opens, and I click an item, I get the alert once. If I click another choice I get the alert twice. If I click another choice I get the alert three times, etc.
What is triggering the event to repeat, and how do I stop it?
I have a masterpage setup, with a pageLoad in the topmost masterpage, which calls pageLoad2 for nested masterpages which calls pageLoad3 for content pages.
In my content page I have a jquery click event and in my nested masterpage I have a web user control.
Whenever I use the user control in the nested masterpage, it rebinds the click event in the content page (undoubtedly because the pageLoad3 is called again), but this makes the click event fire twice on a single click. The problem gets worse the higher up masterpages you go (eg. fires 3 times if user control from topmost masterpage is called).
how to make sure it only binds the jquery events once?
I have a InsertCommand function i am using to insert the dropdownlist in my updatepanel. When the Add button is clicked. It adds the record multiple times. Am not sure why it does this. Here is my code.
Dim Bank_number As DropDownList = UpdatePanel1.FindControl("ddlbank")Dim NoteAccountNumber As DropDownList = UpdatePanel1.FindControl("ddlAccount")' UpdatePanel1.ChangeMode(FormViewMode.Insert) lblsee.Visible = "true" 'now collect selected information on the drop down RelationshipTest.InsertParameters( RelationshipTest.InsertParameters( "bank_number").DefaultValue = ddlBank.SelectedValue.ToString"noteaccountnumber").DefaultValue = ddlAccount.SelectedValue.ToString'Insert into db RelationshipTest.Insert()
Also, i was woundering if any of you might know the logic behind clearing inserted data from the dropdownlist once its inserted. I am trying to make sure data is not entered mulitiple times. Unique Indexing comes to mind but thats only on the backend.
I am having a problem with ajaxcontroltoolkit 3.5. I am getting the following error
"Microsoft JScript runtime error: Sys.InvalidOperationException: The script 'Timer.js' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit."
I have migrated ajax web app from 2.0 to 3.5 and have changed ScriptManager to ToolkitScriptManager.
iam placing the textbox of slider control in one panel and this panel iam showing when mouse goes to a linkbutton by using hover .the problem is when iam using slider extender with hover iam getting the following error for the slider control ---the errro is set valid value for the height and widht attributes in the slider css classes..how to solve this problem
i need to create a page that will ave lots of slider controls on it. about 50 in total. Does anoyne have any examples or good ideas how to handle that many sliders on a single page.
The problem i have is that the ajaxcontrol toolkit sliders seem to behave a bit eratic... eg sometimes you cant slider the slider on select the desired value and sometimes all the sliders disapear just leaving the text box they are linked to visible?
This is the exact same question as this unanswered one from May.
(edit) Note: this unanswered post exactly describes the behavior - extra scripts being added in the <head> by ScriptManager.RegisterClientScriptBlock in a usercontrol, in an UpdatePanel, is causing duplicates. C# .NET 4.0. The page is structured like this:
MasterPage Page UserControl1 (ascx) - loaded in code by Page UpdatePanel UserControl2 (ascx) - loaded in code by UserControl1
The first time the script is added as expected, in the body. The code, simply, in the UserControl2 OnInit:
I've also tried referencing "this" instead of page, which doesn't really make sense since I don't want the same script keys duplicated on the page if the usercontrol is loaded multiple times on a page, but it didn't work anyway.
After a partial postback, the script is added again - but curiously in the <head> of the page, not the body, and interestingly, lacking the normal //<![CDATA[...//]]> wrapper that asp.net usually adds.
Another script which is added by UserControl1 is duplicated exactly the same way after a partial postback.
I am trying to implement an ajax form inside of a jquery ui dialog.
I have a view with a button that opens the modal dialog form, makes an ajax call to an action that loads a partial view into the dialog. The partial view consists of a form created via Ajax.begin form. When I post the form I close the modal and update a div on my main page. This all works fine.
The problem is, the next time I open the modal and submit the form the http POST for the form is called twice. The third time I open/submit the form is submitted 3 times and so on...
It seems as if the submit button/form is bound multiple times and I cant figure out how to fix this.
Here is my code...
first the jquery call to load the ajax form partial view and create the modal...
I would like to wrap Session variables in a manner similar to that discussed on CodeProject.
[code]....
Here is my question: if I have to access CurrentUser multiple times in the same page, would I get a performance improvement by assigning it to a local variable instead of accessing the wrapping property? Or does the HttpSessionState make sure the object is only deserialized once per request, so that subsequent calls in the same http request don't cost any more?
I am using forms authentication, and a session object to hold user information once the user is authenticated.
I am able to login and log out. I am able to log in and use the "remember me" functionality of the forms authentication.
When attempting to test the "remember me" functionality, the master page load event contains code to check the forms authentication & remember me, and retrieve user info from the database to automatically log the user in. This fires correctly, and the screens all load with the user successfuly logged in, and the users info is successfully stored in a session object.
Without touching anything on the screen, a moment passes and then the master page load event spontaneously fires again, Page.User.Identity.Name still contains the user name, however the session variable is now null, and throws an error.If I tell it to run past this error, it does, and the application continues to function normally, withthe session variables set correctly.
Its almost as if that second firing is ina different session, or something.
I have no problem posting code, but I have a profile class holding / handling the session communication, etc so it is a bit cumbersome.
I'm using the local database functionality in Chrome and Safari and what I do when I want to save this to a remote database is to create a hidden textfield and then using JSON to stringify each row. In the code behind I then parse each JSON object and insert it into the list. What I want to do now is to delete these rows from the local database. I have a JavaScript function called deletePatient: