Search Results

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

Page 2/69 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Ajax Control Toolkit May 2012 Release

    - by Stephen.Walther
    I’m happy to announce the May 2012 release of the Ajax Control Toolkit. This newest release of the Ajax Control Toolkit includes a new file upload control which displays file upload progress. We’ve also added several significant enhancements to the existing HtmlEditorExtender control such as support for uploading images and Source View. You can download and start using the newest version of the Ajax Control Toolkit by entering the following command in the Library Package Manager console in Visual Studio: Install-Package AjaxControlToolkit Alternatively, you can download the latest version of the Ajax Control Toolkit from CodePlex: http://AjaxControlToolkit.CodePlex.com The New Ajax File Upload Control The most requested new feature for the Ajax Control Toolkit (according to the CodePlex Issue Tracker) has been support for file upload with progress. We worked hard over the last few months to create an entirely new file upload control which displays upload progress. Here is a sample which illustrates how you can use the new AjaxFileUpload control: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="01_FileUpload.aspx.cs" Inherits="WebApplication1._01_FileUpload" %> <html> <head runat="server"> <title>Simple File Upload</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager runat="server" /> <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" runat="server" /> </div> </form> </body> </html> The page above includes a ToolkitScriptManager control. This control is required to use any of the controls in the Ajax Control Toolkit because this control is responsible for loading all of the scripts required by a control. The page also contains an AjaxFileUpload control. The UploadComplete event is handled in the code-behind for the page: namespace WebApplication1 { public partial class _01_FileUpload : System.Web.UI.Page { protected void ajaxUpload1_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { // Generate file path string filePath = "~/Images/" + e.FileName; // Save upload file to the file system ajaxUpload1.SaveAs(MapPath(filePath)); } } } The UploadComplete handler saves each uploaded file by calling the AjaxFileUpload control’s SaveAs() method with a full file path. Here’s a video which illustrates the process of uploading a file: Warning: in order to write to the Images folder on a production IIS server, you need Write permissions on the Images folder. You need to provide permissions for the IIS Application Pool account to write to the Images folder. To learn more, see: http://learn.iis.net/page.aspx/624/application-pool-identities/ Showing File Upload Progress The new AjaxFileUpload control takes advantage of HTML5 upload progress events (described in the XMLHttpRequest Level 2 standard). This standard is supported by Firefox 8+, Chrome 16+, Safari 5+, and Internet Explorer 10+. In other words, the standard is supported by the most recent versions of all browsers except for Internet Explorer which will support the standard with the release of Internet Explorer 10. The AjaxFileUpload control works with all browsers, even browsers which do not support the new XMLHttpRequest Level 2 standard. If you use the AjaxFileUpload control with a downlevel browser – such as Internet Explorer 9 — then you get a simple throbber image during a file upload instead of a progress indicator. Here’s how you specify a throbber image when declaring the AjaxFileUpload control: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="02_FileUpload.aspx.cs" Inherits="WebApplication1._02_FileUpload" %> <html> <head id="Head1" runat="server"> <title>File Upload with Throbber</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="MyThrobber" runat="server" /> <asp:Image id="MyThrobber" ImageUrl="ajax-loader.gif" Style="display:None" runat="server" /> </div> </form> </body> </html> Notice that the page above includes an image with the Id MyThrobber. This image is displayed while files are being uploaded. I use the website http://AjaxLoad.info to generate animated busy wait images. Drag-And-Drop File Upload If you are using an uplevel browser then you can drag-and-drop the files which you want to upload onto the AjaxFileUpload control. The following video illustrates how drag-and-drop works: Remember that drag-and-drop will not work on Internet Explorer 9 or older. Accepting Multiple Files By default, the AjaxFileUpload control enables you to upload multiple files at a time. When you open the file dialog, use the CTRL or SHIFT key to select multiple files. If you want to restrict the number of files that can be uploaded then use the MaximumNumberOfFiles property like this: <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="throbber" MaximumNumberOfFiles="1" runat="server" /> In the code above, the maximum number of files which can be uploaded is restricted to a single file. Restricting Uploaded File Types You might want to allow only certain types of files to be uploaded. For example, you might want to accept only image uploads. In that case, you can use the AllowedFileTypes property to provide a list of allowed file types like this: <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="throbber" AllowedFileTypes="jpg,jpeg,gif,png" runat="server" /> The code above prevents any files except jpeg, gif, and png files from being uploaded. Enhancements to the HTMLEditorExtender Over the past months, we spent a considerable amount of time making bug fixes and feature enhancements to the existing HtmlEditorExtender control. I want to focus on two of the most significant enhancements that we made to the control: support for Source View and support for uploading images. Adding Source View Support to the HtmlEditorExtender When you click the Source View tag, the HtmlEditorExtender changes modes and displays the HTML source of the contents contained in the TextBox being extended. You can use Source View to make fine-grain changes to HTML before submitting the HTML to the server. For reasons of backwards compatibility, the Source View tab is disabled by default. To enable Source View, you need to declare your HtmlEditorExtender with the DisplaySourceTab property like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="05_SourceView.aspx.cs" Inherits="WebApplication1._05_SourceView" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head id="Head1" runat="server"> <title>HtmlEditorExtender with Source View</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <asp:TextBox id="txtComments" TextMode="MultiLine" Columns="60" Rows="10" Runat="server" /> <ajaxToolkit:HtmlEditorExtender id="HEE1" TargetControlID="txtComments" DisplaySourceTab="true" runat="server" /> </div> </form> </body> </html> The page above includes a ToolkitScriptManager, TextBox, and HtmlEditorExtender control. The HtmlEditorExtender extends the TextBox so that it supports rich text editing. Notice that the HtmlEditorExtender includes a DisplaySourceTab property. This property causes a button to appear at the bottom of the HtmlEditorExtender which enables you to switch to Source View: Note: when using the HtmlEditorExtender, we recommend that you set the DOCTYPE for the document. Otherwise, you can encounter weird formatting issues. Accepting Image Uploads We also enhanced the HtmlEditorExtender to support image uploads (another very highly requested feature at CodePlex). The following video illustrates the experience of adding an image to the editor: Once again, for backwards compatibility reasons, support for image uploads is disabled by default. Here’s how you can declare the HtmlEditorExtender so that it supports image uploads: <ajaxToolkit:HtmlEditorExtender id="MyHtmlEditorExtender" TargetControlID="txtComments" OnImageUploadComplete="MyHtmlEditorExtender_ImageUploadComplete" DisplaySourceTab="true" runat="server" > <Toolbar> <ajaxToolkit:Bold /> <ajaxToolkit:Italic /> <ajaxToolkit:Underline /> <ajaxToolkit:InsertImage /> </Toolbar> </ajaxToolkit:HtmlEditorExtender> There are two things that you should notice about the code above. First, notice that an InsertImage toolbar button is added to the HtmlEditorExtender toolbar. This HtmlEditorExtender will render toolbar buttons for bold, italic, underline, and insert image. Second, notice that the HtmlEditorExtender includes an event handler for the ImageUploadComplete event. The code for this event handler is below: using System.Web.UI; using AjaxControlToolkit; namespace WebApplication1 { public partial class _06_ImageUpload : System.Web.UI.Page { protected void MyHtmlEditorExtender_ImageUploadComplete(object sender, AjaxFileUploadEventArgs e) { // Generate file path string filePath = "~/Images/" + e.FileName; // Save uploaded file to the file system var ajaxFileUpload = (AjaxFileUpload)sender; ajaxFileUpload.SaveAs(MapPath(filePath)); // Update client with saved image path e.PostedUrl = Page.ResolveUrl(filePath); } } } Within the ImageUploadComplete event handler, you need to do two things: 1) Save the uploaded image (for example, to the file system, a database, or Azure storage) 2) Provide the URL to the saved image so the image can be displayed within the HtmlEditorExtender In the code above, the uploaded image is saved to the ~/Images folder. The path of the saved image is returned to the client by setting the AjaxFileUploadEventArgs PostedUrl property. Not surprisingly, under the covers, the HtmlEditorExtender uses the AjaxFileUpload. You can get a direct reference to the AjaxFileUpload control used by an HtmlEditorExtender by using the following code: void Page_Load() { var ajaxFileUpload = MyHtmlEditorExtender.AjaxFileUpload; ajaxFileUpload.AllowedFileTypes = "jpg,jpeg"; } The code above illustrates how you can restrict the types of images that can be uploaded to the HtmlEditorExtender. This code prevents anything but jpeg images from being uploaded. Summary This was the most difficult release of the Ajax Control Toolkit to date. We iterated through several designs for the AjaxFileUpload control – with each iteration, the goal was to make the AjaxFileUpload control easier for developers to use. My hope is that we were able to create a control which Web Forms developers will find very intuitive. I want to thank the developers on the Superexpert.com team for their hard work on this release.

    Read the article

  • Ajax Control Toolkit May 2012 Release

    - by Stephen.Walther
    I’m happy to announce the May 2012 release of the Ajax Control Toolkit. This newest release of the Ajax Control Toolkit includes a new file upload control which displays file upload progress. We’ve also added several significant enhancements to the existing HtmlEditorExtender control such as support for uploading images and Source View. You can download and start using the newest version of the Ajax Control Toolkit by entering the following command in the Library Package Manager console in Visual Studio: Install-Package AjaxControlToolkit Alternatively, you can download the latest version of the Ajax Control Toolkit from CodePlex: http://AjaxControlToolkit.CodePlex.com The New Ajax File Upload Control The most requested new feature for the Ajax Control Toolkit (according to the CodePlex Issue Tracker) has been support for file upload with progress. We worked hard over the last few months to create an entirely new file upload control which displays upload progress. Here is a sample which illustrates how you can use the new AjaxFileUpload control: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="01_FileUpload.aspx.cs" Inherits="WebApplication1._01_FileUpload" %> <html> <head runat="server"> <title>Simple File Upload</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager runat="server" /> <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" runat="server" /> </div> </form> </body> </html> The page above includes a ToolkitScriptManager control. This control is required to use any of the controls in the Ajax Control Toolkit because this control is responsible for loading all of the scripts required by a control. The page also contains an AjaxFileUpload control. The UploadComplete event is handled in the code-behind for the page: namespace WebApplication1 { public partial class _01_FileUpload : System.Web.UI.Page { protected void ajaxUpload1_OnUploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e) { // Generate file path string filePath = "~/Images/" + e.FileName; // Save upload file to the file system ajaxUpload1.SaveAs(MapPath(filePath)); } } } The UploadComplete handler saves each uploaded file by calling the AjaxFileUpload control’s SaveAs() method with a full file path. Here’s a video which illustrates the process of uploading a file: Warning: in order to write to the Images folder on a production IIS server, you need Write permissions on the Images folder. You need to provide permissions for the IIS Application Pool account to write to the Images folder. To learn more, see: http://learn.iis.net/page.aspx/624/application-pool-identities/ Showing File Upload Progress The new AjaxFileUpload control takes advantage of HTML5 upload progress events (described in the XMLHttpRequest Level 2 standard). This standard is supported by Firefox 8+, Chrome 16+, Safari 5+, and Internet Explorer 10+. In other words, the standard is supported by the most recent versions of all browsers except for Internet Explorer which will support the standard with the release of Internet Explorer 10. The AjaxFileUpload control works with all browsers, even browsers which do not support the new XMLHttpRequest Level 2 standard. If you use the AjaxFileUpload control with a downlevel browser – such as Internet Explorer 9 — then you get a simple throbber image during a file upload instead of a progress indicator. Here’s how you specify a throbber image when declaring the AjaxFileUpload control: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="02_FileUpload.aspx.cs" Inherits="WebApplication1._02_FileUpload" %> <html> <head id="Head1" runat="server"> <title>File Upload with Throbber</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="MyThrobber" runat="server" /> <asp:Image id="MyThrobber" ImageUrl="ajax-loader.gif" Style="display:None" runat="server" /> </div> </form> </body> </html> Notice that the page above includes an image with the Id MyThrobber. This image is displayed while files are being uploaded. I use the website http://AjaxLoad.info to generate animated busy wait images. Drag-And-Drop File Upload If you are using an uplevel browser then you can drag-and-drop the files which you want to upload onto the AjaxFileUpload control. The following video illustrates how drag-and-drop works: Remember that drag-and-drop will not work on Internet Explorer 9 or older. Accepting Multiple Files By default, the AjaxFileUpload control enables you to upload multiple files at a time. When you open the file dialog, use the CTRL or SHIFT key to select multiple files. If you want to restrict the number of files that can be uploaded then use the MaximumNumberOfFiles property like this: <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="throbber" MaximumNumberOfFiles="1" runat="server" /> In the code above, the maximum number of files which can be uploaded is restricted to a single file. Restricting Uploaded File Types You might want to allow only certain types of files to be uploaded. For example, you might want to accept only image uploads. In that case, you can use the AllowedFileTypes property to provide a list of allowed file types like this: <ajaxToolkit:AjaxFileUpload id="ajaxUpload1" OnUploadComplete="ajaxUpload1_OnUploadComplete" ThrobberID="throbber" AllowedFileTypes="jpg,jpeg,gif,png" runat="server" /> The code above prevents any files except jpeg, gif, and png files from being uploaded. Enhancements to the HTMLEditorExtender Over the past months, we spent a considerable amount of time making bug fixes and feature enhancements to the existing HtmlEditorExtender control. I want to focus on two of the most significant enhancements that we made to the control: support for Source View and support for uploading images. Adding Source View Support to the HtmlEditorExtender When you click the Source View tag, the HtmlEditorExtender changes modes and displays the HTML source of the contents contained in the TextBox being extended. You can use Source View to make fine-grain changes to HTML before submitting the HTML to the server. For reasons of backwards compatibility, the Source View tab is disabled by default. To enable Source View, you need to declare your HtmlEditorExtender with the DisplaySourceTab property like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="05_SourceView.aspx.cs" Inherits="WebApplication1._05_SourceView" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head id="Head1" runat="server"> <title>HtmlEditorExtender with Source View</title> </head> <body> <form id="form1" runat="server"> <div> <ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" /> <asp:TextBox id="txtComments" TextMode="MultiLine" Columns="60" Rows="10" Runat="server" /> <ajaxToolkit:HtmlEditorExtender id="HEE1" TargetControlID="txtComments" DisplaySourceTab="true" runat="server" /> </div> </form> </body> </html> The page above includes a ToolkitScriptManager, TextBox, and HtmlEditorExtender control. The HtmlEditorExtender extends the TextBox so that it supports rich text editing. Notice that the HtmlEditorExtender includes a DisplaySourceTab property. This property causes a button to appear at the bottom of the HtmlEditorExtender which enables you to switch to Source View: Note: when using the HtmlEditorExtender, we recommend that you set the DOCTYPE for the document. Otherwise, you can encounter weird formatting issues. Accepting Image Uploads We also enhanced the HtmlEditorExtender to support image uploads (another very highly requested feature at CodePlex). The following video illustrates the experience of adding an image to the editor: Once again, for backwards compatibility reasons, support for image uploads is disabled by default. Here’s how you can declare the HtmlEditorExtender so that it supports image uploads: <ajaxToolkit:HtmlEditorExtender id="MyHtmlEditorExtender" TargetControlID="txtComments" OnImageUploadComplete="MyHtmlEditorExtender_ImageUploadComplete" DisplaySourceTab="true" runat="server" > <Toolbar> <ajaxToolkit:Bold /> <ajaxToolkit:Italic /> <ajaxToolkit:Underline /> <ajaxToolkit:InsertImage /> </Toolbar> </ajaxToolkit:HtmlEditorExtender> There are two things that you should notice about the code above. First, notice that an InsertImage toolbar button is added to the HtmlEditorExtender toolbar. This HtmlEditorExtender will render toolbar buttons for bold, italic, underline, and insert image. Second, notice that the HtmlEditorExtender includes an event handler for the ImageUploadComplete event. The code for this event handler is below: using System.Web.UI; using AjaxControlToolkit; namespace WebApplication1 { public partial class _06_ImageUpload : System.Web.UI.Page { protected void MyHtmlEditorExtender_ImageUploadComplete(object sender, AjaxFileUploadEventArgs e) { // Generate file path string filePath = "~/Images/" + e.FileName; // Save uploaded file to the file system var ajaxFileUpload = (AjaxFileUpload)sender; ajaxFileUpload.SaveAs(MapPath(filePath)); // Update client with saved image path e.PostedUrl = Page.ResolveUrl(filePath); } } } Within the ImageUploadComplete event handler, you need to do two things: 1) Save the uploaded image (for example, to the file system, a database, or Azure storage) 2) Provide the URL to the saved image so the image can be displayed within the HtmlEditorExtender In the code above, the uploaded image is saved to the ~/Images folder. The path of the saved image is returned to the client by setting the AjaxFileUploadEventArgs PostedUrl property. Not surprisingly, under the covers, the HtmlEditorExtender uses the AjaxFileUpload. You can get a direct reference to the AjaxFileUpload control used by an HtmlEditorExtender by using the following code: void Page_Load() { var ajaxFileUpload = MyHtmlEditorExtender.AjaxFileUpload; ajaxFileUpload.AllowedFileTypes = "jpg,jpeg"; } The code above illustrates how you can restrict the types of images that can be uploaded to the HtmlEditorExtender. This code prevents anything but jpeg images from being uploaded. Summary This was the most difficult release of the Ajax Control Toolkit to date. We iterated through several designs for the AjaxFileUpload control – with each iteration, the goal was to make the AjaxFileUpload control easier for developers to use. My hope is that we were able to create a control which Web Forms developers will find very intuitive. I want to thank the developers on the Superexpert.com team for their hard work on this release.

    Read the article

  • adding controls dynamically to panel in a UpdatePanel asp.net 4.0

    - by softwaremonster
    Hi, I have a UpdatePanel includes some panels. I want to add to these panel some controls according to the operations. After i click any button twice or after first page load the page gives error. Either I have to use each panel without any post back [no page refresh] how can i solve this? the html code is below. wordOrgButton enables word panel and after any operation fills that word panel. same for userOrgButton <asp:UpdatePanel ID="mainPanel" runat="server" Height="220px"> <ContentTemplate> <fieldset> <asp:Panel ID="buttonsPanel" runat="server"> <asp:Button ID="wordOrgButton" runat="server" Text="Words" onclick="wordOrgButton_Click" /> <asp:Button ID="userOrgButton" runat="server" Text="User" onclick="userOrgButton_Click" /> <asp:Button ID="exitButton" runat="server" Text="Exit" onclick="exitButton_Click" /> </asp:Panel> <asp:Panel ID="usersPanel" runat="server"> <asp:TextBox ID="whoisUserTextBox" runat="server"></asp:TextBox> <asp:Button ID="catchUserButton" runat="server" Text="Bring" onclick="catchUserButton_Click" /> <asp:Panel ID="userOrgPanel" runat="server" ></asp:Panel> </asp:Panel> <asp:Panel ID="wordsPanel" runat="server"></asp:Panel> <asp:Panel ID="informationPanel" runat="server"> <asp:Label ID="operationinfoLabel" runat="server"></asp:Label> </asp:Panel> </fieldset> </ContentTemplate> </asp:UpdatePanel>

    Read the article

  • How to refresh DataGrid and DropDown on main page after hiding modal popup

    - by James
    Hi, I am adding records to a database from a modal popup. After hiding the modal popup, the page has not been refreshed even though I have Rebound the controls. I have reviewed a few postings on the web about this but the solution still evades me. I have attached my code after removing some of the extra detail... It seems I need to cause a postback but I don't know what needs to be changed. Some posts have talked about the extender being misplaced. Anyway, thank you James <asp:Content ID="Content1" ContentPlaceHolderID="Head" Runat="Server"> <div class="divBorder"> <asp:DataGrid id="dgrSessionFolders" runat="server" BorderWidth="2px" BorderStyle="Solid" BorderColor="#C0C0FF" Font-Names="Arial" Font-Bold="True" Font-Size="8pt" GridLines="Horizontal" AutoGenerateColumns="False" PageSize="9999" AllowPaging="False" OnItemCommand="dgrSessionFolders_Command" OnItemDataBound="CheckSessionFolderStatus" HorizontalAlign="Left" ForeColor="Blue" ShowFooter="True" CellPadding="2" OnSortCommand="dgrSessionFolders_Sort" AllowSorting="True"> </asp:DataGrid> </div> &nbsp;&nbsp;&nbsp; <asp:Label ID="Errormsg" runat="server" ForeColor="#CC0000"></asp:Label> <asp:UpdatePanel ID="UpdatePanel1" runat="server" RenderMode="Inline" ChildrenAsTriggers="false" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnEditTopic" /> <asp:AsyncPostBackTrigger ControlID="btnAdd" /> <asp:AsyncPostBackTrigger ControlID="btnUpdate" /> <asp:AsyncPostBackTrigger ControlID="btnDelete" /> <asp:AsyncPostBackTrigger ControlID="btnClear" /> <asp:AsyncPostBackTrigger ControlID="btnAddTopic" /> <asp:AsyncPostBackTrigger ControlID="btnUpdateTopic" /> <asp:AsyncPostBackTrigger ControlID="btnDeleteTopic" /> </Triggers> <ContentTemplate> <asp:panel id="pnl" runat="server" HorizontalAlign="Center" Height="48px" Width="100%" > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <asp:ImageButton ID="btnEditTopic" runat="server" AlternateText="Edit Topic" ImageUrl="~/App_Themes/Common/images/BtnEditTopic.jpg" Height="28px"> </asp:ImageButton> <cc1:ModalPopupExtender ID="btnEditTopic_ModalPopupExtender" runat="server" BackgroundCssClass="modalBackground" DropShadow="true" Enabled="true" PopupControlID="pnlEditTopic" TargetControlID="btnEditTopicHidden" CancelControlID="btnEditTopicClose"> </cc1:ModalPopupExtender> <asp:ImageButton ID="btnAdd" runat="server" AlternateText="Add Folder" ImageUrl="~/App_Themes/Common/images/BtnAddFolder.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnUpdate" runat="server" AlternateText="Update Folder" ImageUrl="~/App_Themes/Common/images/BtnUpdateFolder.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnDelete" runat="server" AlternateText="Delete Folder" ImageUrl="~/App_Themes/Common/images/BtnDeleteFolder.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="BtnClear" runat="server" AlternateText="Clear Screen Input Fields" ImageUrl="~/App_Themes/Common/images/BtnAddMode.jpg" Height="28px"> </asp:ImageButton> <asp:Button ID="btnEditTopicHidden" runat="server" Enabled="false" Text="" Style="visibility: hidden" /> </asp:panel> <asp:Panel ID="pnlEditTopic" runat="server" CssClass="modalPopupEditTopic" Style="display: none;" > <table cellspacing="0" class="borderTable0" width="100%" style=""> <tr> <td colspan="10" class="Subhdr" align="center" style="width:100%"> <asp:label id="lblTopicScreenHdr" Cssclass="ScreenHdr" runat="server">Topic Maintenance</asp:label> </td> </tr> <tr> <td colspan="6"> <asp:Label ID="TopicPopErrorMsg" runat="server" ForeColor="#CC0000">&nbsp;</asp:Label> </td> </tr> <tr style="height:4px"> <td colspan="6" align="center"> <asp:ImageButton ID="btnAddTopic" runat="server" AlternateText="Add Topic" ImageUrl="~/App_Themes/Common/images/BtnApply.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnUpdateTopic" runat="server" AlternateText="Update Topic" ImageUrl="~/App_Themes/Common/images/BtnApply.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnDeleteTopic" runat="server" AlternateText="Delete Topic" ImageUrl="~/App_Themes/Common/images/BtnDelete.jpg" Height="28px"> </asp:ImageButton> <asp:ImageButton ID="btnEditTopicClose" runat="server" AlternateText="Close Edit Topic Popup" ImageUrl="~/App_Themes/Common/images/BtnCancel.jpg" Height="28px"> </asp:ImageButton> </td> </tr> </table> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> Private Sub btnAddTopic_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddTopic.Click 'Add the Topic table entry AddTopic() 'Display an informational message Errormsg.Text = "The Topic has been successfully added, thank you! " Errormsg.ForeColor = Drawing.Color.Blue 'Rebind the Topic Drop Down and set to added Topic ddlSessionTopic.DataBind() ddlSessionTopic.SelectedValue = drTopic("TOPC_ID") 'Rebind the Session Folders grid RebindGrid() 'Hide the Topic Popup btnEditTopic_ModalPopupExtender.Hide() End Sub Private Sub RebindGrid() cnnSQL = New SqlConnection(strConnection) cmdSQL = New SqlCommand("GetSessionFoldersForGrid", cnnSQL) cmdSQL.CommandType = CommandType.StoredProcedure cmdSQL.Parameters.Clear() cnnSQL.Open() dadSQL = New SqlDataAdapter(cmdSQL) dadSQL.SelectCommand = cmdSQL dadSQL.Fill(dtSessionFolderGrid) cnnSQL.Close() dvSessionFolderGrid = dtSessionFolderGrid.DefaultView dvSessionFolderGrid.Sort = String.Format("{0} {1}{2}", so.Sortfield, so.SortDirection, so.SortSuffix) dgrSessionFolders.DataSource = dvSessionFolderGrid dgrSessionFolders.DataBind() End Sub

    Read the article

  • Issue with Multiple ModalPopups, ValidationSummary and UpdatePanels

    - by Aaron Hoffman
    I am having an issue when a page contains multiple ModalPopups each containing a ValidationSummary Control. Here is the functionality I need: A user clicks a button and a Modal Popup appears with dynamic content based on the button that was clicked. (This functionality is working. Buttons are wrapped in UpdatePanels and the partial page postback calls .Show() on the ModalPopup) "Save" button in ModalPopup causes client side validation, then causes a full page postback so the entire ModalPopup disappears. (ModalPopup could disappear another way - the ModalPopup just needs to disappear after a successful save operation) If errors occur in the codebehind during Save operation, messages are added to the ValidationSummary (contained within the ModalPopup) and the ModalPopup is displayed again. When the ValidationSummary's are added to the PopupPanel's, the ModalPopups no longer display correctly after a full page postback caused by the "Save" button within the second PopupPanel. (the first panel continues to function correctly) Both PopupPanels are displayed, and neither is "Popped-Up", they are displayed in-line. Any ideas on how to solve this? Image of Error State (after "PostBack Popup2" button has been clicked) ASPX markup <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <%--********************************************************************* Popup1 *********************************************************************--%> <asp:UpdatePanel ID="Popup1ShowButtonUpdatePanel" runat="server"> <ContentTemplate> <%--This button will cause a partial page postback and pass a parameter to the Popup1ModalPopup in code behind and call its .Show() method to make it visible--%> <asp:Button ID="Popup1ShowButton" runat="server" Text="Show Popup1" OnClick="Popup1ShowButton_Click" CommandArgument="1" /> </ContentTemplate> </asp:UpdatePanel> <%--Hidden Control is used as ModalPopup's TargetControlID .Usually this is the ID of control that causes the Popup, but we want to control the modal popup from code behind --%> <asp:HiddenField ID="Popup1ModalPopupTargetControl" runat="server" /> <ajax:ModalPopupExtender ID="Popup1ModalPopup" runat="server" TargetControlID="Popup1ModalPopupTargetControl" PopupControlID="Popup1PopupControl" CancelControlID="Popup1CancelButton"> </ajax:ModalPopupExtender> <asp:Panel ID="Popup1PopupControl" runat="server" CssClass="ModalPopup" Style="width: 600px; background-color: #FFFFFF; border: solid 1px #000000;"> <%--This button causes validation and a full-page post back. Full page postback will causes the ModalPopup to be Hid. If there are errors in code behind, the code behind will add a message to the ValidationSummary, and make the ModalPopup visible again--%> <asp:Button ID="Popup1PostBackButton" runat="server" Text="PostBack Popup1" OnClick="Popup1PostBackButton_Click" />&nbsp; <asp:Button ID="Popup1CancelButton" runat="server" Text="Cancel Popup1" /> <asp:UpdatePanel ID="Popup1UpdatePanel" runat="server"> <ContentTemplate> <%--*************ISSUE HERE*************** The two ValidationSummary's are causing an issue. When the second ModalPopup's PostBack button is clicked, Both ModalPopup's become visible, but neither are "Popped-Up". If ValidationSummary's are removed, both ModalPopups Function Correctly--%> <asp:ValidationSummary ID="Popup1ValidationSummary" runat="server" /> <%--Will display dynamically passed paramter during partial page post-back--%> Popup1 Parameter:<asp:Literal ID="Popup1Parameter" runat="server"></asp:Literal><br /> </ContentTemplate> </asp:UpdatePanel> &nbsp;<br /> &nbsp;<br /> &nbsp;<br /> </asp:Panel> &nbsp;<br /> &nbsp;<br /> &nbsp;<br /> <%--********************************************************************* Popup2 *********************************************************************--%> <asp:UpdatePanel ID="Popup2ShowButtonUpdatePanel" runat="server"> <ContentTemplate> <%--This button will cause a partial page postback and pass a parameter to the Popup2ModalPopup in code behind and call its .Show() method to make it visible--%> <asp:Button ID="Popup2ShowButton" runat="server" Text="Show Popup2" OnClick="Popup2ShowButton_Click" CommandArgument="2" /> </ContentTemplate> </asp:UpdatePanel> <%--Hidden Control is used as ModalPopup's TargetControlID .Usually this is the ID of control that causes the Popup, but we want to control the modal popup from code behind --%> <asp:HiddenField ID="Popup2ModalPopupTargetControl" runat="server" /> <ajax:ModalPopupExtender ID="Popup2ModalPopup" runat="server" TargetControlID="Popup2ModalPopupTargetControl" PopupControlID="Popup2PopupControl" CancelControlID="Popup2CancelButton"> </ajax:ModalPopupExtender> <asp:Panel ID="Popup2PopupControl" runat="server" CssClass="ModalPopup" Style="width: 600px; background-color: #FFFFFF; border: solid 1px #000000;"> <%--This button causes validation and a full-page post back. Full page postback will causes the ModalPopup to be Hid. If there are errors in code behind, the code behind will add a message to the ValidationSummary, and make the ModalPopup visible again--%> <asp:Button ID="Popup2PostBackButton" runat="server" Text="PostBack Popup2" OnClick="Popup2PostBackButton_Click" />&nbsp; <asp:Button ID="Popup2CancelButton" runat="server" Text="Cancel Popup2" /> <asp:UpdatePanel ID="Popup2UpdatePanel" runat="server"> <ContentTemplate> <%--*************ISSUE HERE*************** The two ValidationSummary's are causing an issue. When the second ModalPopup's PostBack button is clicked, Both ModalPopup's become visible, but neither are "Popped-Up". If ValidationSummary's are removed, both ModalPopups Function Correctly--%> <asp:ValidationSummary ID="Popup2ValidationSummary" runat="server" /> <%--Will display dynamically passed paramter during partial page post-back--%> Popup2 Parameter:<asp:Literal ID="Popup2Parameter" runat="server"></asp:Literal><br /> </ContentTemplate> </asp:UpdatePanel> &nbsp;<br /> &nbsp;<br /> &nbsp;<br /> </asp:Panel> Code Behind protected void Popup1ShowButton_Click(object sender, EventArgs e) { Button btn = sender as Button; //Dynamically pass parameter to ModalPopup during partial page postback Popup1Parameter.Text = btn.CommandArgument; Popup1ModalPopup.Show(); } protected void Popup1PostBackButton_Click(object sender, EventArgs e) { //if there is an error, add a message to the validation summary and //show the ModalPopup again //TODO: add message to validation summary //show ModalPopup after page refresh (request/response) Popup1ModalPopup.Show(); } protected void Popup2ShowButton_Click(object sender, EventArgs e) { Button btn = sender as Button; //Dynamically pass parameter to ModalPopup during partial page postback Popup2Parameter.Text = btn.CommandArgument; Popup2ModalPopup.Show(); } protected void Popup2PostBackButton_Click(object sender, EventArgs e) { //***********After This is when the issue appears********************** //if there is an error, add a message to the validation summary and //show the ModalPopup again //TODO: add message to validation summary //show ModalPopup after page refresh (request/response) Popup2ModalPopup.Show(); }

    Read the article

  • May 2011 Release of the Ajax Control Toolkit

    - by Stephen Walther
    I’m happy to announce that the Superexpert team has published the May 2011 release of the Ajax Control Toolkit at CodePlex. You can download the new release at the following URL: http://ajaxcontroltoolkit.codeplex.com/releases/view/65800 This release focused on improving the ModalPopup and AsyncFileUpload controls. Our team closed a total of 34 bugs related to the ModalPopup and AsyncFileUpload controls. Enhanced ModalPopup Control You can take advantage of the Ajax Control Toolkit ModalPopup control to easily create popup dialogs in your ASP.NET Web Forms applications. When the dialog appears, you cannot interact with any page content which appears behind the modal dialog. For example, the following page contains a standard ASP.NET Button and Panel. When you click the Button, the Panel appears as a popup dialog: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Simple.aspx.vb" Inherits="ACTSamples.Simple" %> <%@ Register TagPrefix="act" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <!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>Simple Modal Popup Sample</title> <style type="text/css"> html { background-color: blue; } #dialog { border: 2px solid black; width: 500px; background-color: White; } #dialogContents { padding: 10px; } .modalBackground { background-color:Gray; filter:alpha(opacity=70); opacity:0.7; } </style> </head> <body> <form id="form1" runat="server"> <div> <act:ToolkitScriptManager ID="tsm" runat="server" /> <asp:Panel ID="dialog" runat="server"> <div id="dialogContents"> Here are the contents of the dialog. <br /> <asp:Button ID="btnOK" Text="OK" runat="server" /> </div> </asp:Panel> <asp:Button ID="btnShow" Text="Open Dialog" runat="server" /> <act:ModalPopupExtender TargetControlID="btnShow" PopupControlID="dialog" OkControlID="btnOK" DropShadow="true" BackgroundCssClass="modalBackground" runat="server" /> </div> </form> </body> </html>     Notice that the page includes two controls from the Ajax Control Toolkit: the ToolkitScriptManager and the ModalPopupExtender control. Any page which uses any of the controls from the Ajax Control Toolkit must include a ToolkitScriptManager. The ModalPopupExtender is used to create the popup. The following properties are set: · TargetControlID – This is the ID of the Button or LinkButton control which causes the modal popup to be displayed. · PopupControlID – This is the ID of the Panel control which contains the content displayed in the modal popup. · OKControlID – This is the ID of a Button or LinkButton which causes the modal popup to close. · DropShadow – Displays a drop shadow behind the modal popup. · BackgroundCSSClass – The name of a Cascading Style Sheet class which is used to gray out the background of the page when the modal popup is displayed. The ModalPopup is completely cross-browser compatible. For example, the following screenshots show the same page displayed in Firefox 4, Internet Explorer 9, and Chrome 11: The ModalPopup control has lots of nice properties. For example, you can make the ModalPopup draggable. You also can programmatically hide and show a modal popup from either server-side or client-side code. To learn more about the properties of the ModalPopup control, see the following website: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/ModalPopup/ModalPopup.aspx Animated ModalPopup Control In the May 2011 release of the Ajax Control Toolkit, we enhanced the Modal Popup control so that it supports animations. We made this modification in response to a feature request posted at CodePlex which got 65 votes (plenty of people wanted this feature): http://ajaxcontroltoolkit.codeplex.com/workitem/6944 I want to thank Dani Kenan for posting a patch to this issue which we used as the basis for adding animation support for the modal popup. Thanks Dani! The enhanced ModalPopup in the May 2011 release of the Ajax Control Toolkit supports the following animations: OnShowing – Called before the modal popup is shown. OnShown – Called after the modal popup is shown. OnHiding – Called before the modal popup is hidden. OnHidden – Called after the modal popup is hidden. You can use these animations, for example, to fade-in a modal popup when it is displayed and fade-out the popup when it is hidden. Here’s the code: <act:ModalPopupExtender ID="ModalPopupExtender1" TargetControlID="btnShow" PopupControlID="dialog" OkControlID="btnOK" DropShadow="true" BackgroundCssClass="modalBackground" runat="server"> <Animations> <OnShown> <Fadein /> </OnShown> <OnHiding> <Fadeout /> </OnHiding> </Animations> </act:ModalPopupExtender>     So that you can experience the full joy of this animated modal popup, I recorded the following video: Of course, you can use any of the animations supported by the Ajax Control Toolkit with the modal popup. The animation reference is located here: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/Walkthrough/AnimationReference.aspx Fixes to the AsyncFileUpload In the May 2011 release, we also focused our energies on performing bug fixes for the AsyncFileUpload control. We fixed several major issues with the AsyncFileUpload including: It did not work in master pages It did not work when ClientIDMode=”Static” It did not work with Firefox 4 It did not work when multiple AsyncFileUploads were included in the same page It generated markup which was not HTML5 compatible The AsyncFileUpload control is a super useful control. It enables you to upload files in a form without performing a postback. Here’s some sample code which demonstrates how you can use the AsyncFileUpload: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Simple.aspx.vb" Inherits="ACTSamples.Simple1" %> <%@ Register TagPrefix="act" Namespace="AjaxControlToolkit" Assembly="AjaxControlToolkit" %> <!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 id="Head1" runat="server"> <title>Simple AsyncFileUpload</title> </head> <body> <form id="form1" runat="server"> <div> <act:ToolkitScriptManager ID="tsm" runat="server" /> User Name: <br /> <asp:TextBox ID="txtUserName" runat="server" /> <asp:RequiredFieldValidator EnableClientScript="false" ErrorMessage="Required" ControlToValidate="txtUserName" runat="server" /> <br /><br /> Avatar: <act:AsyncFileUpload ID="async1" ThrobberID="throbber" UploadingBackColor="yellow" ErrorBackColor="red" CompleteBackColor="green" UploaderStyle="Modern" PersistFile="true" runat="server" /> <asp:Image ID="throbber" ImageUrl="uploading.gif" style="display:none" runat="server" /> <br /><br /> <asp:Button ID="btnSubmit" Text="Submit" runat="server" /> </div> </form> </body> </html> And here’s the code-behind for the page above: Public Class Simple1 Inherits System.Web.UI.Page Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click If Page.IsValid Then ' Get Form Fields Dim userName As String Dim file As Byte() userName = txtUserName.Text If async1.HasFile Then file = async1.FileBytes End If ' Save userName, file to database ' Redirect to success page Response.Redirect("SimpleDone.aspx") End If End Sub End Class   The form above contains an AsyncFileUpload which has values for the following properties: ThrobberID – The ID of an element in the page to display while a file is being uploaded. UploadingBackColor – The color to display in the upload field while a file is being uploaded. ErrorBackColor – The color to display in the upload field when there is an error uploading a file. CompleteBackColor – The color to display in the upload field when the upload is complete. UploaderStyle – The user interface style: Traditional or Modern. PersistFile – When true, the uploaded file is persisted in Session state. The last property PersistFile, causes the uploaded file to be stored in Session state. That way, if completing a form requires multiple postbacks, then the user needs to upload the file only once. For example, if there is a server validation error, then the user is not required to re-upload the file after fixing the validation issue. In the sample code above, this condition is simulated by disabling client-side validation for the RequiredFieldValidator control. The RequiredFieldValidator EnableClientScript property has the value false. The following video demonstrates how the AsyncFileUpload control works: You can learn more about the properties and methods of the AsyncFileUpload control by visiting the following page: http://www.asp.net/ajax/ajaxcontroltoolkit/Samples/AsyncFileUpload/AsyncFileUpload.aspx Conclusion In the May 2011 release of the Ajax Control Toolkit, we addressed over 30 bugs related to the ModalPopup and AsyncFileUpload controls. Furthermore, by building on code submitted by the community, we enhanced the ModalPopup control so that it supports animation (Thanks Dani). In our next sprint for the June release of the Ajax Control Toolkit, we plan to focus on the HTML Editor control. Subscribe to this blog to keep updated.

    Read the article

  • master pages, form pages, form runat=server > all onclick methods on master page?

    - by b0x0rz
    the problem i have is that i have multiple nested master pages: level 1: global (header, footer, login, navigation, etc...) level 2: specific (search pages, account pages, etc...) level 3: the page itself now, since only one form can have runat=server, i put the form at global page (so i can handle things like login, feedback, etc...). now with this solution i'd have to also put the for example level 3 (see above) methods, such as search also on the level 1 master page, but this will lead to this page being heavy (for development) with code from all places, even those that are used on a single page only (change email form for example). is there any way to delegate such methods (for example: ChangeEMail) from level 1 (global masterpage) to level 3 (the single page itself). to be even more clear: i want to NOT have to have the method ChangeEMail on the global master page code behind, but would like to 'MOVE' it somehow to the only page that will actually use it. the reason why it currently has to be on the global master is that global master has form runat=server and there can be only one of those per aspx page. this way it will be easier (more logical) to structure the code. thnx (hope i explained it correctly) have searched but did not find any general info on handling this case, usualy the answer is: have all the methods on the master page, but i don't like it. so ANY way of moving it to the specific page would be awesome. thnx

    Read the article

  • DropDownList Value not changing with UpdatePanel and ModalPopupExtender

    - by Richard
    Greetings, I have an asp.net webpage with an modalpopupextender inside of an updatepanel. When I click Ok on the popup, I can get the textbox values from the popup just fine, but the DropDownLists have the old/default value, not the new value I have selected for them. All the controls on the popup are set to enableviewstate = true, and autopostback = false (I just want to make the trip to the server when I click the ok button, not every time I change the value of the popups). Here is the relevant code. ========================== Client Side <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Panel ID="EditIssuePanel" runat="server" CssClass="modalPopup" Style="display:block;" > <table style="width:500px;"> <tr style="height:50px;"> <td colspan="2" align="center"> <asp:Label ID="lblEditIssueHeader" runat="server" Text="Edit Issue"></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblIssueName" runat="server" Text="Name:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtName" runat="server" Width="250px" MaxLength="50"></asp:TextBox> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtDescription" runat="server" Width="250px" MaxLength="1000"></asp:TextBox> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblType" runat="server" Text="Type:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlType" runat="server"> <asp:ListItem Selected="True" Value="B">Bug</asp:ListItem> <asp:ListItem Value="R">Request</asp:ListItem> <asp:ListItem Value="O">Other</asp:ListItem> </asp:DropDownList> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblStatus" runat="server" Text="Status:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlStatus" runat="server"> <asp:ListItem Selected="True" Value="L">Logged</asp:ListItem> <asp:ListItem Value="I">In Process</asp:ListItem> <asp:ListItem Value="C">Complete</asp:ListItem> </asp:DropDownList> &nbsp; </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblPriority" runat="server" Text="Priority:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlPriority" runat="server" EnableViewState="true" AutoPostBack="false"> <asp:ListItem Selected="True" Value="L">Low</asp:ListItem> <asp:ListItem Value="M">Medium</asp:ListItem> <asp:ListItem Value="H">High</asp:ListItem> </asp:DropDownList> &nbsp;</td> </tr> <tr style="height:30px"> <td class="labelscolumn">Logger</td> <td class="datacolumn"> <asp:Label ID="lblEnteredByClientUserID" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblDateResolutionRequested" runat="server" Text="Requested Complete Date:"></asp:Label> </td> <td class="datacolumn"> <igsch:WebDateChooser ID="wdcRequestCompleteDate" runat="server"> </igsch:WebDateChooser> &nbsp;</td> </tr> <tr style="height:30px"> <td class="labelscolumn">Logged Date</td> <td class="datacolumn"> <asp:Label ID="lblLoggedDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px"> <td class="labelscolumn">In Process Date</td> <td class="datacolumn"> <asp:Label ID="lblInProcessDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px"> <td class="labelscolumn">Resolved Date</td> <td class="datacolumn"> <asp:Label ID="lblResolvedDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn" valign="top"> <asp:Label ID="lblEmailCCList" runat="server" Text="Email CC:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtEmailCCList" runat="server" MaxLength="2000" Rows="0" TextMode="MultiLine" Height="83px" Width="250px"></asp:TextBox> &nbsp;</td> </tr> <tr> <td> <asp:Label ID="lblIssueID" runat="server" Text="" Visible="false"></asp:Label> <asp:Label ID="lblClientID" runat="server" Text="" Visible="false"></asp:Label> </td> <td align="right"> <asp:Button ID="btnEditOk" runat="server" Text="Ok" onclick="btnEditOk_Click"/>&nbsp;&nbsp; <asp:Button ID="btnEditCancel" runat="server" Text="Cancel" onclick="btnEditCancel_Click" />&nbsp;&nbsp;&nbsp;&nbsp; </td> </tr> </table> </asp:Panel> . . . THEN THERE IS A WEBGRID HERE. . . This modal popupextender here got mangled. I cant get stackoverflow to show it right. It shows the properties here though. " BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnEditOk" CancelControlID="btnEditCancel" Animations="" </ContentTemplate> </asp:UpdatePanel> ========================================= Server Side protected void btnEditOk_Click(object sender, EventArgs e) { IssueDAO issueDAO = new IssueDAO(); string client = "Eichleay"; string name = null; string description = null; string type = null; string status = null; DateTime? resolvedDate = null; string enteredByClientUserName = User.Identity.Name.ToString(); DateTime? loggedDate = DateTime.Now; DateTime? inProcessDate = null; DateTime? completeDate = null; DateTime? requestCompleteDate = null; string priority = null; int? prioritySort = null; string emailCCList = null; name = txtName.Text.Substring(txtName.Text.Length > 0 ? 1 : 0, (txtName.Text.Length > 0 ? txtName.Text.Length : 1) - 1); description = txtDescription.Text.Substring(txtDescription.Text.Length > 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1); type = ddlType.SelectedValue; status = ddlStatus.SelectedValue; resolvedDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)); inProcessDate = string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblInProcessDate.Text)); completeDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)); requestCompleteDate = wdcRequestCompleteDate.Value == null ? null : string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())); priority = ddlPriority.SelectedValue; emailCCList = txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length > 0 ? 1 : 0, (txtEmailCCList.Text.Length > 0 ? txtEmailCCList.Text.Length : 1) - 1); if (lblEditIssueHeader.Text.Substring(0, 3) == "New") { issueDAO.InsertIssue(client, name, description, type, status, resolvedDate, enteredByClientUserName, loggedDate, inProcessDate, completeDate, requestCompleteDate, priority, prioritySort, emailCCList); } else { Issue issue = new Issue(Convert.ToInt32(lblIssueID.Text), lblClientID.Text, txtName.Text.Substring(txtName.Text.Length > 0 ? 1 : 0, (txtName.Text.Length > 0 ? txtName.Text.Length : 1) - 1), txtDescription.Text.Substring(txtDescription.Text.Length > 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1), ddlType.SelectedValue, ddlStatus.SelectedValue, string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)), lblEnteredByClientUserID.Text, string.IsNullOrEmpty(lblLoggedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblLoggedDate.Text)), string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblInProcessDate.Text)), string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)), string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())), ddlPriority.SelectedValue, null, txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length > 0 ? 1 : 0, (txtEmailCCList.Text.Length > 0 ? txtEmailCCList.Text.Length : 1) - 1)); issueDAO.UpdateIssue(issue); } // wdgIssues.ClearDataSource(); // UpdatePanel1.Update(); lblIssueID.Text = null; lblClientID.Text = null; txtName.Text = null; txtDescription.Text = null; ddlType.SelectedValue = null; ddlStatus.SelectedValue = null; lblLoggedDate.Text = null; lblInProcessDate.Text = null; lblResolvedDate.Text = null; wdcRequestCompleteDate.Value = null; ddlPriority.SelectedValue = null; txtEmailCCList.Text = null; }

    Read the article

  • Style Problem with Repeater Inside a Datalist

    - by Jepe d Hepe
    i've used a DataList (dlparent) control for one of my page. Inside that datalist is another Datalist (dlchild) that is being populated by itemdatabound event of the parent datalist. i've used css with dlchild. Databinding is ok and the required output shows great with mozilla and IE but not in netscape, safari and google chrome. dlchild is not showing. only item in dlparent appears. Here's the markup for the dlparent: <asp:DataList ID="SprintsWorkData" Style="float: left; padding-top: 10px;" runat="server" OnItemDataBound="SprintsWorkData_ItemDataBound"> <ItemTemplate> <asp:HiddenField ID="hiddenSprintId" runat="server" Value='<%# Eval("SprintId") %>' /> <div id="SprintNameSection"> <h4> <%# Eval("SprintName") %></h4> </div> <div id="HeaderSection_SelectAll"> <div style="padding-top: 3px; height: 23px; padding-left: 2px;"> <asp:CheckBox ID="isAllCheck" runat="server" onclick="checkAll(this)" /> <b> <asp:Label ID="sAll" Style="color: Black; text-indent: 1px;" Text="Select All" runat="server"></asp:Label> </b> </div> </div> <div class="HeaderSection_WorkedHours"> <b><asp:Literal ID="workedHours" runat="server" Text='<%$ Resources:LanguagePack, Worked_Hours %>'></asp:Literal></b></div> <div class="HeaderSection_BillableHours"> <b><asp:Literal ID="billableHours" runat="server" Text='<%$ Resources:LanguagePack, Billable_Hours %>'></asp:Literal></b></div> <div class="HeaderSection_Comments"> <b><asp:Literal ID="comments" runat="server" Text='<%$ Resources:LanguagePack, Comments %>'></asp:Literal></b></div> <asp:DataList ID="HoursWorkData" runat="server"> <ItemTemplate> <asp:HiddenField ID="hiddenTaskId" runat="server" Value='<%# Eval("BacklogId") %>' /> <div id="ItemSection_Task_Header"> <div style="vertical-align: middle; padding-bottom: 2px; padding-left: 2px; height: 18px;"> <asp:CheckBox ID="checkboxSub" runat="server" onclick="checkAllSub(this)" /> <b style="text-indent: 1px;"> <%# Eval("Title") %></b> </div> </div> <div id="ItemSection_WorkedHours_Header"> <%# Eval("WorkedHours")%>&nbsp;</div> <div id="ItemSection_BillableHours_Header"> <asp:Label ID="lblBillableHours_Header" Text='<%# Eval("BillableHours")%>' runat="server"></asp:Label>&nbsp;</div> <div id="ItemSection_Comments_Header"> </div> <asp:Repeater ID="repResourcesList" runat="server"> <ItemTemplate> <asp:HiddenField ID="hiddenReportId1" runat="server" Value='<%# Eval("ReportId") %>' /> <div id="ItemSection_Task_Item"> <div style="vertical-align: middle; padding-bottom: 5px; padding-left: 2px; padding-top: 1px; height: 14px;"> <asp:CheckBox ID="CB" runat="server" onclick="checkItem(this)" /> <b style="text-indent: 1px;"> <%# Eval("EnteredbyName") %></b> </div> </div> <div id="ItemSection_WorkedHours_Item"> <asp:Label ID="lblWorkedHours_Item" Text='<%# Eval("WorkedHours")%>' runat="server"></asp:Label>&nbsp;</div> <div id="ItemSection_BillableHours_Item"> <asp:RegularExpressionValidator ValidationGroup="ApproveBillable" ID="RegularExpressionValidator1" runat="server" ErrorMessage="*" ValidationExpression="^(-)?\d+(\.\d\d)?$" ControlToValidate="txtBillableHours" Style="position: absolute;">*</asp:RegularExpressionValidator> <asp:TextBox ID="txtBillableHours" Style="text-align: right" runat="server" Font-Size="12px" Width="50px" Text='<%# Eval("BillableHours") %>'></asp:TextBox> </div> <div id="ItemSection_Comments_Item"> <asp:TextBox ID="txtComments" Font-Size="12px" Width="93px" runat="server" Text='<%# Eval("Comment") %>'></asp:TextBox> </div> </ItemTemplate> </asp:Repeater> </ItemTemplate> <ItemStyle Height="24px" /> <SeparatorTemplate> <div id="divSeparator"> </div> </SeparatorTemplate> <FooterTemplate> <div id="Footer1"> TOTAL HOURS &nbsp; </div> <div id="Footer_WorkedHours"> <asp:Label ID="lblWorkedHours" runat="server" Text="0.00" Font-Size="12px" ForeColor="White"></asp:Label>&nbsp; </div> <div id="Footer_BillableHours"> <asp:Label ID="lblBillableHours_Footer" runat="server" Text="0.00" Font-Size="12px" ForeColor="White"></asp:Label>&nbsp; </div> <div id="Footer_Comments"> </div> </FooterTemplate> </asp:DataList> </ItemTemplate> <SeparatorTemplate> &nbsp; </SeparatorTemplate> </asp:DataList> What might be the problem?

    Read the article

  • Why does ASP.Net rewrite relative paths in runat=server anchor controls?

    - by Atomiton
    I have UserControls in a Controls folder in my solution: /Controls/TheControl.ascx If specify the following: <a runat="server" href="./?pg=1">link text</a> ASP.Net seems to want to rewrite the path to point to the absolute location. For example, If the control is on site.com/products/fish/cans.aspx the link href will be rewritten to read <a href="../../Controls/?pg=1 Why does Asp.Net rewrite these control paths, and is there an elegant way to fix it?

    Read the article

  • gridview whith dropdown extender

    - by Wafaa
    hello, I have gridview with TextBox Template field and DropDownExtender so when user click on the textbox another gridview will appear tha contain List of items and button to add the item to the first gridview. my qusetion is: how can i in the event of button click(which is in the extender gridview) to get the row index of the first gridview(which contain the textbox)? thanks <cc1:DropDownExtender ID="uxItemExtender" runat="server" DropDownControlID="uxItemContainer" TargetControlID="uxItems"></cc1:DropDownExtender> <asp:Panel BackColor="AliceBlue" ID="uxItemContainer" runat="server" ScrollBars="Both" Height="400" Width="200"> <asp:GridView ID="uxItemsView" runat="server" Font-Size="Small" AutoGenerateColumns="false" OnRowDataBound="uxItemsView_RowDataBound"> <Columns> <asp:TemplateField HeaderText="Item Details"> <ItemTemplate> <asp:Label ID="uxItemNameLbl" Text="Name :" runat="server"></asp:Label> <asp:Label ID="uxItemName" runat="server"></asp:Label><br /> <asp:Label ID="uxItemDescriptionLbl" Text="Description :" runat="server"></asp:Label> <asp:Label ID="uxItemDescription" runat="server"></asp:Label><br /> <asp:Label ID="uxItemPriceLbl" Text="Price :" runat="server"></asp:Label> <asp:Label ID="uxItemPrice" runat="server"></asp:Label><br /> <asp:Button ID="uxSelectItem" runat="server" Text="Add Item" OnClick="uxSelectItem_Click" /><br /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Picture"> <ItemTemplate> <asp:Image ID="uxItemImage" runat="server" Width="45" Height="50" /> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </asp:Panel> </asp:TemplateField>

    Read the article

  • Design time error - multiple controls with the same Id

    - by ilivewithian
    I'm using VS 2008, I have a very simple page that has a bunch of uniquely named controls. When I try to view it in design mode I get the following error: Error Rendering Control - Label12 An unhanded exception has occurred. Multiple controls with the same ID 'Label1' were found. FindControl requires that controls have unique IDs I've checked the HTML and the designer file and I can only see one control called Label1. What might be causing this? Also, here is the aspx markup I'm having trouble with? <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="CoachingAppearanceReport.aspx.vb" Inherits="AcademyPro.CoachingAppearanceReport" %> <!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></title> </head> <body> <form id="form1" runat="server"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div id="appearanceDetail" class="Left CriteriaContainer"> <asp:Label ID="Label1" runat="server" Text="Appearance Type" AssociatedControlID="ddlAppearanceType" /> <asp:DropDownList ID="ddlAppearanceType" runat="server" CssClass="AppType" OnDataBound="ddlAppearanceType_DataBound" DataSourceID="odsAppearanceType" DataTextField="AppearanceType" DataValueField="AppearanceTypeCode"> </asp:DropDownList> <asp:RequiredFieldValidator ID="rfvAppearanceType" runat="server" ControlToValidate="ddlAppearanceType" InitialValue="" Text="*" ErrorMessage="The appearance type must be selected" /> <asp:Label ID="lblAppearanceType" runat="server" /> <br /> <div class="SubSettings"> <asp:Label ID="Label12" runat="server" Text="Subbed for" AssociatedControlID="ddlSubbedFor" /> <asp:DropDownList ID="ddlSubbedFor" runat="server" OnDataBound="ddlSubbedFor_DataBound" DataSourceID="odsPlayersInAgeGroup" DataTextField="PlayerName" DataValueField="PlayerID"> </asp:DropDownList> <asp:Label ID="lblSubbedFor" runat="server" /> <br /> <asp:Label ID="Label13" runat="server" Text="Mins" AssociatedControlID="txtSubMins" /> <asp:TextBox ID="txtSubMins" runat="server" MaxLength="3" CssClass="TinyWidth" /> <asp:Label ID="lblSubMins" runat="server" /> </div> </div> </ContentTemplate> </asp:UpdatePanel> </form> </body> </html>

    Read the article

  • ASP.NET Multi-Select Radio Buttons

    - by Ajarn Mark Caldwell
    “HERESY!” you say, “Radio buttons are for single-select items!  If you want multi-select, use checkboxes!”  Well, I would agree, and that is why I consider this a significant bug that ASP.NET developers need to be aware of.  Here’s the situation. If you use ASP:RadioButton controls on your WebForm, then you know that in order to get them to behave properly, that is, to define a group in which only one of them can be selected by the user, you use the Group attribute and set the same value on each one.  For example: 1: <asp:RadioButton runat="server" ID="rdo1" Group="GroupName" checked="true" /> 2: <asp:RadioButton runat="server" ID="rdo2" Group="GroupName" /> With this configuration, the controls will render to the browser as HTML Input / Type=radio tags and when the user selects one, the browser will automatically deselect the other one so that only one can be selected (checked) at any time. BUT, if you user server-side code to manipulate the Checked attribute of these controls, it is possible to set them both to believe that they are checked. 1: rdo2.Checked = true; // Does NOT change the Checked attribute of rdo1 to be false. As long as you remain in server-side code, the system will believe that both radio buttons are checked (you can verify this in the debugger).  Therefore, if you later have code that looks like this 1: if (rdo1.Checked) 2: { 3: DoSomething1(); 4: } 5: else 6: { 7: DoSomethingElse(); 8: } then it will always evaluate the condition to be true and take the first action.  The good news is that if you return to the client with multiple radio buttons checked, the browser tries to clean that up for you and make only one of them really checked.  It turns out that the last one on the screen wins, so in this case, you will in fact end up with rdo2 as checked, and if you then make a trip to the server to run the code above, it will appear to be working properly.  However, if your page initializes with rdo2 checked and in code you set rdo1 to checked also, then when you go back to the client, rdo2 will remain checked, again because it is the last one and the last one checked “wins”. And this gets even uglier if you ever set these radio buttons to be disabled.  In that case, although the client browser renders the radio buttons as though only one of them is checked the system actually retains the value of both of them as checked, and your next trip to the server will really frustrate you because the browser showed rdo2 as checked, but your DoSomething1() routine keeps getting executed. The following is sample code you can put into any WebForm to test this yourself. 1: <body> 2: <form id="form1" runat="server"> 3: <h1>Radio Button Test</h1> 4: <hr /> 5: <asp:Button runat="server" ID="cmdBlankPostback" Text="Blank Postback" /> 6: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7: <asp:Button runat="server" ID="cmdEnable" Text="Enable All" OnClick="cmdEnable_Click" /> 8: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9: <asp:Button runat="server" ID="cmdDisable" Text="Disable All" OnClick="cmdDisable_Click" /> 10: &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 11: <asp:Button runat="server" ID="cmdTest" Text="Test" OnClick="cmdTest_Click" /> 12: <br /><br /><br /> 13: <asp:RadioButton ID="rdoG1R1" GroupName="Group1" runat="server" Text="Group 1 Radio 1" Checked="true" /><br /> 14: <asp:RadioButton ID="rdoG1R2" GroupName="Group1" runat="server" Text="Group 1 Radio 2" /><br /> 15: <asp:RadioButton ID="rdoG1R3" GroupName="Group1" runat="server" Text="Group 1 Radio 3" /><br /> 16: <hr /> 17: <asp:RadioButton ID="rdoG2R1" GroupName="Group2" runat="server" Text="Group 2 Radio 1" /><br /> 18: <asp:RadioButton ID="rdoG2R2" GroupName="Group2" runat="server" Text="Group 2 Radio 2" Checked="true" /><br /> 19:  20: </form> 21: </body> 1: protected void Page_Load(object sender, EventArgs e) 2: { 3:  4: } 5:  6: protected void cmdEnable_Click(object sender, EventArgs e) 7: { 8: rdoG1R1.Enabled = true; 9: rdoG1R2.Enabled = true; 10: rdoG1R3.Enabled = true; 11: rdoG2R1.Enabled = true; 12: rdoG2R2.Enabled = true; 13: } 14:  15: protected void cmdDisable_Click(object sender, EventArgs e) 16: { 17: rdoG1R1.Enabled = false; 18: rdoG1R2.Enabled = false; 19: rdoG1R3.Enabled = false; 20: rdoG2R1.Enabled = false; 21: rdoG2R2.Enabled = false; 22: } 23:  24: protected void cmdTest_Click(object sender, EventArgs e) 25: { 26: rdoG1R2.Checked = true; 27: rdoG2R1.Checked = true; 28: } 29: 30: protected void Page_PreRender(object sender, EventArgs e) 31: { 32:  33: } After you copy the markup and page-behind code into the appropriate files.  I recommend you set a breakpoint on Page_Load as well as cmdTest_Click, and add each of the radio button controls to the Watch list so that you can walk through the code and see exactly what is happening.  Use the Blank Postback button to cause a postback to the server so you can inspect things without making any changes. The moral of the story is: if you do server-side manipulation of the Checked status of RadioButton controls, then you need to set ALL of the controls in a group whenever you want to change one.

    Read the article

  • Updating with using custom class collection not working

    - by Risho
    I've posted this yesterday on asp forum but no one replied so perhaps I'll have better luck here. For some reason the OnUpdating method does not pull new values from the grid which is in edit mode. I've search and have come across several blogs and sites, some sugesting that an ObjectDataSource is required in order to use the "e.NewValue" construct others provide code to the contrary. I don't get any errors - the variables in the code file would contain the old values rather then new ones. I don't want to use the ODS way of manipulating the data. My delete method works but not the update one. Can you suggest what is wrong with the code? Here is what I've got: aspx file: <asp:GridView ID="gvBlack" runat="server" AutoGenerateColumns="False" OnRowUpdating="gvBlack_OnUpdating" OnRowEditing="gvBlack_RowEditing"> <Columns> <%--<asp:BoundField DataField="Ident_Black" ReadOnly="True" visible="false" />--%> <asp:TemplateField ItemStyle-Width="1px"> <EditItemTemplate> <asp:Label ID="lblIdent_Black" runat="server" Text='<%# Bind("Ident_Black") %>' Visible="false" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Model" > <ItemTemplate> <asp:Label ID="lblModel_Black" runat="server" Text='<%# Bind("Model_Black") %>' width="130px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtModel_Black" runat="server" Text='<%# Eval("Model_Black") %>' width="100px" /> <asp:RequiredFieldValidator ID="rfvModel_Black" runat="server" ControlToValidate="txtModel_Black" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Description" > <ItemTemplate> <asp:Label ID="lblDesc_Black" runat="server" Text='<%# Bind("Desc_Black") %>' width="200px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtDesc_Black" runat="server" Text='<%# Eval("Desc_Black") %>' width="170px" /> <span></span> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Qty" > <ItemTemplate> <asp:Label ID="lblQty_Black" runat="server" Text='<%# Bind("Qty_Black") %>' width="35px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtQty_Black" runat="server" Text='<%# Eval("Qty_Black") %>' width="35px" /> <asp:RequiredFieldValidator ID="rfvQty_Black" runat="server" ControlToValidate="txtQty_Black" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Reorder<br />Limit"> <ItemTemplate> <asp:Label ID="lblBlack_Reorder_Limit" runat="server" Text='<%# Bind("Black_Reorder_Limit") %>' width="35px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtBlack_Reorder_Limit" runat="server" Text='<%# Eval("Black_Reorder_Limit") %>' width="35px" /> <asp:RequiredFieldValidator ID="rfvBlack_Reorder_Limit" runat="server" ControlToValidate="txtBlack_Reorder_Limit" SetFocusOnError="true" ErrorMessage="*" ValidationGroup="CurrentMfg" ForeColor="Red" Font-Bold="true" /> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Notes"> <ItemTemplate> <asp:Label ID="lblNotes" runat="server" Text='<%# Bind("Notes") %>' width="200px" /> </ItemTemplate> <EditItemTemplate> <asp:TextBox ID="txtNotes" runat="server" Text='<%# Eval("Notes") %>' width="170px" /> <span></span> </EditItemTemplate> </asp:TemplateField> <asp:CommandField ShowEditButton="True" ShowDeleteButton="false" ValidationGroup="CurrentToner" /> </Columns> </asp:GridView> aspx.cs file: protected void Page_Load(object sender, EventArgs e) { LoadData_TonerBlack(); } private void LoadData_TonerBlack() { dalConsumables_TonerBlack drTonerBlack = new dalConsumables_TonerBlack(); gvBlack.DataSource = drTonerBlack.GetListTonersBlack(); gvBlack.DataBind(); } protected void gvBlack_OnUpdating(object sender, GridViewUpdateEventArgs e) { //GridView gvBlack = (GridView)sender; //GridViewRow gvBlackRow = (GridViewRow)gvBlack.Rows[e.RowIndex]; int _Ident_Black = Convert.ToInt32(gvBlack.DataKeys[e.RowIndex].Values[0].ToString()); TextBox _txtModel_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtModel_Black"); TextBox _txtDesc_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtDesc_Black"); TextBox _txtQty_Black = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtQty_Black"); TextBox _txtBlack_Reorder_Limit = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtBlack_Reorder_Limit"); TextBox _txtNotes = (TextBox)gvBlack.Rows[e.RowIndex].FindControl("txtNotes"); string _updatedBy = Request.ServerVariables["AUTH_USER"].ToString(); dalConsumables_TonerBlack updateTonerBlack = new dalConsumables_TonerBlack(); updateTonerBlack.UpdateTonerBlack(_Ident_Black, _txtModel_Black.Text, _txtDesc_Black.Text, Convert.ToInt32(_txtQty_Black.Text), Convert.ToInt32(_txtBlack_Reorder_Limit.Text), _txtNotes.Text, _updatedBy); gvBlack.EditIndex = -1; LoadData_TonerBlack(); } protected void gvBlack_RowEditing(object sender, GridViewEditEventArgs e) { gvBlack.EditIndex = e.NewEditIndex; LoadData_TonerBlack(); } Thanks in advance! Risho

    Read the article

  • Why does ASP.Net rewrite relative paths for runat=server anchor controls?

    - by Atomiton
    I have my UserControls in a ~/Controls folder in my solution: /Controls/TheControl.ascx If specify the following: <a runat="server" href="./?pg=1">link text</a> ASP.Net seems to want to rewrite the path to point to the absolute location. For example, If the control is on site.com/products/fish/cans.aspx the link href will be rewritten to read <a href="../../Controls/?pg=1>link text</a> Why does Asp.Net rewrite these control paths, and is there an elegant way to fix it? I just want the anchor control to spit out exactly what I tell it to!!! Is that so hard?

    Read the article

  • How to modify the HTML and BODY tags in an ASP.NET page without adding runat=server to the elements?

    - by jon333
    In an ASP.NET web forms project that is not quite ready to be upgraded from 2.0 to 4.0 , there is a change that needs to be made to allow modifications to the HTML and BODY tags on the pages without adding runat=server to the tags which results in the 2.0 styled "ugly ids" like "ctrl_100..." For example, how could we change these using JavaScript, a Response Filter (the regex to find these specific tags would really help on this one), or something else...from: <html xmlns="//www.w3.org/1999/xhtml"> <body> To: <html lang="jp=JP" xmlns="//www.w3.org/1999/xhtml" dir="rtl"> <body dir="rtl"> JavaScript seems like a possibility, but functions from the server-side could would determine the language and direction the page should have.

    Read the article

  • Doesn’t <asp:A runat=”server” B=”someValue” … /> syntax violate one of the basic rules in C# languag

    - by AspOnMyNet
    Assuming server control of type A has a protected member M, then we are also able to access A.M via declaring control tag A on some aspx page: <asp:A runat=”server” M=”someValue” … /> But isn’t one of the rules in C# that protected members of class A can only be accessed from A and from classes derived from A? So doesn’t the ability to access member A.M via <asp:A M=”someValue” … /> syntax violate this rule, since we are basically accessing A.M from a class ( which is automatically generated aspx class ) not derived from A?!

    Read the article

  • how to display user name in login name control

    - by user569285
    I have a master page that holds the loginview content that appears on all subsequent pages based on the master page. i have a username control also nested in the loginview to display the name of the user when they are logged in. the code for the loginview from the master page is displayed as follows: <div class="loginView"> <asp:LoginView ID="MasterLoginView" runat="server"> <LoggedInTemplate> Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /> <asp:Label ID="userNameLabel" runat="server" Text="Label"></asp:Label></span>! [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/Logout.aspx"/> ] <%--Welcome: <span class="bold"><asp:LoginName ID="MasterLoginName" runat="server" /> </span>!--%> </LoggedInTemplate> <AnonymousTemplate> Welcome: Guest [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ] </AnonymousTemplate> </asp:LoginView> <%--&nbsp;&nbsp; [&nbsp;<asp:LoginStatus ID="MasterLoginStatus" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Logout.aspx" />&nbsp;]&nbsp;&nbsp;--%> </div> Since VS2010 launches with a default login page in the accounts folder, i didnt think it necessary to create a separate log in page, so i just used the same log in page. please find the code for the login control below: <asp:Login ID="LoginUser" runat="server" EnableViewState="false" RenderOuterTable="false"> <LayoutTemplate> <span class="failureNotification"> <asp:Literal ID="FailureText" runat="server"></asp:Literal> </span> <asp:ValidationSummary ID="LoginUserValidationSummary" runat="server" CssClass="failureNotification" ValidationGroup="LoginUserValidationGroup"/> <div class="accountInfo"> <fieldset class="login"> <legend style="text-align:left; font-size:1.2em; color:White;">Account Information</legend> <p style="text-align:left; font-size:1.2em; color:White;"> <asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User ID:</asp:Label> <asp:TextBox ID="UserName" runat="server" CssClass="textEntry"></asp:TextBox> <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName" CssClass="failureNotification" ErrorMessage="User ID is required." ToolTip="User ID field is required." ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator> </p> <p style="text-align:left; font-size:1.2em; color:White;"> <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label> <asp:TextBox ID="Password" runat="server" CssClass="passwordEntry" TextMode="Password"></asp:TextBox> <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password" CssClass="failureNotification" ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="LoginUserValidationGroup">*</asp:RequiredFieldValidator> </p> <p style="text-align:left; font-size:1.2em; color:White;"> <asp:CheckBox ID="RememberMe" runat="server"/> <asp:Label ID="RememberMeLabel" runat="server" AssociatedControlID="RememberMe" CssClass="inline">Keep me logged in</asp:Label> </p> </fieldset> <p class="submitButton"> <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="LoginUserValidationGroup" onclick="LoginButton_Click"/> </p> </div> </LayoutTemplate> </asp:Login> I then wrote my own code for authentication since i had my own database. the following displays the code in the login buttons click event.: public partial class Login : System.Web.UI.Page { //create string objects string userIDStr, pwrdStr; protected void LoginButton_Click(object sender, EventArgs e) { //assign textbox items to string objects userIDStr = LoginUser.UserName.ToString(); pwrdStr = LoginUser.Password.ToString(); //SQL connection string string strConn; strConn = WebConfigurationManager.ConnectionStrings["CMSSQL3ConnectionString"].ConnectionString; SqlConnection Conn = new SqlConnection(strConn); //SqlDataSource CSMDataSource = new SqlDataSource(); // CSMDataSource.ConnectionString = ConfigurationManager.ConnectionStrings["CMSSQL3ConnectionString"].ToString(); //SQL select statement for comparison string sqlUserData; sqlUserData = "SELECT StaffID, StaffPassword, StaffFName, StaffLName, StaffType FROM Staffs"; sqlUserData += " WHERE (StaffID ='" + userIDStr + "')"; sqlUserData += " AND (StaffPassword ='" + pwrdStr + "')"; SqlCommand com = new SqlCommand(sqlUserData, Conn); SqlDataReader rdr; string usrdesc; string lname; string fname; string staffname; try { //string CurrentData; //CurrentData = (string)com.ExecuteScalar(); Conn.Open(); rdr = com.ExecuteReader(); rdr.Read(); usrdesc = (string)rdr["StaffType"]; fname = (string)rdr["StaffFName"]; lname = (string)rdr["StaffLName"]; staffname = lname.ToString() + " " + fname.ToString(); LoginUser.UserName = staffname.ToString(); rdr.Close(); if (usrdesc.ToLower() == "administrator") { Response.Redirect("~/CaseAdmin.aspx", false); } else if (usrdesc.ToLower() == "manager") { Response.Redirect("~/CaseManager.aspx", false); } else if (usrdesc.ToLower() == "investigator") { Response.Redirect("~/Investigator.aspx", false); } else { Response.Redirect("~/Default.aspx", false); } } catch(Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } finally { Conn.Close(); } } My authentication works perfectly and the page gets redirected to the designated destination. However, the login view does not display the users name. i actually cant figure out how to pass the users name that i had picked from the database to the login name control to be displayed. taking a close look i also noticed the logout text that should be displayed after successful log in does not show. that leaves me wondering if the loggedin template control on the masterpage even fires at all or its still the anonymous template control that keeps displaying.? How do i get this to work as expected? Please help....

    Read the article

  • Using themed css files requires a header control on the page. (e.g. <head runat="server" />).

    - by wide
    in local it works. when i load server, i got this error. Using themed css files requires a header control on the page. (e.g. <head runat="server" />). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat="server" />). Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [InvalidOperationException: Using themed css files requires a header control on the page. (e.g. <head runat="server" />).] System.Web.UI.PageTheme.SetStyleSheet() +2458406 System.Web.UI.Page.OnInit(EventArgs e) +8699420 System.Web.UI.Control.InitRecursive(Control namingContainer) +333 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378 -------------------------------------album1.aspx------------------ <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="album1.aspx.cs" Inherits="album1" Title="Özkan Köylü | Albüm" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <script src="scripts/Silverlight.js" type="text/javascript"></script> <script src="scripts/Default_html.js" type="text/javascript"></script> <script src="scripts/Page.xaml.js" type="text/javascript"></script> <script src="scripts/gallery.js" type="text/javascript"></script> <div align="center" id="SilverlightControlHost"> <script type="text/javascript"> createSilverlight(); </script> </div> </asp:Content>

    Read the article

  • Modalpopupextender - Javascript error

    - by clklachu
    Hi, I just tried creating a simple sample with Modalpopup extender and Caledarextender. My design is like below. <asp:UpdatePanel ID="pnlUpdate" runat="server"> <ContentTemplate> <asp:Panel ID="pnlSample" runat="server" CssClass="frame"> <asp:TextBox ID="txtOSDate" runat="server"></asp:TextBox> <asp:TextBox ID="txtDate" runat="server"></asp:TextBox> <asp:CalendarExtender ID="calDate" runat="server" TargetControlID="txtOSDate"> </asp:CalendarExtender> <asp:CalendarExtender ID="calOSDate" runat="server" TargetControlID="txtDate"> </asp:CalendarExtender> <asp:Button ID="btnCancel" runat="server" Text="Cancel" /> </asp:Panel> <asp:Button ID="btnHiddenSample" runat="server" Style="display: none;" /> <asp:Button ID="btnSample" runat="server" CssClass="Button" Text="New Sample" /> <asp:ModalPopupExtender ID="mpeSample" runat="server" TargetControlID="btnHiddenSample" CancelControlID="btnCancel" PopupControlID="pnlSample" DropShadow="false" BackgroundCssClass="modalBackground"> </asp:ModalPopupExtender> </ContentTemplate> </asp:UpdatePanel> When i run the sample and click the "New Sample" button, i get javascript error as "Error: Sys.InvalidOperationException: Two components with the same id 'ctl00_MainContent_calDate' can't be added to the application.' can't be added to the application." I checked the rendered HTML using DeveloperTools and i still found the asp Panel recreated. Someone please advice me what is the actual problem? PS:When i comment the Calendar Extender, i dont get the error. Regards, Lakxman Kumar C

    Read the article

  • FCKEditor doesn't set Value property on postback!

    - by Shaul
    I'm using FCKEditor on my asp.net web page. It appears beautifully, and the editor looks really good on the front end. Only problem is, the .Value property is not being set on the postback. No matter what changes the user makes to the value of the control on the page, when I click "Submit", the .Value property remains blank. I have Googled for other solutions, and most of them are of the variety where there's some conflict with Ajax, such as this and this. My problem is not solved by these solutions; it's much more fundamental than that. I'm not doing anything to do with Ajax; I'm just a simple asp.net newbie with a simple web form, and the value property is not being set on postback, not in IE and not in FF. It appears that at least one other person has had this problem, but no solution yet. Any ideas? Thanks! New information: I tried this out on a "hello world" test web site - and the test web site works 100%. There is obviously a problem on my page, but I have no idea where to begin tracking this down. Here's the markup of my page, in case anyone can see anything obvious that my newbie eyes can't: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="EmailTemplateEditForm.aspx.vb" Inherits="EEI_App.EmailTemplateEditForm" %> <%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %> <!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>EEI - Email Template</title> <link rel="stylesheet" href="EEI.css"> <script language="javascript" id="jssembleWare" src="sembleWare.js"></script> <style type="text/css"> .style1 { height: 251px; } .style2 { width: 2%; height: 251px; } .style3 { height: 490px; } </style> </head> <body> <form id="form1" runat="server"> <%@ register src="header.ascx" tagname="header" tagprefix="uc1" %> <%@ register src="footer.ascx" tagname="footer" tagprefix="uc1" %> <uc1:header ID="header1" runat="server" /> <!-- main content area --> <div class="content"> <!-- title of the page --> <div class="boxheader"> Email Template </div> <div class="standardbox"> <!-- Start Page Main Contents--> <!-- error messages --> <div class="errorbox"> <asp:Label ID="lblError" CssClass="ErrorControlStyle" runat="server" EnableViewState="False" Width="100%"></asp:Label> </div> <table class="contenttable"> <tr> <td align="left" valign="top" class="style3"> <div class="actionbox"> <div class="navheadertitle"> Navigation</div> <ul> <li> <asp:LinkButton ID="btnSubmit" CssClass="LinkButtonStyle" runat="server">Submit</asp:LinkButton> </li> <li> <asp:LinkButton ID="btnCancel" CssClass="LinkButtonStyle" runat="server" CausesValidation="false">Cancel</asp:LinkButton> </li> </ul> </div> </td> <td align="left" valign="top" class="style3"> <p> </p> <table> <tr class="MCRSFieldRow"> <td class="MCRSFieldLabelCell"> <asp:Label ID="lblEmailTemplate_TemplateName" CssClass="LabelStyle" runat="server" Width="175">Template Name</asp:Label> </td> <td class="MCRSFieldEditCell"> <asp:TextBox ID="txtEmailTemplate_TemplateName" CssClass="TextBoxStyle" runat="server" Width="100%"></asp:TextBox> </td> <td class="MCRSFieldLabelCell"> <asp:Label ID="lblEmailTemplate_TemplateType" CssClass="LabelStyle" runat="server" Width="175">Template Type</asp:Label> </td> <td class="MCRSFieldEditCell"> <asp:RadioButtonList ID="rblEmailTemplate_TemplateType" CssClass="RadioButtonListStyle" runat="server" RepeatColumns="1" RepeatDirection="Horizontal" Width="135px"> <asp:ListItem Value="1">Cover Letter</asp:ListItem> <asp:ListItem Value="2">Email</asp:ListItem> </asp:RadioButtonList> </td> <td class="MCRSRowRightCell"> &nbsp; </td> </tr> <tr class="MCRSFieldRow"> <td class="MCRSFieldLabelCell"> Composition Date </td> <td class="MCRSFieldEditCell"> <asp:Label ID="lblEmailTemplate_CompositionDate" CssClass="ElementLabelStyle" runat="server" Width="175"></asp:Label> </td> <td class="MCRSFieldLabelCell"> Last Used Date </td> <td class="MCRSFieldEditCell"> <asp:Label ID="lblEmailTemplate_LastUsedDate" CssClass="ElementLabelStyle" runat="server" Width="175"></asp:Label> </td> <td class="MCRSRowRightCell"> &nbsp; </td> </tr> <tr class="MCRSFieldRow"> <td class="MCRSFieldLabelCell"> Composed By </td> <td class="MCRSFieldEditCell" colspan="3"> <asp:Label ID="lblPerson_FirstNames" CssClass="ElementLabelStyle" runat="server"></asp:Label> <asp:Label ID="lblPerson_LastName" CssClass="ElementLabelStyle" runat="server"></asp:Label> </td> <td class="MCRSRowRightCell"> &nbsp; </td> </tr> <tr class="MCRSFieldRow"> <td class="MCRSFieldLabelCell"> <asp:Label ID="lblEmailTemplate_Subject" CssClass="LabelStyle" runat="server" Width="175">Subject</asp:Label> </td> <td class="MCRSFieldEditCell" colspan="3"> <asp:TextBox ID="txtEmailTemplate_Subject" CssClass="TextBoxStyle" runat="server" Width="100%"></asp:TextBox> </td> <td class="MCRSRowRightCell"> &nbsp; </td> </tr> <tr class="MCRSFieldRow"> <td class="style1"> <asp:Label ID="lblEmailTemplate_Body" CssClass="LabelStyle" runat="server" Width="175">Body</asp:Label> </td> <td class="style1" colspan="3"> <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Height="500px"> </FCKeditorV2:FCKeditor> </td> <td class="style2"> &nbsp; </td> </tr> </table> </td> </tr> </table> </div> <p> <a class="InputButtonStyle" href="#_swTopOfPage">Top of Page</a> </p> </div> <uc1:footer ID="footer1" runat="server" /> <p> <asp:TextBox ID="txtEmailTemplate_Body" CssClass="TextAreaStyle" Rows="4" runat="server" Width="100%" Height="16px" Visible="False"></asp:TextBox> </p> </form> </body> </html>

    Read the article

  • CrossPage PostBack in series of web pages

    - by Vishnu Reddy
    I had a requirement to pass data between pages in my application. I have a Page A where user will input some data and on submit User will be redirected to Page B where again user will enter some more data and on submitting user will be show a confirmation in Page C after doing some calculations and data saving. Following is the idea I was trying to use: PageA.aspx: <form id="frmPageA" runat="server"> <p>Name: <asp:TextBox ID="txtName" runat="server"></asp:TextBox></p> <p>Age: <asp:TextBox ID="txtAge" runat="server"></asp:TextBox></p> <p><asp:Button ID="btnPostToPageB" runat="server" Text="Post To PageB" PostBackUrl="~/PageB.aspx" /></p> </form> In Page A Codebehind file I am creating following public properties of the inputs to access in Page B: public string Name { get { return txtName.Text.ToString(); } } public int Age { get { return Convert.ToInt32(txtAge.Text); } } In PageB.aspx: using previouspage directive to access page A public properties <%@ PreviousPageType VirtualPath="~/PageA.aspx" % <form id="frmPageB" runat="server"> <asp:HiddenField ID="hfName" runat="server" /> <asp:HiddenField ID="hfAge" runat="server" /> <p><asp:RadioButtonList ID="rblGender" runat="server" TextAlign="Right" RepeatDirection="Horizontal"> <asp:ListItem Value="Female">Female</asp:ListItem> <asp:ListItem Value="Male">Male</asp:ListItem> </asp:RadioButtonList></p> <p><asp:Button ID="btnPostToPageC" runat="server" Text="Post To PageC" PostBackUrl="~/PageC.aspx" /></p> </form> In Page B Codebehind file I am creating following public properties for the inputs to access in Page C: public RadioButtonList Gender { get { return rblGender; } } public string Name { get { return _name; } } public int Age { get { return _age; } } //checking if data is posted from Page A otherwise redirecting User to Page A protected void Page_Load(object sender, EventArgs e) { if (PreviousPage != null && PreviousPage.IsCrossPagePostBack && PreviousPage.IsValid) { hfName.Value = PreviousPage.Name; hfAge.Value = PreviousPage.Age.ToString(); } else Response.Redirect("PageA.aspx"); }` in PageC.aspx: using previouspage directive to access page A public properties <%@ PreviousPageType VirtualPath="~/PageB.aspx" % <form id="frmPageC" runat="server"> <p>Name: <asp:Label ID="lblName" runat="server"></asp:Label></p> <p>Age: <asp:Label ID="lblAge" runat="server"></asp:Label></p> <p>Gender: <asp:Label ID="lblGender" runat="server"></asp:Label></p> <p><asp:Button ID="btnBack" runat="server" Text="Back" PostBackUrl="~/PageA.aspx" /></p> </form> Page C code behind file: if (PreviousPage != null && PreviousPage.IsCrossPagePostBack && PreviousPage.IsValid) { lblName.Text = PreviousPage.Name.ToString(); lblAge.Text = PreviousPage.Age.ToString(); lblGender.Text = PreviousPage.Gender.SelectedValue.ToString(); } else Response.Redirect("PageA.aspx");

    Read the article

  • Listview with objectdatasource Delete not working

    - by Radhi
    Hello, i have one Listview in my Usercontrol & 1 objectdatasource binded with the ListView. now in objectdatasource's Deletemethod i have taken businessobject as argument but at runtime i am not getting value in my businessobject's properties... i also tried to use "Bind" instead of "eval" in ItemTemplate. but not getting any value at runtime in my DeleteMethod provided in objectdatasource's Deletecommand... can anybody help to know weather i am mising anything or what? my Listview's ItemTemplate <ItemTemplate> <asp:HiddenField ID="hidUserAchievementInfoId" runat="server" Value='<%# Bind("UserAchievementInfoId") %>' /> <asp:HiddenField ID="hidUserIdField" runat="server" Value='<%# Bind("UserId") %>' /> <tr> <td class="style1"> <asp:Label ID="AwardLabel" runat="server" Text="Award "></asp:Label> </td> <td> <asp:Label ID="lblAward" runat="server" Text='<%# Bind("Awards") %>'></asp:Label> </td> </tr> <tr> <td class="style1"> <asp:Label ID="FieldofAwardLabel" runat="server" Text="Field of Award "></asp:Label> </td> <td> <asp:Label ID="lblFieldofAward" runat="server" Text='<%# Bind("FieldofAward") %>'></asp:Label> </td> </tr> <tr> <td class="style1"> <asp:Label ID="TournamentLabel" runat="server" Text="Tournament "></asp:Label> </td> <td> <asp:Label ID="lblTournament" runat="server" Text='<%# Bind("Tournament") %>'></asp:Label> </td> </tr> <tr> <td class="style1"> <asp:Label ID="AwardYearLabel" runat="server" Text="Award Year "></asp:Label> </td> <td> <asp:Label ID="AwardYear" runat="server" Text='<%# Bind("AwardYear") %>'></asp:Label> </td> </tr> <tr> <td class="style1"> <asp:Label ID="AwardDescriptionLabel" runat="server" Text="Description "></asp:Label> </td> <td> <asp:Label ID="lblAwardDescription" runat="server" Text='<%# Bind("AwardDescription") %>'></asp:Label> </td> </tr> <tr> <td class="style1"> <asp:LinkButton ID="EditButton" runat="server" CommandName="Edit" Text="Edit"></asp:LinkButton> </td> <td> <asp:LinkButton ID="DeleteButton" runat="server" CommandName="Delete" Text="Delete"></asp:LinkButton> </td> </tr> </ItemTemplate> Delete Method used in objectdata source's Deletecommand public void DeleteUserAchievementInfo(UserAchivementInfoBO BOInstance) { try { Int64 UserAchievementInfoId=BOInstance.UserAchievementInfoId objUserBasicInfoServiceClient.DeleteUserAchievementInfo(UserAchievementInfoId); } catch (Exception ex) { HandleException.LogError(ex); } }

    Read the article

  • Need some resoultion. Javascript function not being called in click event in jquery.

    - by Shantanu Gupta
    I am trying to call my function named isUrgencyTypeValid from my javascript code but it is not working. Please check what is the problem in my code. Alert should get displayed which is not being displayed My javascript function is not being called. HTML Code <td colspan="2" align="center"><input id="btnSubmit" type="submit" value="submit" runat="server"/></td></tr> jQuery Call function $("#btnSubmit").bind("click",function(){ alert(); // this is running isUrgencyTypeValid(); }); javascript implemented function function isUrgencyTypeValid() { alert("asd"); var i=0; for(i=0;i<$("radio[name='urgencyType']").length;i++) { if($("radio[name='urgencyType']")[i].checked) { alert($("radio[name='urgencyType']")[i].value); return true; } return false; } More description about my form is here <form runat="server" name="myPage"> <table style="width: 100%;" cellpadding="5" cellspacing="5"> <caption> Computer Support / Service Request </caption> <tr><td>First Name</td> <td><input id="txtFirstName" type="text" value="First Name" runat="server"/><span class="error"></span></td></tr> <tr> <td>Last Name</td> <td><input id="txtLastName" type="text" value="Last Name" runat="server"/><span class="error"></span></td></tr> <tr> <td>Email Address</td> <td><input id="txtEmailAddress" type="text" value="Email Address" runat="server"/><span class="error"></span></td></tr> <tr> <td>Phone No</td> <td><input id="txtPhoneNo" type="text" value="Phone No" runat="server" /><span class="error"></span></td></tr> <tr> <td>Do you have text messaging</td> <td> <span>Yes</span><input id="rdoYes" value="Yes" type="radio" runat="server"/> <span>No</span><input id="rdoNo" value="No" type="radio" runat="server"/><span class="error"></span> </td></tr> <tr> <td>Description of request*: </td> <td><textarea id="txtDescription" cols="50" rows="10" runat="server"></textarea><span class="error"></span><span id="lengthCount"></span></td></tr> <tr> <td>Urgency of this support request:</td> <td> <input id="rdoAnyTime" name="urgencyType" value="Anytime" type="radio" runat="server"/><span>Anytime</span><br /> <input id="rdoCplDays" name="urgencyType" value="In the next couple of days" type="radio" runat="server"/><span>In the next couple of days</span><br /> <input id="rdoToday" name="urgencyType" value="Today" type="radio" runat="server"/><span>Today</span><br /> <input id="rdoUrgent" name="urgencyType" value="This is extremely urgent...I cannot wait!" type="radio" runat="server"/><span>This is extremely urgent...I cannot wait!</span><br /> <input id="rdoTalkSometime" name="urgencyType" value="Please contact me and we'll talk about it" type="radio" runat="server"/><span>Please contact me and we'll talk about it</span><br /><span class="error"></span> </td></tr> <tr> <td colspan="2" align="center">Captcha To Be implemented.</td></tr> <tr> <td></td> <td><input id="chkRequestCopy" type="checkbox" runat="server"/>Please send me a copy of this service request</td></tr> <tr> <td colspan="2" align="center"><input id="btnSubmit" type="submit" value="submit" runat="server"/></td></tr> </table> </form>

    Read the article

  • How to debug SITE.MASTER ASPX file?

    - by salvationishere
    I am developing a C#/SQL VS 2008 website application and I'm trying to set breakpoints in my site.master file--is there a way to do this? The contents of this file are: <%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="Site" %> <!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 id="Head1" runat="server"> <title>Forms Authentication, Authorization, and User Accounts</title> <link href="Styles.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="wrapper"> <form id="form1" runat="server"> <div id="header"> <span class="title">User Account Tutorials</span><br /> <span class="breadcrumb"> <asp:SiteMapPath ID="SiteMapPath1" runat="server"> </asp:SiteMapPath> </span> </div> <div id="content"> <asp:ContentPlaceHolder ID="MainContent" runat="server"> <!-- Page-specific content will go here... --> </asp:ContentPlaceHolder> </div> <div id="navigation"> <asp:ContentPlaceHolder ID="LoginContent" runat="server"> <asp:LoginView ID="LoginView1" runat="server"> <LoggedInTemplate> Welcome back,<asp:LoginName ID="LoginName1" runat="server" /> </LoggedInTemplate> <AnonymousTemplate> Hello, stranger! </AnonymousTemplate> </asp:LoginView> <br /> <br /> </asp:ContentPlaceHolder> <asp:LoginStatus ID="LoginStatus1" runat="server" LogoutAction="Redirect" LogoutPageUrl="~/Logout.aspx" /> <ul> <li> <asp:HyperLink runat="server" ID="lnkHome" NavigateUrl="~/Default.aspx">Home</asp:HyperLink> </li> <asp:Repeater runat="server" ID="menu" DataSourceID="SiteMapDataSource1"> <ItemTemplate> <li> <asp:HyperLink ID="lnkMenuItem" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> <asp:Repeater ID="submenu" runat="server" DataSource="<%# ((SiteMapNode) Container.DataItem).ChildNodes %>"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li> <asp:HyperLink ID="lnkMenuItem" runat="server" NavigateUrl='<%# Eval("Url") %>'><%# Eval("Title") %></asp:HyperLink> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater> </li> </ItemTemplate> </asp:Repeater> </ul> <asp:SiteMapDataSource ID="SiteMapDataSource1" runat="server" ShowStartingNode="false" /> </div> </form> </div> </body> </html>

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >