Search Results

Search found 1705 results on 69 pages for 'runat'.

Page 10/69 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Jquery datepicker popup not closing on select date in IE8

    - by Notorious2tall
    I've got a web form with a start date field. I've tied a jquery datepicker to the txt field. Now when I choose a date in FF, the selected date is populated in the text box and the calendar popup closes. However when I do the same thing in IE8, the selected date is populated in the text box but the popup remains open. I've also noticed that a script error is generated as soon as I select a date in the popup calendar. I'm using jquery 1.3.2, jquery-ui 1.7.2, and .NET 3.5. Here's an example of my code: <script type="text/javascript"> $(document).ready(function() { $("#<%=txtStartDate.ClientID%>").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOn: 'button', buttonImage: '/_layouts/images/CALENDAR.GIF', buttonImageOnly: true }); }); </script> <div id="stylized"> <asp:ValidationSummary ID="vs" runat="server" CssClass="messages-error" HeaderText=" Action required before the form can be submitted." ForeColor="" ValidationGroup="sh" /> <div class="formrow"> <div class="ms-formlabel formlabel"> <asp:Label ID="lblStartDate" runat="server" CssClass="ms-standardheader" AssociatedControlID="txtStartDate">Start Date:</asp:Label> </div> <div class="ms-formbody formfield"> <asp:RequiredFieldValidator ID="reqStartDate" runat="server" ControlToValidate="txtStartDate" ErrorMessage="Start Date is a required field." Text="*" Display="Dynamic" ValidationGroup="sh"></asp:RequiredFieldValidator> <asp:CompareValidator ID="cvStartDate" runat="server" ControlToValidate="txtStartDate" ErrorMessage="Date must be in the format MM/DD/YYYY" Text="*" Display="Dynamic" ValidationGroup="sh" Operator="DataTypeCheck" Type="Date"></asp:CompareValidator> <asp:TextBox ID="txtStartDate" runat="server"></asp:TextBox> <span class="formMessage">ex. MM/DD/YYYY</span> </div> </div> <div id="buttonrow"> <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="ms-ButtonHeightWidth" OnClick="Submit_Click" ValidationGroup="sh" /> <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="ms-ButtonHeightWidth" OnClick="Cancel_Click" CausesValidation="false" /> </div> </div> Here's the script error I get in IE when I select the date: 'length' is null or not an object WebResource.axd Here's the code where the error is being thrown from: function ValidatorOnChange(event) { if (!event) { event = window.event; } Page_InvalidControlToBeFocused = null; var targetedControl; if ((typeof(event.srcElement) != "undefined") && (event.srcElement != null)) { targetedControl = event.srcElement; } else { targetedControl = event.target; } var vals; if (typeof(targetedControl.Validators) != "undefined") { vals = targetedControl.Validators; } else { if (targetedControl.tagName.toLowerCase() == "label") { targetedControl = document.getElementById(targetedControl.htmlFor); vals = targetedControl.Validators; } } var i; for (i = 0; i < vals.length; i++) { ValidatorValidate(vals[i], null, event); } ValidatorUpdateIsValid(); } It happens on the .length in the for loop at the end. Vals is null and isn't found in the previous if/else. I've stepped through the javascript and if (typeof(targetedControl.Validators) != "undefined") returns false and then if (targetedControl.tagName.toLowerCase() == "label") returns false too. Thus the length is null or not an object error. Now I'm not sure if the datepicker popup not closing in IE and the script error in the WebResources.axd file are related errors, but I'm leaning that way. Can anyone tell me why the popup isn't closing?

    Read the article

  • Hidden/Shown AsyncFileUpload Control Doesn't Fire Server-Side UploadedComplete Event

    - by Bob Mc
    I recently came across the AsyncFileUpload control in the latest (3.0.40412) release of the ASP.Net Ajax Control Toolkit. There appears to be an issue when using it in a hidden control that is later revealed, such as a <div> tag with visible=false. Example: Page code - <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="act" %> . . . <act:ToolkitScriptManager runat="server" ID="ScriptManager1" /> <asp:UpdatePanel runat="server" ID="upnlFileUpload"> <ContentTemplate> <asp:Button runat="server" ID="btnShowUpload" Text="Show Upload" /> <div runat="server" id="divUpload" visible="false"> <act:AsyncFileUpload runat="server" id="ctlFileUpload" /> </div> </ContentTemplate> </asp:UpdatePanel> Server-side Code - Protected Sub ctlFileUpload_UploadedComplete(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles ctlFileUpload.UploadedComplete End Sub Protected Sub btnShowUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnShowUpload.Click divUpload.Visible = True End Sub I have a breakpoint on the UploadedComplete event but it never fires. However, if you take the AsyncFileUpload control out of the <div>, making it visible at initial page render, the control works as expected. So, is this a bug within the AsynchUploadControl, or am I not grasping a fundamental concept (which happens regularly)?

    Read the article

  • Why are my labels not updating in my update panel in ASP.NET?

    - by CowKingDeluxe
    I have a label in my update panel that I want to update its text on after a successful asynchronus file upload. Here's my markup: <asp:UpdatePanel ID="UpdatePanel1" runat="server"><ContentTemplate> Step 1 (<asp:Label ID="label_fileupload" runat="server" />): <br /> <ajaxToolkit:AsyncFileUpload ID="AsyncFileUpload1" Width="200px" runat="server" CompleteBackColor="Lime" UploaderStyle="Modern" ErrorBackColor="Red" ThrobberID="Throbber" UploadingBackColor="#66CCFF" OnClientUploadStarted="StartUpload" /> <asp:Label ID="Throbber" runat="server" Style="display: none"><img src="/images/indicator.gif" alt="loading" /></asp:Label> <br /> <asp:Label ID="statuslabel" runat="server" Text="Label"></asp:Label> </ContentTemplate></asp:UpdatePanel> Here is my code-behind: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If (IsPostBack) Then Else label_fileupload.Text = "Incomplete" label_fileupload.CssClass = "uploadincomplete" statuslabel.Text = "NOT DONE" End If End Sub Public Sub AsyncFileUpload1_UploadedComplete1(ByVal sender As Object, ByVal e As AjaxControlToolkit.AsyncFileUploadEventArgs) Handles AsyncFileUpload1.UploadedComplete System.Threading.Thread.Sleep(1000) If (AsyncFileUpload1.HasFile) Then Dim strPath As String = MapPath("/images/White.png") AsyncFileUpload1.SaveAs(strPath) End If label_fileupload.Text = "Complete" label_fileupload.CssClass = "uploadcomplete" statuslabel.Text = "DONE" End Sub When I set the labels to update via a button click, they work. But when I set them to update via the Upload complete event, they don't work. Is there some way around this to get the labels to update their text / css class from the UploadedComplete event of an asynchronous file upload control?

    Read the article

  • How to prevent ajax toolkit DropDownExtender from closing on click?

    - by Abe Miessler
    I have the code below to implement a dropdownlist with checkboxes. My problem is that every time i click a checkbox the dropdownlist closes and i need to reopen it to select more checkboxes. How do i make it so the dropdownlist dosn't close until i click off of it? <asp:Panel ID="pnl_Items" runat="server" BorderColor="Aqua" BorderWidth="1"> <asp:CheckBoxList ID="cbl_Items" runat="server"> <asp:ListItem Text="Item 1" /> <asp:ListItem Text="Item 2" /> <asp:ListItem Text="Item 3" /> </asp:CheckBoxList> </asp:Panel> <br /> <asp:TextBox ID="tb_Items" runat="server"></asp:TextBox> <ajax:DropDownExtender ID="TextBox1_DropDownExtender" runat="server" DynamicServicePath="" Enabled="True" DropDownControlID="pnl_Items" on TargetControlID="tb_Items"> </ajax:DropDownExtender>

    Read the article

  • Binding a DropDownList in ListView InsertItemTemplate throwing an error

    - by Telos
    I've got a ListView which binds to a LinqDataSource and displays selected locations. The insert item Contains a dropdownlist that pulls from another LinqDataSource to give all the unselected locations. The problem is that I get the following error when loading the page: Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. I'm doing a very similar setup in another page of the website, and it isn't giving us this error so I'm pretty confused. I know I can work around this by not binding, manually finding the control and getting the value, but this should work and I don't understand why it isn't. Any thoughts? The better part of the source code is below. <asp:LinqDataSource ID="ldsLocations" runat="server" ContextTypeName="ClearviewInterface.ESLinqDataContext" EnableDelete="true" EnableInsert="true" OnInserting="ldsLocations_Inserting" OnDeleting="ldsLocations_Deleting" TableName="crmLocations" OrderBy="addr1" OnSelecting="ldsLocations_Selecting" /> <asp:LinqDataSource ID="ldsFreeLocations" runat="server" ContextTypeName="ClearviewInterface.ESLinqDataContext" OrderBy="addr1" TableName="v_CVLocations" OnSelecting="ldsFreeLocations_Selecting" /> <asp:ListView ID="lvLocations" DataSourceID="ldsLocations" DataKeyNames="ID" InsertItemPosition="LastItem" runat="server" > <InsertItemTemplate> <tr> <td colspan="6"><hr /></td> </tr> <tr> <td colspan="2"> <asp:DropDownList ID="ddlFreeLocations" DataSourceID="ldsFreeLocations" DataTextField="addr1" DataValueField="record" MarkFirstMatch="true" SelectedValue='<%# Bind("record") %>' runat="server" /> </td> <td><asp:ImageButton ID="btnAdd" CommandName="Insert" SkinID="Insert" runat="server" /></td> </tr> </InsertItemTemplate>

    Read the article

  • asp.net ModalPopupExtender : need to show scroll bar when overflow

    - by DavRob60
    I display a gridview in a ModalPopupExtender. When the screen resolution is to small, the pop-up is to big to all be displayed on the page. I just want to add scroll bar to the pop-up when this happen. I know it's probably some CSS, but all I tried did not work. here some base css .modalTextBoxBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; } .modalTextBox { border: 1px solid #FFFFFF; background-color: #0066CC; color: #00FFFF; } here some code from the aspx <asp:Panel ID="OptionSelectionPanel" runat="server" CssClass="modalTextBox"> <asp:UpdatePanel ID="OptionSelectionUpdatePanel" runat="server" UpdateMode="Conditional" > <Triggers> <asp:asyncPostBackTrigger ControlID="TemplateSelection" /> </Triggers> <ContentTemplate> <table class="EditRow"> <tr class="HeaderFooter"> <td colspan="3" class="modalTextBoxTitle"> Add options to Quote </td> </tr> <tr> <td> Manufacturer </td> <td> <asp:DropDownList ID="OptionManufacturerFilter" runat="server" DataSourceID="OptionManufacturerDataSource" DataTextField="Name" DataValueField="Code" AutoPostBack="True" > </asp:DropDownList> </td> </tr> <tr> <td colspan="3"> <asp:GridView ID="NewOptionSelection" runat="server" DataSourceID="AvailableOptions" DataKeyNames="Option_Id" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="false"> <Columns> <asp:BoundField DataField="category_Descr" HeaderText="Category" SortExpression="category_Descr,subcategory_Descr,code" /> <asp:BoundField DataField="subcategory_Descr" HeaderText="Sub-Category" SortExpression="subcategory_Descr,code" /> <asp:BoundField DataField="Manuf_Name" HeaderText="Manufacturer" SortExpression="Manuf_Name"/> </Columns></asp:GridView> </td> </tr> <tr class="HeaderFooter"> <td colspan="3" class="Center"> <asp:Button ID="OptionSelectionClose" runat="server" Text="Close" /> </td> </tr> </table> </ContentTemplate> </asp:UpdatePanel> </asp:Panel> <asp:Button runat="server" ID="HiddenTargetControlForOptionSelectionModalPopup" style="display:none"/> <cc1:ModalPopupExtender ID="OptionSelectionModalPopupExtender" runat="server" TargetControlID="HiddenTargetControlForOptionSelectionModalPopup" PopupControlID="OptionSelectionPanel" BackgroundCssClass="modalTextBoxBackground" />

    Read the article

  • ASP.Net Panel JQuery SlideToggle Postback

    - by Germ
    I have an asp.net panel with a style which hides it and I'm using JQuery to slideToggle the panel using a hyperlink. This works fine. However, if I add a button on the page that causes a postback the panel will default back to hidden. I understand why this is happening but what is the best way to keep the panels visibility state when a postback occurs? <head runat="server"> <title></title> <script type='text/javascript' src="jquery-1.4.1.min.js"> </script> <style type="text/css"> .panel { display: none; } </style> <script type="text/javascript"> $(function() { $("#Link1").click(function(evt) { evt.preventDefault(); $('#panelText').slideToggle('slow'); }); }); </script> </head> <body> <form id="form1" runat="server"> <asp:HyperLink ID="Link1" runat="server" NavigateUrl="#">SlideToggle </asp:HyperLink><br /> <asp:Panel ID="panelText" runat="server" CssClass="panel"> Some text</asp:Panel> <asp:Button ID="button1" runat="server" Text="Postback" /> </form> </body> </html>

    Read the article

  • The name 'GridView1' does not exist in the current context

    - by sameer
    hi all, I have two files named as TimeSheet.aspx.cs and TimSheet.aspx ,code of the file are given below for your reference. when i build the application im getting error "The name 'GridView1' does not exist in the current context" even thought i have a control with the id GridView1 and i have added the runat="server" as well. Im not able to figure out what is causing this issue.Can any one figure whats happen here. Thanks & Regards, ======================================= TimeSheet.aspx.cs ======================================= #region Using directives using System; using System.Data; using System.Configuration; 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; using TSMS.Web.UI; #endregion public partial class TimeSheets: Page { protected void Page_Load(object sender, EventArgs e) { FormUtil.RedirectAfterUpdate(GridView1, "TimeSheets.aspx?page={0}"); FormUtil.SetPageIndex(GridView1, "page"); FormUtil.SetDefaultButton((Button)GridViewSearchPanel1.FindControl("cmdSearch")); } protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { string urlParams = string.Format("TimeSheetId={0}", GridView1.SelectedDataKey.Values[0]); Response.Redirect("TimeSheetsEdit.aspx?" + urlParams, true); } protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { } } ======================================================= TimeSheet.aspx ======================================================= <%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true" CodeFile="TimeSheets.aspx.cs" Inherits="TimeSheets" Title="TimeSheets List" %> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Time Sheets List</asp:Content> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <data:GridViewSearchPanel ID="GridViewSearchPanel1" runat="server" GridViewControlID="GridView1" PersistenceMethod="Session" /> <br /> <data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataSourceID="TimeSheetsDataSource" DataKeyNames="TimeSheetId" AllowMultiColumnSorting="false" DefaultSortColumnName="" DefaultSortDirection="Ascending" ExcelExportFileName="Export_TimeSheets.xls" onrowcommand="GridView1_RowCommand" > <Columns> <asp:CommandField ShowSelectButton="True" ShowEditButton="True" /> <asp:BoundField DataField="TimeSheetId" HeaderText="Time Sheet Id" SortExpression="[TimeSheetID]" ReadOnly="True" /> <asp:BoundField DataField="TimeSheetTitle" HeaderText="Time Sheet Title" SortExpression="[TimeSheetTitle]" /> <asp:BoundField DataField="StartDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Start Date" SortExpression="[StartDate]" /> <asp:BoundField DataField="EndDate" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="End Date" SortExpression="[EndDate]" /> <asp:BoundField DataField="DateOfCreation" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Date Of Creation" SortExpression="[DateOfCreation]" /> <data:BoundRadioButtonField DataField="Locked" HeaderText="Locked" SortExpression="[Locked]" /> <asp:BoundField DataField="ReviewedBy" HeaderText="Reviewed By" SortExpression="[ReviewedBy]" /> <data:HyperLinkField HeaderText="Employee Id" DataNavigateUrlFormatString="EmployeesEdit.aspx?EmployeeId={0}" DataNavigateUrlFields="EmployeeId" DataContainer="EmployeeIdSource" DataTextField="LastName" /> </Columns> <EmptyDataTemplate> <b>No TimeSheets Found!</b> </EmptyDataTemplate> </data:EntityGridView> <asp:GridView ID="GridView2" runat="server"> </asp:GridView> <br /> <asp:Button runat="server" ID="btnTimeSheets" OnClientClick="javascript:location.href='TimeSheetsEdit.aspx'; return false;" Text="Add New"></asp:Button> <data:TimeSheetsDataSource ID="TimeSheetsDataSource" runat="server" SelectMethod="GetPaged" EnablePaging="True" EnableSorting="True" EnableDeepLoad="True" > <DeepLoadProperties Method="IncludeChildren" Recursive="False"> <Types> <data:TimeSheetsProperty Name="Employees"/> <%--<data:TimeSheetsProperty Name="TimeSheetDetailsCollection" />--%> </Types> </DeepLoadProperties> <Parameters> <data:CustomParameter Name="WhereClause" Value="" ConvertEmptyStringToNull="false" /> <data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> <asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex" Type="Int32" /> <asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize" Type="Int32" /> <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" /> </Parameters> </data:TimeSheetsDataSource> </asp:Content>

    Read the article

  • asp.net detailsview update method not getting new values

    - by Ali
    Hi all, I am binding a detailsview with objectdatasource which gets the select parameter from the querystring. The detailsview shows the desired record, but when I try to update it, my update method gets the old values for the record (and hence no update). here is my detailsview code: <asp:DetailsView ID="dvUsers" runat="server" Height="50px" Width="125px" AutoGenerateRows="False" DataSourceID="odsUserDetails" onitemupdating="dvUsers_ItemUpdating"> <Fields> <asp:CommandField ShowEditButton="True" /> <asp:BoundField DataField="Username" HeaderText="Username" SortExpression="Username" ReadOnly="true" /> <asp:BoundField DataField="FirstName" HeaderText="First Name" SortExpression="FirstName" /> <asp:BoundField DataField="LastName" HeaderText="Last Name" SortExpression="LastName" /> <asp:BoundField DataField="Email" runat="server" HeaderText="Email" SortExpression="Email" /> <asp:BoundField DataField="IsActive" HeaderText="Is Active" SortExpression="IsActive" /> <asp:BoundField DataField="IsOnline" HeaderText="Is Online" SortExpression="IsOnline" ReadOnly="true" /> <asp:BoundField DataField="LastLoginDate" HeaderText="Last Login" SortExpression="LastLoginDate" ReadOnly="true" /> <asp:BoundField DataField="CreateDate" HeaderText="Member Since" SortExpression="CreateDate" ReadOnly="true" /> <asp:TemplateField HeaderText="Membership Ends" SortExpression="ExpiryDate"> <EditItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ExpiryDate") %>'></asp:TextBox> <cc1:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" Enabled="True" TargetControlID="TextBox1"> </cc1:CalendarExtender> </EditItemTemplate> <InsertItemTemplate> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ExpiryDate") %>'></asp:TextBox> </InsertItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("ExpiryDate") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Fields> and here is the objectdatasource code: <asp:ObjectDataSource ID="odsUserDetails" runat="server" SelectMethod="GetAllUserDetailsByUserId" TypeName="QMS_BLL.Membership" UpdateMethod="UpdateUserForClient"> <UpdateParameters> <asp:Parameter Name="User_ID" Type="Int32" /> <asp:Parameter Name="firstName" Type="String" /> <asp:Parameter Name="lastName" Type="String" /> <asp:SessionParameter Name="updatedByUser" SessionField="userId" DefaultValue="1" /> <asp:Parameter Name="expiryDate" Type="DateTime" /> <asp:Parameter Name="Email" Type="String" /> <asp:Parameter Name="isActive" Type="String" /> </UpdateParameters> <SelectParameters> <asp:QueryStringParameter DefaultValue="1" Name="User_ID" QueryStringField="User_ID" Type="Int32" /> </SelectParameters> </asp:ObjectDataSource> Is the OnItemUpdating method still required when you have your custom BLL method called on insertevent? (which is being executed fine in my case but updating with the old values) or am I missing something else? Also I tried to provide an OnItemUpdating method and in there I tried to capture the contents of the textboxes (the new values). I got an exception: "Specified argument was out of the range of valid values. Parameter name: index" when I tried to do: TextBox txtFirstName = (TextBox)dvUsers.Rows[1].Cells[1].Controls[0]; Any help will be most appreciated.

    Read the article

  • Weird exception in linkbutton in a datalist

    - by user308806
    Dear all, I have written this datalist : <div class="story" runat="server"> <asp:DataList ID="DataList2" runat="server" Height="16px" Width="412px"> <SeparatorTemplate> <hr /> </SeparatorTemplate> <ItemTemplate> <asp:LinkButton ID="LinkButton1" runat ="server" Text='<%# Eval("Name") %>' PostBackUrl='<%#Eval("Url")%>' /> <br /> Description: <asp:Label ID="new" Text='<%#Eval("Description") %>' runat="server" /> </ItemTemplate> </asp:DataList> </div> It raises an exception saying that the linkbutton has to be placed in a tag that contains runat="server" although it exists. Here is the trace [HttpException (0x80004005): Le contrôle 'DataList2_ctl00_LinkButton1' de type 'LinkButton' doit être placé dans une balise form avec runat=server.] System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +8689747 System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter writer) +39 System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20 System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10 System.Web.UI.WebControls.DataListItem.RenderItemInternal(HtmlTextWriter writer, Boolean extractRows, Boolean tableLayout) +51 System.Web.UI.WebControls.DataListItem.RenderItem(HtmlTextWriter writer, Boolean extractRows, Boolean tableLayout) +57 System.Web.UI.WebControls.DataList.System.Web.UI.WebControls.IRepeatInfoUser.RenderItem(ListItemType itemType, Int32 repeatIndex, RepeatInfo repeatInfo, HtmlTextWriter writer) +64 System.Web.UI.WebControls.RepeatInfo.RenderVerticalRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl) +262 System.Web.UI.WebControls.RepeatInfo.RenderRepeater(HtmlTextWriter writer, IRepeatInfoUser user, Style controlStyle, WebControl baseControl) +27 System.Web.UI.WebControls.DataList.RenderContents(HtmlTextWriter writer) +208 System.Web.UI.WebControls.BaseDataList.Render(HtmlTextWriter writer) +30 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

    Read the article

  • Why does a ModalPopupExtender fail when using SSL?

    - by Brooke Jackson
    I have created a modal popup using the ModalPopupExtender in Microsoft's AJAX 1.0 for .NET 2.0. It works great when the page doesn't isn't being accessed through SSL (http://) however the link to close the popup fails to fire if accessing the page through https://. Is the ModalPopupExtender at blame? Is it a "Feature" of SSL to block popups, or is it something else I haven't though of? Here is the code I am using: <asp:Button ID="btnHelp" runat="server" Text="?" CausesValidation="False" /> <asp:Panel ID="pnlHelp" BackColor="white" runat="server"> <asp:LinkButton ID="lnkClosePanel" runat="server" CausesValidation="False" OnClick="lnkCloseHelp_Click">Close</asp:LinkButton> <p>Some Text</p> </asp:Panel> <cc1:ModalPopupExtender ID="popExt" runat="server" TargetControlID="btnHelp" PopupControlID="pnlHelp"></cc1:ModalPopupExtender>

    Read the article

  • How to find the data key on CheckedChanged event of checkbox in ListView in ASP.NET?

    - by subodh
    I am using a list view inside that in item template i am using a label and a checkbox. I want that whenever user clicks on the check box the value should be updated in a table.i am using a datakeys in listview.on the basis of datakey value should be updated in the table. Query is: string updateQuery = "UPDATE [TABLE] SET [COLUMN] = " + Convert.ToInt32(chk.Checked) + " WHERE PK_ID =" + dataKey + " ";` also i want some help in displaying the result as it is inside the table.means if the value for column in table for a particular pkid is 1 then the checkbox shoul be checked. Here is the code snippet: <asp:ListView ID="lvFocusArea" runat="server" DataKeyNames="PK_ID" OnItemDataBound="lvFocusArea_ItemDataBound"> <LayoutTemplate> <table border="0" cellpadding="1" width="400px"> <tr style="background-color: #E5E5FE"> <th align="left"> Focus Area </th> <th> Is Current Focused </th> </tr> <tr id="itemPlaceholder" runat="server"> </tr> </table> </LayoutTemplate> <ItemTemplate> <tr> <td width="80%"> <asp:Label ID="lblFocusArea" runat="server" Text=""><%#Eval("FOCUS_AREA_NAME") %></asp:Label> </td> <td align="center" width="20%"> <asp:CheckBox ID="chkFocusArea" runat="server" OnCheckedChanged="chkFocusArea_CheckedChanged" AutoPostBack="true" /> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr style="background-color: #EFEFEF"> <td> <asp:Label ID="lblFocusArea" runat="server" Text=""><%#Eval("FOCUS_AREA_NAME") %></asp:Label> </td> <td align="center"> <asp:CheckBox ID="chkFocusArea" runat="server" OnCheckedChanged="chkFocusArea_CheckedChanged" AutoPostBack="true" /> </td> </tr> </AlternatingItemTemplate> <SelectedItemTemplate> <td> item selected </td> </SelectedItemTemplate> </asp:ListView> Help me.

    Read the article

  • Binding menu items to a sitemap.

    - by Ricardo Deano
    Hello all..this is driving me nuts. I have a navigation menu I would like to display based upon user roles (using.net membership) After several hours and headaches (from banging my head against the desk) I was wondering if someone can point me in the error of my ways. Page: <body> <form runat="server"> <div class="page"> <div class="header"> <div class="loginDisplay"> <asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"> <AnonymousTemplate> <a href="~/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> </AnonymousTemplate> <LoggedInTemplate> Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>! [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Open/Close.aspx"/> ] </LoggedInTemplate> </asp:LoginView> </div> <div class="clear hideSkiplink"> <asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" IncludeStyleBlock="False" Orientation="Horizontal" DataSourceID="AugustSiteMap" /> <asp:SiteMapDataSource ID="AugustSiteMap" runat="server" ShowStartingNode="false"/> </div> </div> SiteMap: <?xml version="1.0" encoding="utf-8" ?> <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" > <siteMapNode url="~/Default.aspx" title="Home" description="Home"> <siteMapNode title="Open Pages" description="Open Pages"> <siteMapNode url="~/Open/Login.aspx" title="Login Page" description="Login Page" roles="*"/> <siteMapNode url="~/Open/Close.aspx" title="Thank you for using Valpak Data Solutions Online Reporting" description="Thank you for using Valpak Data Solutions Online Reporting" roles="*"/> </siteMapNode> <siteMapNode title="Logged In Open Pages" description="Logged In Open Pages"> <siteMapNode url="~/Landing.aspx" title="Landing Page" description="Landing Page" roles="*"/> <siteMapNode url="~/ContactUs.aspx" title="Contact Us" description="Contact Us" roles="*"/> </siteMapNode> <siteMapNode title="Restricted Pages" description="Resticted Pages"> <siteMapNode url="~/Restricted/ProductSearch.aspx" title=" Product Search" description=" Product Search" roles="*"/> <siteMapNode url="~/Restricted/ReportOutput.aspx" title="Report Output" description="Report Output" roles="Admin"/> </siteMapNode> </siteMapNode> </siteMap> Webconfig: <roleManager enabled="true" /> <siteMap defaultProvider="XmlSiteMapProvider" enabled="true"> <providers> <add name="XmlSiteMapProvider" description="AugustSiteMap" type="System.Web.XmlSiteMapProvider " siteMapFile="AugustSiteMap.sitemap" securityTrimmingEnabled="true" /> </providers> </siteMap> How can I ensure that when the user is logged in, the appropriate menu items are displayed on the Landing page? Please excuse my ignorance. Still new to all of this and my current method of 'trial and error' has seen me reach suicide levels this morning!

    Read the article

  • Change the source of image by clicking thumbnail using updatePanel

    - by Batu
    For example, i have this ImageViewer.ascx UserControl: <div class="ImageTumbnails"> <asp:ListView ID="ImageList" runat="server" ItemPlaceholderID="ItemContainer"> <LayoutTemplate> <asp:PlaceHolder ID="ItemContainer" runat="server" /> </LayoutTemplate> <ItemTemplate> <asp:HyperLink runat="server" NavigateUrl='<%# Link.ToProductImage(Eval("ImageFile").ToString())%>'> <asp:Image runat="server" ImageUrl='<%# Link.ToThumbnail(Eval("ImageFile").ToString()) %>' /> </asp:HyperLink> </ItemTemplate> </asp:ListView> </div> <div class="ImageBig"> <asp:Image ID="ProductImageBig" runat="server" ImageUrl="" /> </div> When the thumbnail is clicked it will change the source of ProductImageBig with its hyperlink target. How can i achieve this using UpdatePanel ? ( Or will i be able to )

    Read the article

  • Select All CheckBoxes in GridView ASP.NET using JQuery

    - by dexter
    I have checkBoxes in my Gridview templete columns called "Category A" and "Category B". I want Select-All functionality, i.e. when the user checks the Select-All check Box in category A column, all the checkboxes must get checked under that column. Same for Category B. I am trying with the code below. The problem with my code is, it selects all the check boxes in the entire gridview, "Category A" as well as "Category B"s checkboxes. But, I want only checkboxes selected under the same column. function SelectAllCheckboxesA(chk) { $('#<%=gvSurveys.ClientID %>').find("input:checkbox").each(function() { if (this != chk) { if ($(this).hasClass('CatA') != false) { this.checked = chk.checked; } } else { alert($(this)); } }); } <asp:GridView ID="gvSurveys" runat="server" AutoGenerateColumns="false" AllowSorting="True" Width="1500px"> <Columns> <asp:TemplateField> <HeaderTemplate>Category A <asp:CheckBox ID="chkSelectAllCatA" runat="server" Visible="false" onclick="javascript:SelectAllCheckboxesA(this);" CssClass="SACatA" /> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chkCatA" runat="server" Enabled="false" CssClass="CatA" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Category B <asp:CheckBox ID="chkSelectAllCatB" runat="server" Visible="false" CssClass="CatB" onclick="javascript:SelectAllCheckboxesB(this);" /> </HeaderTemplate> <ItemTemplate> <asp:CheckBox ID="chkCatB" runat="server" Enabled="false" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView>

    Read the article

  • Problem with Ajax Toolkit ASP.NET (Visual Basic)

    - by AZIRAR
    Hey, I'm trying to use Ajax Toolkit in ASP.NET page to display a Calendar Extender with this code, but it's not working for me. <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <br /> <br /> <b>Calendar :</b><br /> <asp:TextBox ID="Date1" runat="server"></asp:TextBox> <asp:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="Date1"> </asp:CalendarExtender> </div> </form> It's not displaying the calendar. What's the problem ?

    Read the article

  • Dropdown OnSelectedIndexChanged not firing

    - by Jim
    The OnSelectedIndexChanged event is not firing for my dropdown box. All forums I have looked at told me to add the AutoPostBack="true", but that didn't change the results. HTML: <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label1" runat="server" Text="Current Time: " /> <br /> <asp:Label ID="lblCurrent" runat="server" Text="Label" /><br /><br /> <asp:DropDownList ID="cboSelectedLocation" runat="server" AutoPostBack="true" OnSelectedIndexChanged="cboSelectedLocation_SelectedIndexChanged" /><br /><br /> <asp:Label ID="lblSelectedTime" runat="server" Text="Label" /> </div> </form> </body> </html> Code behind: public partial class _Default : System.Web.UI.Page { string _sLocation = string.Empty; string _sCurrentLoc = string.Empty; TimeSpan _tsSelectedTime; protected void Page_Load(object sender, EventArgs e) { AddTimeZones(); cboSelectedLocation.Focus(); lblCurrent.Text = "Currently in " + _sCurrentLoc + Environment.NewLine + DateTime.Now; lblSelectedTime.Text = _sLocation + ":" + Environment.NewLine + DateTime.UtcNow.Add(_tsSelectedTime); } //adds all timezone displaynames to combobox //defaults combo location to seoul, South Korea //defaults current location to current location private void AddTimeZones() { foreach(TimeZoneInfo tz in System.TimeZoneInfo.GetSystemTimeZones()) { string s = tz.DisplayName; cboSelectedLocation.Items.Add(s); if (tz.StandardName == "Korea Standard Time") cboSelectedLocation.Text = s; if (tz.StandardName == System.TimeZone.CurrentTimeZone.StandardName) _sCurrentLoc = tz.StandardName; } } //changes timezone name and time depending on what is selected in the cbobox. protected void cboSelectedLocation_SelectedIndexChanged(object sender, EventArgs e) { foreach (TimeZoneInfo tz in System.TimeZoneInfo.GetSystemTimeZones()) { if (cboSelectedLocation.Text == tz.DisplayName) { _sLocation = tz.StandardName; _tsSelectedTime = tz.GetUtcOffset(DateTime.UtcNow); } } } } Any advice into what to look at for a rookie asp coder? EDIT: added more code behind

    Read the article

  • How to perform two-way data binding of controls in a user control inside a FormView

    - by Sandor Drieënhuizen
    I'm trying to perform two-way data binding on the controls in my user control, which is hosted inside a FormView template. FormView: <asp:ObjectDataSource runat="server" ID="ObjectDataSource" TypeName="WebApplication1.Data" SelectMethod="GetItem" UpdateMethod="UpdateItem"> </asp:ObjectDataSource> <asp:FormView runat="server" ID="FormView" DataSourceID="ObjectDataSource"> <ItemTemplate> <uc:WebUserControl1 runat="server"></uc:WebUserControl1> </ItemTemplate> <EditItemTemplate> <uc:WebUserControl1 runat="server"></uc:WebUserControl1> </EditItemTemplate> </asp:FormView> User control: <%@ Control Language="C#" ... %> <asp:TextBox runat="server" ID="TitleTextBox" Text='<%# Bind("Title") %>'> </asp:TextBox> The binding works fine when the FormView is in View mode but when I switch to Edit mode, upon calling UpdateItem on the FormView, the bindings are lost. I know this because the FormView tries to call an update method on the ObjectDataSource that does not have an argument called 'Title'. I tried to solve this by implementing IBindableTemplate to load the controls that are inside my user control, directly into the templates (just like I had entered them declaratively like in the code above). However, when calling UpdateItem in edit mode, the container that gets passed into the ExtractValues method of the template, does not contain the TextBox anymore. It did in view mode! I have found some questions on SO that relate to this problem but they are rather dated and they don't provide any answers that helped me solve this problem. How do you think I could solve this problem? It seems to be such a simple requirement but apparently it's more like opening a can of worms...

    Read the article

  • Setting up a button to trigger both modalPopupExtender and his Click Method

    - by Vitor Reis
    Hey guys, I have this modalPopupExtender, I want it to show a CheckBoxList with some data. I have set up a button to call both the method to fill the CheckBoxes and trigger the modalPopup (TargetControlID). they're all inside an UpdatePanel. with the right triggers. The problem is that when I click the button it shows the modalPopup but doesn't load the method to fill my CheckBoxes... Also, a linkButton inside the poup (linkButtonCheckAll) just closes the popup when clicked. When I remove the modalPopup the code works just fine and the list is loaded dinamically with the UpdatePanel. <asp:UpdatePanel ID="uppLote" runat="server"> <ContentTemplate> <ajaxToolkit:ModalPopupExtender ID="modalLote" runat="server" BehaviorID="popup" TargetControlID="buttonViewLote" PopupControlID="panelLote" /> <asp:Panel ID="panelLote" runat="server" CssClass="modalpopup"> <asp:LinkButton ID="linkButtonCheckAll" runat="server" Text="Check All Items" onclick="linkButtonCheckAll_Click"></asp:LinkButton> <asp:CheckBoxList ID="checkListLote" runat="server"> </asp:CheckBoxList> </asp:Panel> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="linkButtonViewLote" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="linkButtonCheckAll" EventName="Click" /> </Triggers> </asp:UpdatePanel> If I completely remove the modalPopupExtender, the code works fine, showing me the list I want with the method "linkButonViewLote_Click" (so, the problem is occurring due to the button triggering the modalPopupExtender is the same that I'm using to get my data, right? Any solutions?

    Read the article

  • ASP.NET treeview populate child nodes. How can I avoid a postback to server?

    - by mas_oz2k1
    I am trying to test populate on demand for a treeview. I follow the procedure from these links: http://msdn.microsoft.com/en-us/library/e8z5184w.aspx But the treeview still make a postback to the server if I expanded one of the tree nodes (If you put a breakpoint in the first line of Page_load event), thus refreshing the whole page. I am using VS2005 and Asp.net 2.0 (but the same issue occurs in VS2008) My simple test page markup is: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="aspTreeview.aspx.cs" Inherits="aspTreeview" %> <!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" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <table> <tr> <td style="height: 80%; width: 45%;"> <asp:Panel ID="Panel1" runat="server" BorderColor="#0033CC" BorderStyle="Solid" ScrollBars="Both"> <asp:TreeView ID="TreeView1" runat="server" ShowLines="True" PopulateNodesFromClient="True" EnableClientScript="True" NodeWrap="True" ontreenodepopulate="TreeView1_TreeNodePopulate" ExpandDepth="0"> </asp:TreeView> </asp:Panel> </td> <td style="width: 10%; height: 80%;" > <div> <asp:Button ID="Button1" runat="server" Text="->" onclick="Button1_Click" /> </div> <div> <asp:Button ID="Button2" runat="server" Text="<-" /> </div> </td> <td style="width: 136px; height: 80%"> <asp:Panel ID="Panel2" runat="server" BorderColor="Lime" BorderStyle="Solid"> <asp:TreeView ID="TreeView2" runat="server" ShowLines="True" ExpandDepth="0"> </asp:TreeView> </asp:Panel> </td> </tr> <tr> <td> </td> <td> </td> <td style="width: 136px"> </td> </tr> </table> </div> </form> </body> </html> The code behind is: protected void Page_Load(object sender, EventArgs e) { Debug.WriteLine("Page_Load started."); if (!IsPostBack) { if (Request.Browser.SupportsCallback) Debug.WriteLine("Browser supports callback scripts."); for (int i = 0; i < 3; i++) { TreeNode node = new TreeNode("ENTRY " + i.ToString()); node.Value = i.ToString(); node.PopulateOnDemand = true; node.Expanded = false; TreeView1.Nodes.Add(node); } } Debug.WriteLine("Page_Load finished."); } protected void TreeView1_TreeNodePopulate(object sender, TreeNodeEventArgs e) { TreeNode targetNode = e.Node; for (int j = 0; j < 4200; j++) { TreeNode subnode = new TreeNode(String.Format("Sub ENTRY {0} {1}", targetNode.Value, j)); subnode.PopulateOnDemand = true; subnode.Expanded = false; targetNode.ChildNodes.Add(subnode); } }

    Read the article

  • AsyncPostBackTrigger disables buttons...

    - by afsharm
    I've a simple UpdatePanel and a button outside of it. I've introduced the button as an AsyncPostBackTrigger in the UpdatePanel. UpdatePanel itself works fine but the button does not. Whenever the button is clicked, its click handler does not run just like the button is not clicked at all! Why the button is not working and how can it be fixed? UPDATE: here is the markup: <asp:UpdatePanel ID="upGridView" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:GridView ID="grdList" SkinID="SimpleGridView" DataKeyNames="Key" runat="server" AllowPaging="True" PageSize="15" AutoGenerateColumns="False" Caption="<%$ Resources: CommonResources, grdListCaption %>" EmptyDataText="<%$ Resources: CommonResources, grdListEmptyDataText %>" OnRowEditing="grdList_RowEditing" OnPageIndexChanging="grdList_PageIndexChanging" OnRowCreated="grdList_RowCreated"> <Columns> </Columns> </asp:GridView> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnDelete" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btnNew" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="btnForward" EventName="Click" /> </Triggers> </asp:UpdatePanel> <asp:Button ID="btnDelete" runat="server" SkinID="Button" Text="<%$ Resources: CommonResources, btnDelete %>" OnClick="btnDelete_Click" /> <asp:Button ID="btnNew" runat="server" SkinID="Button" Text="<%$ Resources: CommonResources, btnNew %>" OnClick="btnNew_Click" /> <asp:Button ID="btnForward" runat="server" SkinID="Button" meta:resourcekey="btnForward" OnClick="btnForward_Click" />

    Read the article

  • Enable/disable RequiredValidator on client-side / CustomValidator not firing

    - by Simeon
    I've got a drop-down where the user selects a Country. It is a required "field". Next to it, there is a textfield named State. If the user selects US, then the field State is required. If the user selects e.g. Sweden, the State is not required, since Sweden has no states. Example code: <asp:DropDownList runat="server" ID="Country"></asp:DropDownList> <asp:RequiredFieldValidator ControlToValidate="Country" runat="server" Display="Static" ErrorMessage="Required field" /> <asp:TextBox runat="server" ID="State"></asp:TextBox> <asp:CustomValidator ClientValidationFunction="DoesntGetFiredIfStateIsEmpty" runat="server" Display="Static" ErrorMessage="Required field" /> <!-- SO, RATHER THIS TOGETHER WITH CONDITIONAL FIRING --> <asp:RequiredFieldValidator ControlToValidate="State" runat="server" Display="Static" ErrorMessage="Required field" /> My question to you is: How can I make this CustomValidator fire validation when it is empty? Or put simplier: How can I make a RequiredValidator fire conditionally? Or simplest: How can I enable/disable a RequiredValidator on client-side?

    Read the article

  • Trying to Add Insert Row to Footer in GridView ASP.net

    - by chillconsulting
    I'm trying to give the user the ability to create a new record from the footer row and my event handler doesn't seem to be working... or maybe I'm going at this all wrong. The insert button that I enabled in the gridview doesn't work either...checkout the site at http://aisched.engr.oregonstate.edu/admin/courses.aspx Here is my code in front and behind: public partial class admin_courses : System.Web.UI.Page { public Table table; ListDictionary listValues = new ListDictionary(); TextBox textBox1 = new TextBox(); //Name TextBox textBox2 = new TextBox(); //CR TextBox textBox3 = new TextBox(); //CourseNum TextBox textBox4 = new TextBox(); //Dept protected void Page_Init() { } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType != DataControlRowType.Footer) return; //Escape if not footer textBox1.ID = "name"; textBox1.Width = 250; textBox2.ID = "credit_hours"; textBox2.Width = 25; textBox3.ID = "dept"; textBox3.Width = 30; textBox4.ID = "class"; textBox4.Width = 25; LinkButton add = new LinkButton(); add.ID = "add"; add.Text = "Add course"; add.CommandName = "add"; add.Click += new EventHandler(add_Click); e.Row.Cells[1].Controls.Add(textBox1); e.Row.Cells[2].Controls.Add(textBox2); e.Row.Cells[3].Controls.Add(textBox3); e.Row.Cells[4].Controls.Add(textBox4); e.Row.Cells[5].Controls.Add(add); } public void add_Click(object sender, EventArgs e) { Response.Write("you Clicked Add Course!"); if (textBox1.Text != null && textBox2.Text != null && textBox3.Text != null && textBox4.Text != null) { listValues.Add("name", textBox1.Text); listValues.Add("credit_hours", textBox2.Text); listValues.Add("dept", textBox4.Text); //For Visual listValues.Add("class", textBox3.Text); } LinqDataSource1.Insert(listValues); Response.Redirect("~/admin/courses.aspx"); } } <%@ Page Language="C#" MasterPageFile="~/admin.master" AutoEventWireup="true" CodeFile="courses.aspx.cs" Inherits="admin_courses" Title="OSU Aisched | Admin - Courses" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <asp:Content ID="Content1" ContentPlaceHolderID="admin_nav_links" Runat="Server"> <ul id="main"> <li><a href="overview.aspx">Overview</a></li> <li><a href="users.aspx">Users</a></li> <li class="current_page_item"><a href="courses.aspx">Courses</a></li> <li><a href="programs.aspx">Programs</a></li> <li><a href="sections.aspx">Sections</a></li> <li><a href="import.aspx">Import</a></li> <li><a href="logs.aspx">Logs</a></li> </ul> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <form id="Form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DataClassesDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="courses"> </asp:LinqDataSource> <h1><a>Courses</a></h1> <asp:UpdateProgress ID="UpdateProgress1" runat="server"> </asp:UpdateProgress> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="course_id" DataSourceID="LinqDataSource1" BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None" BorderWidth="1px" CellPadding="3" CellSpacing="2" AllowSorting="True" ShowFooter="True" OnRowDataBound="GridView1_RowDataBound" > <RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" /> <Columns> <asp:BoundField DataField="course_id" HeaderText="ID" ReadOnly="True" SortExpression="course_id" /> <asp:BoundField DataField="name" HeaderText="Name" SortExpression="name" /> <asp:BoundField DataField="credit_hours" HeaderText="CR" SortExpression="credit_hours" /> <asp:BoundField DataField="dept" HeaderText="Dept" SortExpression="dept" /> <asp:BoundField DataField="class" HeaderText="#" SortExpression="class" /> <asp:CommandField DeleteImageUrl="~/media/delete.png" ShowDeleteButton="True" ShowEditButton="True" ShowInsertButton="True"/> </Columns> <FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" /> <PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" /> <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="White" /> <HeaderStyle BackColor="#A55129" Font-Bold="True" ForeColor="White" /> </asp:GridView> <br /> <asp:HyperLink ID="HyperLink1" runat="server" Target="~/admin/addCourse.aspx" Enabled="true"NavigateUrl="~/admin/addCourse.aspx" Text="Add New course"></asp:HyperLink> <br /> </form> </asp:Content>

    Read the article

  • List getting cleared every button click inside Update Panel?

    - by sah302
    No this isn't a copy of this question: http://stackoverflow.com/questions/654423/button-in-update-panel-is-doing-a-full-postback I've got a drop down inside an update panel, and I am trying to get it to allow the person using the page to add users to a list that is bound to a gridview. The list is a global variable, and on page_load I set that to the gridview's datasource and databind it. However, anytime I click the 'add a user' button, or the button to remove the user from the list. It appears like it is doing a full post back even though all these elements are inside the update Panel. Code Behind: Public accomplishmentTypeDao As New AccomplishmentTypeDao() Public accomplishmentDao As New AccomplishmentDao() Public userDao As New UserDao() Public facultyDictionary As New Dictionary(Of Guid, String) Public facultyList As New List(Of User) Public associatedFaculty As New List(Of User) Public facultyId As New Guid Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Page.Title = "Add a New Faculty Accomplishment" ddlAccomplishmentType.DataSource = accomplishmentTypeDao.getEntireTable() ddlAccomplishmentType.DataTextField = "Name" ddlAccomplishmentType.DataValueField = "Id" ddlAccomplishmentType.DataBind() facultyList = userDao.getListOfUsersByUserGroupName("Faculty") For Each faculty As User In facultyList facultyDictionary.Add(faculty.Id, faculty.LastName & ", " & faculty.FirstName) Next If Not Page.IsPostBack Then ddlFacultyList.DataSource = facultyDictionary ddlFacultyList.DataTextField = "Value" ddlFacultyList.DataValueField = "Key" ddlFacultyList.DataBind() End If gvAssociatedUsers.DataSource = associatedFaculty gvAssociatedUsers.DataBind() End Sub Protected Sub deleteUser(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.CommandEventArgs) facultyId = New Guid(e.CommandArgument.ToString()) associatedFaculty.Remove(associatedFaculty.Find(Function(user) user.Id = facultyId)) gvAssociatedUsers.DataBind() upAssociatedFaculty.Update() End Sub Protected Sub btnAddUser_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddUser.Click facultyId = New Guid(ddlFacultyList.SelectedValue) associatedFaculty.Add(facultyList.Find(Function(user) user.Id = facultyId)) gvAssociatedUsers.DataBind() upAssociatedFaculty.Update() End Sub Markup: <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="upAssociatedFaculty" runat="server" UpdateMode="Conditional"> <ContentTemplate> <p><b>Created By:</b> <asp:Label ID="lblCreatedBy" runat="server"></asp:Label></p> <p><b>Accomplishment Type: </b><asp:DropDownList ID="ddlAccomplishmentType" runat="server"></asp:DropDownList></p> <p><b>Accomplishment Applies To: </b><asp:DropDownList ID="ddlFacultyList" runat="server"></asp:DropDownList> &nbsp;<asp:Button ID="btnAddUser" runat="server" Text="Add Faculty" /></p> <p> <asp:GridView ID="gvAssociatedUsers" runat="server" AutoGenerateColumns="false" GridLines="None" ShowHeader="false"> <Columns> <asp:BoundField DataField="Id" HeaderText="Id" Visible="False" /> <asp:TemplateField ShowHeader="False"> <ItemTemplate> <span style="margin-left: 15px;"> <p><%#Eval("LastName")%>, <%#Eval("FirstName")%> <asp:Button ID="btnUnassignUser" runat="server" CausesValidation="false" CommandArgument='<%# Eval("Id") %>' CommandName="Delete" OnCommand="deleteUser" Text='Remove' /></p> </span> </ItemTemplate> </asp:TemplateField> </Columns> <EmptyDataTemplate> <em>There are currently no faculty associated with this accomplishment.</em> </EmptyDataTemplate> </asp:GridView> </p> </ContentTemplate> </asp:UpdatePanel> Now I thought the point of an update panel was to be able to update things inside of it without doing a full post_back and reloading the page. So if that's the case, why is it calling page_load everytime I click the buttons? I ran this code and debug and I see that even before any of the code associated with button press fires, page_load runs again. I tried putting the gvAssociatedUser.Datasource = associatedFaculty and the line below inside the Page.IsPostBack check, that prevented the page from working. I tried every combination of settings of the update panel for ChildrenAsTriggers and UpdateMode, and none of them worked. I know this is something simple, but all the combinations I've tried won't get it to work. How can I make this thing work? Edited: It wasn't causing a full postback so I was wrong as to the cause. I thought the page was doing a full post back thus resetting my associatedFaculty list global variable, but it isn't doing a full postback. The issue I am having is everytime I click btnAddUser it will add one element to the associatedFaculty list and thus bound to gvAssociatedusers. This works the first time, but the second time I click it, it overwrites the first element. So it appears like my associatedFaculty list is getting reset each time I click the button?

    Read the article

  • Update panel and usercontrols

    - by Charlie Brown
    I have two web user controls nested inside of an update panel. The events inside the user controls do not appear to trigger the panel. For testing, I have set the method the fires to sleep for 3 seconds, and added an update progress panel to the page. The update progress panel never comes up and the page reflashes as usual. The user controls work correctly and do what they need to do, but I would like to make them ajaxy and pretty. Is there a special method for adding usercontrols to an update so the postback works correctly? <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdateProgress ID="UpdateProgress1" runat="server" DisplayAfter="100"> <ProgressTemplate> UPDATING...</ProgressTemplate> </asp:UpdateProgress> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div id="order"> <keg:BeerList runat="server" ID="uxBeerList" /> <kegcart:ShoppingCart runat="server" ID="uxCustomerCart" /> <br class="clearfloat" /> </div> </ContentTemplate> </asp:UpdatePanel> Protected Sub uxBeerList_AddItem(ByVal item As KegData.IOrderableItem) Handles uxBeerList.AddItem uxCustomerCart.AddItemToOrder(item) System.Threading.Thread.Sleep(5000) End Sub

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >