C# - Disable Refresh When Dropdownlist Is Open?
Jan 27, 2011
i have a webpage that loads data into a gridview and refreshes the gridview every few seconds. I do this via a asp:Timer which runs a C# function every few seconds to requery the database and databind the gridview.
I also have a few dropdown lists to filter data from the gridview. These dropdown lists get their data from the same dataset as the gridview (e.g. if the gridview shows the stats of all apples being plucked from trees, then the list may contain e.g. all distinct apple types). How i refresh these dropdown lists is again to requery the dataset and reset the selected index to be one selected at time of refresh. So this causes a problem where the timer is up when the dropdown list is open - the index on the dropdown list is selected and refreshes the gridview, the dropdown list also refreshes with the current selected index and closes.
So the question i have how to disable my timer refresh from going off while the dropdown lists are active - or maybe how do i do this better?
View 1 Replies
Similar Messages:
Apr 15, 2010
I am having a problem with disabling DropDownList based on the chice of 1st DropDownList, there is no post back occuring, and it is a template based web app here is the current code:
<script type="text/javascript">
$(function() { var dropDownList1 = $('#<%= ddlUserType.ClientID %>');
var dropDownList2 = $('#<%= ddlMember.ClientID %>'); dropDownList1.change(function(e) {
if ( jQuery("#ddlUserType").val() != "ETOC") dropDownList2.removeAttr('disabled'); e.preventDefault();
else
dropDownList2.removeAttr('enabled'); e.preventDefault(); }
} );
</script>
what is happening now is page is blank and if I remove the above code everything shows, where I am going wrong. here is the plain and final javascript code which worked:
<script language="javascript">
function CheckDropDownState(lstbox)
{
if (lstbox.selectedIndex == 3) { document.forms[0].ddlMember.disabled = 1; }
else { document.forms[0].ddlMember.disabled = 0; }
}
</script>
and thew .aspx code: <asp:dropdownlist id="ddlUserType" runat="server" onclick="CheckDropDownState(this);"></asp:dropdownlist>
View 2 Replies
Mar 25, 2011
I had use a combox to let user select staff name and then it will automatically retrive the responsible recommending officer and approving officer to display in other 2 dropdownlist.
my code works fine but when user select staff name each time, the page will reload once to refresh the dropdownlist.
user complaint and don't want the page reload every time, how can i disable the postback? I need to use ajax?
[Code]....
[Code]....
View 5 Replies
Jun 29, 2010
I have ap age I wrote that is a dashboard, so I have the whole page refresh itself rather frequently so the data doesn't get stale. The guys in our dispatch though who are using have lot's of audible alerts, so they keep their volumes way up, and even if it is in the background, the page makes a noise every time it refreshes, and it is driving some of them nuts I guess.
View 1 Replies
Apr 7, 2010
How to disable back and refresh button. I want to know how this can be handled as in bank websites and other secured websites. Can this be handled using clearing cache in Response object?
View 8 Replies
Mar 20, 2010
how to disable functionality of refresh (logo or button) in browser
View 2 Replies
Jun 3, 2010
I am using AJAX TabContainer control with following settings. When I change a tab the postback happens and whole page refreshes. Because AutoPostBack="true"> . To AJAxify the behavior, I added UpdatePanel around it but still the page is refreshing. The control need to go to server because user controls contains some grids which need to be populated.
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="upTLTop" runat="server" UpdateMode="Conditional">
<ContentTemplate>
[Code]....
How can I disable the page refresh and at the same time server side operation happens in this case?
View 1 Replies
Feb 1, 2010
How can I refresh the current page after I opened a new one using javascript. Code below works great if its last command in method but when I add "Response.Redirect(Request.Url.AbsoluteUri) after, it doesn't work anymore.
[Code]....
View 6 Replies
Nov 3, 2011
I am trying to open a pop up window by clicking on button from Code behind. following is my code.
C# code :
Code:
ScriptManager.RegisterStartupScript(this, this.GetType(), "", "javascript:return ShowPopup('" + Constants.strFinalSubmit + "'){return false;}", true);
javascript :
Code:
function ShowPopup(strMessage) {
window.open("./CommonScreens/ConfirmationDialog.aspx?value="+ strMessage,null,
"height=150, width=500,left=300,status=no,toolbar=no,menubar=no,location=no,directories=no,scrollbars=no,copyhistory=no,top=400");
}
Also when i click the submit button it should open a pop up with out refreshing the page.
View 6 Replies
Nov 19, 2014
I have an internal web application used by one department in our company. The app has a page with a gridview showing all inspection records for a part. When the user clicks on a record it will open that record in another tab. After they are done editing that record and click the close button I would like the original page with the gridview to refresh. Is this possible? Any examples? I've googled and checked other forums and can't seem to find any reliable method to do this.
View 1 Replies
Jun 3, 2010
I am using AJAX TabContainer control with following settings. When I change a tab the postback happens and whole page refreshes. Because AutoPostBack="true"> . To AJAxify the behavior, I added UpdatePanel around it but still the page is refreshing. The control need to go to server because user controls contains some grids which need to be populated.
[Code]....
How can I disable the page refresh and at the same time server side operation happens in this case?
View 3 Replies
Dec 31, 2010
This last week I had an issue about refreshing all open sessions on an asp.net web site. The scenario it's like this:
It's a LAN application with different roles (let's say "Role A" and "Role B") and a database of SQL server.
Any "Role A" user can click a button and start something like a survey (defines a query and the possible options).
Then, any "Role B" user have to answer that survey (just once).
Here comes my problem...if I am a "Role B" user, and I have the "AnswerToSurvey.aspx" page open...how it can automatically update or refresh after the "Role A" user inserted the survey? I mean, I know that if I press F5 I will achieve it, or even using asp:Timer or javascript timer, but any of them are precise.
Any suggest? I've tried using Global.asax Application_BeginRequest and so, but no lucky. Is there any effective way to notifiy a user that something has changed? I'm not looking for a "chat like" system, just notify any "Role B" user about the change.
View 3 Replies
Feb 12, 2010
I need to implement a "preview" functionality where people make changes to a form, click a button and a pop-up window displays the preview while the original form retains the user's changes in the various <textarea's. Right now, the preview is working, but when they come back to the form, their changes are gone, the page has refreshed. How do I prevent the page from refreshing? I need to go to the server to get the URL to the preview page.
View 6 Replies
May 7, 2015
How to open in new window on button click in asp.net without page refreshment ....
View 1 Replies
Apr 7, 2010
I have a DropDownList in my page, it DataBind with a objectDataSource.
when user select an option base that i have a FormView that show the detail of selected option an it also work with an othere ObjectDataSource.
when user insert, delete or edit an option for example the name of option will in edit mode changed and i need the DropDownList be refresh that show the new name of option.
i alredy know where should i write the code but i don't know how to refresh the DropDownList without dataBind the DropDownList because AppendDataBoundItems="True".
View 2 Replies
May 15, 2010
When I refresh the page in IE. It showed one window and say: if you don't resend the information then you cannot refresh the page, choose retry to resend the information and choose cancel to cancel it.
How can i change code to delete such window when I refresh page? My page is [URL]
View 9 Replies
Apr 28, 2010
I have a screen where on filter icon click on a column i need to show a popup screen or a div looks like popup and in which will have list of check boxes with distinct values of all rows of column one (i.e. the data of popup is like below). All these check boxes are dynamically generated controls.
checkboxcontrol Data1
checkboxcontrol Data2
checkboxcontrol Data3
When user click on any of the above check boxes the parent grid should get refreshed with the filtered data and popup or div tag looks like popup should stay and should not be closed. How do i do this?
The main screen has details like below
Data1 Column2Data Column3Data
Data2 123Data Column3Data
Data2 Column2Data Column3Data
Data3 Column2Data Column3Data
How to refresh my parent page details by keeping my child div tag open or child window open? What is better approach whether to create server side div tag or a modal popup window?
[Code]....
View 4 Replies
Mar 18, 2011
What my code does is that the EntityDataSource has a Where Parameter tied to the first DropDownList and it populates the second DropDownList, but when the first DDL changes, the EntityDataSource doesn't change the values of the second DDL. Worth mentioning this is inside a ModalPopupExtender which is inside an UpdatePanel. Maybe there is a way in just putting all the data in the second DropDownList and filter it depending on the value of the first one... or something like that... so there's no need of refreshing the data.
<asp:DropDownList ID="PaqueteKitDropDownList" runat="server" DataSourceID="PaqueteEntityDataSource"
DataTextField="Nombre" DataValueField="ID_Paquete" />
<asp:EntityDataSource ID="PaqueteEntityDataSource" runat="server" ConnectionString="name=CCEntities"
DefaultContainerName="CCEntities" EnableFlattening="False" EntitySetName="Paquetes">
</asp:EntityDataSource>
<br />
<asp:Label ID="Label66" AssociatedControlID="PlanKitDropDownList" runat="server"
Text="Plan:" />
<asp:DropDownList ID="PlanKitDropDownList" runat="server" DataSourceID="PlanKitEntityDataSource"
DataTextField="Duracion" DataValueField="Costo" />
<asp:EntityDataSource ID="PlanKitEntityDataSource" runat="server" ConnectionString="name=CCEntities"
DefaultContainerName="CCEntities" EnableFlattening="False" EntitySetName="Duracion_Plan"
Where="it.ID_Paquete == @ID" OrderBy="it.Duracion ASC">
<WhereParameters>
<asp:ControlParameter DbType="Guid" Name="ID" ControlID="PaqueteKitDropDownList"
PropertyName="SelectedValue" />
</WhereParameters>
</asp:EntityDataSource>
View 2 Replies
Jul 24, 2010
At the time of file download process, teh IE thorws a dialog box asking the user open / save or cancel. How to disable the open option, i want only save or cancel. This file is a zip file. i don't want a open option, is it possible?
View 1 Replies
Dec 23, 2010
[Code]....
modalpopupextender can't disable the parent page when popup window is open
View 5 Replies
Jun 27, 2010
I have a number of cascading dropdownlist controls on a page. The results in dropdownlist2 are dependent on the results in dropdownlist1, pretty basic stuff.
I now would like to eliminate the terrible postback or refresh of the page that occurs after the SelectedIndexChanged event fires on dropdownlist1, is it possible to do that in Ajax?
What I want the results in dropdownlist2 to populate without the obvious refresh of the page.
View 2 Replies
Mar 12, 2011
I want to disable every fifth item in a dropdownlist.
dropdownlist1.items[i].Attributes.Add("disabled","disabled");
How do I write the logic to disable every fifth item in a Dropdownlist?
I am using two for loops: one for displaying items and one for disabling items in dropdownlist. How can I simplify my code?
View 5 Replies
Mar 17, 2011
Simple but weird? problem. I simply want to "disable" some asp.net dropdownlists
<asp:DropDownList Enabled="false" CssClass="DropDownGrade" ID="DropDownListMGP" SelectedValue='<%# Bind("[MGP]") %>' runat="server">
<asp:ListItem>1.00</asp:ListItem>
<asp:ListItem>1.25</asp:ListItem>
<asp:ListItem>1.50</asp:ListItem>
Enabled="false" don't work in the first place.My jquery code doesnt work either:
$('.DropDownGrade').attr('disabled', 'disabled');
View 2 Replies
Jan 12, 2011
I want dont refresh page updata DropDownList I donot use AjaxToolKit
View 2 Replies
Nov 4, 2013
I am trying to refresh updatepanel using dropdownlist but facing problems.
<asp:DropDownList ID="ddlClass" EnableViewState="true" AutoPostBack="false" class="input-large span10" runat="server" onchange="loadAllDefaults();" Style="width: auto;">
</asp:DropDownList>
Above is the code of dropdownlist
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="ddlClass" />
</Triggers>
<ContentTemplate>
<asp:Repeater ID="rep1" runat="server">
[Code] ....
This is updatepanel code. as shown in the code, i am referring to ddlClass in triggers which already calls a javascript function loadAllDefaults();
The problem is, since ddlClass is calling javascript function 'onchange' property, i cannot call any other function of backend code and I want to refresh the updatepanel on the basis of selected value of dropdownlist.
How can i do this? I have created a function in c# code in backend but I am not able to call both functions together!
View 1 Replies