Search Results

Search found 236 results on 10 pages for 'linkbutton'.

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

  • Problem with events and ParseControl

    - by Richard Edwards
    I'm adding a control (linkbutton) dynamically using ParseControl and it's fine except when I specify an event handler. If I use: Dim c As Control = ParseControl("<asp:LinkButton id=""btnHide"" runat=""server"" text=""Hide"" OnClick="btnHide_Click" />") it correctly adds the control to the page but the click event doesn't fire. If instead I find the control in the controls collection and manually wire up the event it works fine. I've tried loading in both Page_Init and Page_Load and it's the same thing either way. Any ideas?

    Read the article

  • how to call postback link of another element in jQuery on some other event?

    - by Amit
    Hi This is kind of peculiar requirement.. I am using asp.net and jQuery together I have a link button as follows <asp:LinkButton ID="displayBtn" runat="server" OnClick="displayBtn_Click" Text="Display Content"></asp:LinkButton> I will hide this link button using style="dipsly:none;" and want to call the postback called by click of the asp link button using some other html element say a div. <div id="invokeTest"> Click here </div> I tried using $('#invokeTest').click(function(){ $('#<%=displayBtn.ClientID%>').click(); }); Any idea how could this be done?

    Read the article

  • i don't know how to work with command argument in asp.net

    - by Depozitul de Chestii
    hey, i'm tryng to pass a parameter with command argument with a link button but the result i get is always "". this is in my aspx page: <% LinkButton1.CommandArgument = "abcdef"; %> <asp:LinkButton ID="LinkButton1" runat="server" OnCommand= "LinkButton1_Click"> and in my aspx.cs i have: protected void LinkButton1_Click(object sender,CommandEventArgs ee) { String id = ee.CommandName.ToString(); } the id is always "" after i press the linkbutton. would appreciate if someone could help me. thanks

    Read the article

  • Update database in asp.net not working

    - by Badescu Alexandru
    Hello ! i have in asp.net a few textboxes and i wish to update my database with the values that they encapsulate . The problem is that it doesn't work and although it doesn't work, the syntax seems correct and there are no errors present . Here is my linkbutton : <asp:linkbutton id="clickOnSave" runat="server" onclick="Save_Click" Text="Save Profile" /> and my update function protected void Save_Click(object sender, EventArgs e) { SqlConnection con = new System.Data.SqlClient.SqlConnection(); con.ConnectionString = "DataSource=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\\alex\\Documents\\seeubook_db.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"; con.Open(); String commandString = "UPDATE users SET last_name='" + Text4.Text.Trim() + "' , first_name='" + Textbox1.Text.Trim() + "' , about_me='" + Textbox5.Text.Trim() + "' , where_i_live='" + Textbox2.Text.Trim() + "' , where_i_was_born='" + Textbox3.Text.Trim() + "' , work_place='" + Textbox4.Text.Trim() + "' WHERE email='" + Session["user"] + "'"; SqlCommand sqlCmd = new SqlCommand(commandString, con); sqlCmd.ExecuteNonQuery(); con.Close(); }

    Read the article

  • How to solve this issue in a URL?

    - by Ayyappan.Anbalagan
    I am working on a billing project. I am passing the invoice number to another aspx page using a query parameter; i.e. /default.aspx?editid=5 is the URL. If I change the editid to 4, then the records also changes. How to solve this issue? Page 1 LinkButton InvoiceEdit = sender as LinkButton; string EditId = InvoiceEdit.CommandArgument.ToString(); Response.Redirect("edit invoice.aspx?EditId=" + EditId); Page 2 String invoiceId = Request.QueryString["InvoiceId"].ToString();

    Read the article

  • Hilighting div tag in Masterpage on redirection to content page

    - by user1713632
    I have a link in Master page within a div tag. I want to highlight the div when I am clicking the link, in order to redirect to some content page. I have written the following code: <li> <div id="div_test" runat="server"> <asp:LinkButton ID="lnk_test_menu" Font-Underline="false" ForeColor="Black" runat="server" Text="Test Link" CausesValidation="false" onclick="lnk_test_menu_Click1" > </asp:LinkButton></div> </li> Code in the cs page: protected void lnk_test_menu_Click1(object sender, EventArgs e) { div_test.Attributes.Add("class", "testSelected"); Response.Redirect(Test.aspx"); } The div in the master page is not being selected on redirection. Could anybody help me on this?

    Read the article

  • LinkButtons Created Dynamically in a Repeater Don't Fire ItemCommand Event

    - by 5arx
    Hi. I've got a repeater that's used to display the output of a dynamic report that takes criteria from webcontrols on the page. Within the repeater's ItemDataBound method I'm adding controls (Linkbuttons for sorting by column values) dynamically to the header of the repeater based on values selected in a checkbox list and at this point setting the CommandArgument and CommandName properties of the linkbuttons. The issue is that when the linkbuttons are clicked they don't fire the ItemCommand event although they are clearly being correctly created and added to the header (there is some additional code to set the cssClass, text etc. and this works as expected.) The first column header in the repeater is set in the markup and the itemcommand event fires correctly on this one only. When the other column headers are clicked the repeater rebinds as programmed, but the columns are not dynamically re-generated. I would really appreciate somebody explaining what I'm doing wrong - afaik I'm following the approved way of doing this :-( Simplified code follows: Nightmare.ascx <asp:repeater runat="server" id="rptReport" OnItemDataBound="rptResults_ItemDataBound" OnItemCommand="rptResults_ItemCommand" EnableViewState="true"> <headertemplate> <table> <tr runat="Server" id="TRDynamicHeader"> <th> <!-- This one works --> <asp:Linkbutton runat="server" CommandName="sort" commandArgument='<%# Eval("Name")%?' /> </th> <!-- additional header cells get added dynamically here --> </tr> </headertemplate> <itemTemplate> <td><%# Eval("Name")</td> ... </itemTemplate> </asp:repeater> Nightmare.ascx.cs protected void PageLoad(object sender, eventArgs e){ if (! isPostback){ setupGui();//just binds dropdowns etc. to datasources } } protected void btnRunReport_Click(...){ List<ReportLines> lstRep = GetReportLines(); rptReport.DataSource = lstRep; repReport.DataBind(); } protected void rptReport_ItemDataBound (...){ if (e.Item.ItemType == ListItemType.Header) { foreach (ListItem li in chbxListBusFuncs.Items) { if (li.Selected) { th = new HtmlTableCell(); lb = new LinkButton(); lb.CssClass = "SortColHeader"; lb.CommandArgument = li.Text.Replace(" ", ""); lb.CommandName = "sort"; lb.Text = li.Text; th.Controls.Add(lb); ((HtmlTableRow)e.Item.FindControl("TRDynamicHeader")).Cells.Add(th); } } } if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { //Row level customisations, totals calculations etc. } } <!-- this only gets called when the 'hardcoded' linkbutton in the markup is clicked. protected void rptReport_ItemCommand(object sender, Eventargs e){ lblDebug.Text = string.Format("Well? What's Happening? -> {0}:{1}", e.CommandName, e.CommandArgument.ToString()); } (The only thing that can call the runreport routine is a single button on the page, not shown in the code snippet above.)

    Read the article

  • ASP.NET 4.0 UpdatePanel and UserControl with PlaceHolder

    - by Chris
    I don't know if this is ASP.NET 4.0 specific but I don't recall having this problem in previous versions. I have very simple user control called "TestModal" that contains a PlaceHolder control which I use to instantiate a template in. When I put an UpdatePanel inside this UserControl on the page the updatepanel only does full postbacks and not partial postbacks. What gives? USER CONTROL MARKUP: <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestModal.ascx.cs" Inherits="MyProject.UserControls.TestModal" %> <div id="<%= this.ClientID %>"> <asp:PlaceHolder ID="plchContentTemplate" runat="server"></asp:PlaceHolder> </div> USER CONTROL CODE BEHIND: public partial class TestModal : System.Web.UI.UserControl { private ITemplate _contentTemplate; [TemplateInstance(TemplateInstance.Single)] [PersistenceMode(PersistenceMode.InnerProperty), TemplateContainer(typeof(TemplateControl))] public ITemplate ContentTemplate { get { return _contentTemplate; } set { _contentTemplate = value; } } protected override void OnInit(EventArgs e) { base.OnInit(e); if (_contentTemplate != null) _contentTemplate.InstantiateIn(plchContentTemplate); } } ASPX PAGE MARKUP: <ajaxToolkit:ToolkitScriptManager ID="scriptManager" EnablePartialRendering="true" AllowCustomErrorsRedirect="true" CombineScripts="true" EnablePageMethods="true" ScriptMode="Release" AsyncPostBackTimeout="180" runat="server"></ajaxToolkit:ToolkitScriptManager> <uc1:TestModal ID="testModal" ClientIDMode="Static" runat="server"> <ContentTemplate> <asp:UpdatePanel ID="upAttachments" UpdateMode="Conditional" ChildrenAsTriggers="true" runat="server"> <ContentTemplate> <asp:LinkButton ID="lnkRemoveAttachment" runat="server"><img src="/images/icons/trashcan.png" style="border: none;" /></asp:LinkButton> </ContentTemplate> </asp:UpdatePanel> </ContentTemplate> </uc1:TestModal>

    Read the article

  • __doPostBack is not working in firefox

    - by Dan Williams
    The __doPostBack is not working in firefox 3 (have not checked 2). Everything is working great in IE 6&7 and it even works in Chrome?? It's a simple asp:LinkButton with an OnClick event <asp:LinkButton ID="DeleteAllPicturesLinkButton" Enabled="False" OnClientClick="javascript:return confirm('Are you sure you want to delete all pictures? \n This action cannot be undone.');" OnClick="DeletePictureLinkButton_Click" CommandName="DeleteAll" CssClass="button" runat="server"> The javascript confirm is firing so I know the javascript is working, it's specirically the __doPostBack event. There is a lot more going on on the page, just didn't know if it's work it to post the entire page. I enable the control on the page load event. Any ideas? I hope this is the correct way to do this, but I found the answer. I figured I'd put it up here rather then in a stackoverflow "answer" Seems it had something to do with nesting ajax toolkit UpdatePanel. When I removed the top level panel it was fixed. Hope this helps if anyone else has the same problem. I still don't know what specifically was causing the problem, but that was the solution for me.

    Read the article

  • How to Choose Fields While Using ExportToExcel in jqGrid ?

    - by João Guilherme
    Hi ! I have this jqGrid <trirand:JQGrid runat="server" ID="JQGrid1" OnRowEditing="JQGrid1_RowEditing" RenderingMode="Optimized" oncellbinding="JQGrid1_CellBinding" Height="350" EditUrl="/Ferramenta/Transacoes/TransacoesT.aspx"> <AppearanceSettings HighlightRowsOnHover="true"/> <Columns> <trirand:JQGridColumn DataField="IdLancamento" PrimaryKey="True" Visible="false" /> <trirand:JQGridColumn DataField="IdCategoria" Visible="false" /> <trirand:JQGridColumn DataField="DataLancamento" Editable="true" DataFormatString="{0:dd/MM/yy}" HeaderText="Data" Width="65" TextAlign="Center" CssClass="font_data" /> <trirand:JQGridColumn DataField="Descricao" Editable="true" HeaderText="Descrição" Width="330" /> <trirand:JQGridColumn DataField="NomeCategoria" Editable="true" EditType="DropDown" EditorControlID="ddlCategorias" HeaderText="Categoria"> <Formatter> <trirand:CustomFormatter FormatFunction="DefineUrl" /> </Formatter> </trirand:JQGridColumn> <trirand:JQGridColumn DataField="Valor" Editable="false" DataFormatString="{0:C}" HeaderText="Valor" Width="80" TextAlign="Center" /> </Columns> <ClientSideEvents RowSelect="editRow" /> <PagerSettings PageSize="20" /> <ToolBarSettings ShowEditButton="false" ShowRefreshButton="True" ShowAddButton="false" ShowDeleteButton="false" ShowSearchButton="false" /> <SortSettings InitialSortColumn=""></SortSettings> </trirand:JQGrid> <asp:LinkButton ID="lbExportar" runat="server" onclick="lbExportar_Click">Exportar todas as transações</asp:LinkButton> When I use the method ExportToExcel JQGrid1.ExportToExcel("export.xls"); it includes the first column IdLancamento that is not visible and also includes another column that is used on the query. Is it possible to choose the columns that are going to be exported ?

    Read the article

  • Nesting gridview/formview in webuser control inside a parent gridview

    - by Stuart
    Hi, I'm developing an ASP.net 2 website for our HR department, where the front page has a matrix of all our departments against pay grades, with links in each cell to all the jobs for that department for that grade. These links take you a page with a gridview populated dynamically, as each department has a different number of teams, e.g. Finance has one team, IT has four. Each cell has a webuser control inserted into it. The user control has a sql datasource, pulling out all the job titles and the primary key, popuating a formview, with a linkbutton whose text value is bound to the job title. (I'm using a usercontrol as this page will also be used to show the results of a search of all roles in a range of grades for a department, and will have a varying number of rows). I've got everything to display nicely, but when I click on the linkbutton, instead of running the code I've put in the Click event, the page posts back without firing any events. Having looked around, it looks like I have to put an addhandler line in somewhere, but I'm not sure where, could anyone give me some pointers please? (fairly numpty please, I'm not too experience in ASP yet and am winging it. I'm also using VB but C# isn't a problem) This is how I'm inserting the controls into the parent grid, have I missed anything obvious? For row As Int16 = 0 To dgvRoleGrid.Rows.Count - 1 tempwuc = New UserControl tempwuc = LoadControl("wucRoleList.ascx") tempwuc.ID = "wucRoleList" & col.ToString tempwuc.EnableViewState = True dgvRoleGrid.Rows(row).Cells(col).Controls.Add(tempwuc) CType(dgvRoleGrid.Rows(row).FindControl(tempwuc.ID), wucRoleList).specialtyid = specid CType(dgvRoleGrid.Rows(row).FindControl(tempwuc.ID), wucRoleList).bandid = dgvRoleGrid.DataKeys(row)(0) CType(dgvRoleGrid.Rows(row).FindControl(tempwuc.ID), wucRoleList).familyid = Session("familyid") Next

    Read the article

  • animation extender in datalist control in asp.net 2008

    - by BibiBuBu
    Good Day! i have a question that how can i use animation extender in datalist control in asp.net with c#. i want the animation when i click the delete button (delete button will be in repeater). so that when i remove one record then it shows animation to bring the next record. it is in update panel. <cc1:AnimationExtender ID="AnimationExtender1" runat="server" Enabled="True" TargetControlID="btnDeleteId"> <Animations> <OnClick> <Sequence> <EnableAction Enabled="false" /> <Parallel Duration=".2"> <Resize Height="0" Width="0" Unit="px" /> <FadeOut /> </Parallel> <HideAction /> </Sequence> </OnClick> </Animations> </cc1:AnimationExtender> now if i put my button id in the Target control id then it gives error that it should not be in same update panel etc... but over all nothing working for animation. i am binding my datalist in itemDataBound....e.g. ImageButton imgbtn = (ImageButton)e.Item.FindControl("imgBtnPic"); Label lblAvatar = (Label)e.Item.FindControl("lblAvatar"); LinkButton lbName = (LinkButton)e.Item.FindControl("lbtnName"); Can somebody please suggest me something. thanks

    Read the article

  • Flex: Double click event propagation on datagrid dependent on component order?

    - by MyMacAndMe
    I'd like to have a double click event on a datagrid in Flex3. The following example only works if the Accordion (id = "mustBeSecond") container comes after the DataGrid. Why is the order of the components important and what can I do to prevent this behavior? (The example does not work. If you change the order of "mustBeSecond" and "gridReportConversions" the example works fine) <mx:Script> <![CDATA[ import mx.controls.Alert; import mx.collections.ArrayCollection; [Bindable] private var dp:ArrayCollection = new ArrayCollection([ {qty:1,referer:'http://google.com'}, {qty:25,referer:'http://cnn.com'}, {qty:4,referer:'http:stackoverflow.com'}]); private function refererRowDoubleClicked(e:Event):void { Alert.show("double click"); } ]]> </mx:Script> <mx:HBox width="100%" height="100%"> <mx:Accordion width="200" height="200" id="mustBeSecond"> <mx:Canvas label="Navigation Box" width="100%" height="100%"> <mx:VBox> <mx:LinkButton label="First Link" /> <mx:LinkButton label="Second Link" /> </mx:VBox> </mx:Canvas> </mx:Accordion> <mx:DataGrid id="gridReportConversions" height="100%" width="100%" dataProvider="{this.dp}" mouseEnabled="true" doubleClickEnabled="true" itemDoubleClick="refererRowDoubleClicked(event)"> <mx:columns> <mx:DataGridColumn width="75" dataField="qty" headerText="Qty" /> <mx:DataGridColumn dataField="referer" headerText="URL" /> </mx:columns> </mx:DataGrid> </mx:HBox>

    Read the article

  • asp.net updatepanel inside hidden panel possible bug

    - by MakkyNZ
    Hi The javascript generated by the asp.net SciptManager control seems to have a bug and cant handle hidden UpdatePanels. A javascript error is thrown when a control within one updated panel tries to make another update panel visible. Is this a bug with ASP.Net ajax? And does anyone have any ideas how to get around this? heres is an example of when im trying to to <script type="text/C#" runat="server"> protected void LinkButton1_Click(object sender, EventArgs e) { Panel1.Visible = true; } </script> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click" Text="Show Panel"></asp:LinkButton> </ContentTemplate> </asp:UpdatePanel> <asp:Panel ID="Panel1" runat="server" Visible="false"> <asp:UpdatePanel ID="UpdatePanel2" runat="server"> <ContentTemplate> blah bla blah </ContentTemplate> </asp:UpdatePanel> </asp:Panel> this is the javascript error that gets thrown when clicking on the "LinkButton1" link. This error comes from the javascript that is generated by the asp.net ScriptManager control Error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_ContentPlaceHolder1_UpdatePanel2'

    Read the article

  • Why user control with code behind file doesn't want to compile under MVC2?

    - by kyrisu
    I have user control in my MVC2 app placed in the Content folder (it's not supposed to be a view, just reusable part of the app). UserControl1.ascx looks like: <@ Control AutoEventWireup="true" Language="C#" CodeFile="~/Content/UserControl1.ascx.cs" Inherits="MVCDrill.Content.UserControl1" %> <div runat="server" id="mydiv"> <asp:LinkButton id="lb_text" runat="server"></asp:LinkButton> </div> UserControl1.ascx.cs looks like: using System; using System.Web; using System.Web.UI; namespace MVCDrill.Content { public class UserControl1 : UserControl { public string Text { get { return this.lb_text.Text; } set { this.lb_text.Text = value; } } } } I'm pretty sure this kind of stuff compiled under webforms but I'm getting compilation error: 'MVCDrill.Content.UserControl1' does not contain a definition for 'lb_text' and no extension method 'lb_text' accepting a first argument of type 'MVCDrill.Content.UserControl1' could be found (are you missing a using directive or an assembly reference?) Am I missing something? How to change it (what is the alternative) in MVC2 ? p.s. Intellisense sees lb_text with no problem. I've tried with different controls with the same outcome.

    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

  • Problem in Adding Button in Dynamically created Gridview with Auto Generated Columns True

    - by Anuj Koundal
    Hi Guys I am using Gridview with auto columns true to Display data, I am using Dataset to bind Grid as Dataset gives me Crosstab/Pivot data on Dropdown's slected Index changed Here is the code I am using protected void ddl_SelectedIndexChanged(object sender, EventArgs e) { fillGridview(Convert.ToInt32(ddl.SelectedValue)); bindHeader(); } //===================//Bind GridColumns //================= void bindHeader() { GridViewRow headerRow; headerRow = gridDashboard.HeaderRow; foreach (GridViewRow grdRow in gridDashboard.Rows) { int count = grdRow.Cells.Count; int siteId=Convert.ToInt32(grdRow.Cells[4].Text); for (int j = 0; j < count; j++) { if (j >= 5) { int id=Convert.ToInt32(grdRow.Cells[j].Text); string headText =headerRow.Cells[j].Text.ToString(); string[] txtArray=headText.Split('-'); int stepId=Convert.ToInt32(txtArray[0]); //headerRow.Cells[j].Text = txtArray[1].ToString(); string HeadName = txtArray[1].ToString(); LinkButton lb = new LinkButton(); lb.Style.Add("text-decoration","none"); if (id > 0) { string Details = getDashBoardSiteStepDetails(id); lb.Text = Details; } else { lb.Text = " - "; } lb.CommandName = "HideColumn"; lb.CommandArgument = siteId.ToString() + "/" + stepId.ToString(); grdRow.Cells[j].Controls.Add(lb); } } } int cnt = headerRow.Cells.Count; for (int j = 0; j { if (j >= 5) { string hdText = headerRow.Cells[j].Text.ToString(); string[] txtArray = hdText.Split('-'); // int stepId = Convert.ToInt32(txtArray[0]); headerRow.Cells[j].Text = txtArray[1].ToString(); } } In above code I am trying to add button dynamically in each cell and button in text have text of that cell, IT works Great but when I click the link button created, link buttons Disappear and the original text of the cell Displays. please help I also want to create onclick of these link buttons Thanks

    Read the article

  • window.location.href not working in Safari when using onkeypress

    - by insanepaul
    I'm using an asp textbox and a search button. In Safari if I click the search button i get redirected to the search results page using javascript window.location.href. But strangely the same javascript will not redirect to the page if I press return in the textbox. Using the alert function I can see that window.location.href has the the correct url and the location bar at the top changes from the search page(default.aspx) to the search results url however when I click OK to the alert box the url at the top reverts back to the default.aspx page. It works on ie7/8/firefox/chrome but not safari. Here is my javascript,cs and aspx code: function submitSearchOnEnter(e) { var CodeForEnter = 13; var codeEnteredByUser; if (!e) var e = window.event; if (e.keyCode) codeEnteredByUser = e.keyCode; else if (e.which) codeEnteredByUser = e.which; if (codeEnteredByUser == CodeForEnter) RedirectToSearchPage(); } function RedirectToSearchPage() { var searchText = $get('<%=txtHeaderSearch.ClientID%>').value if (searchText.length) { window.location.href = "Search.aspx?searchString=" + searchText; } } protected void Page_Load(object sender, EventArgs e) { txtHeaderSearch.Attributes.Add("onkeypress", "submitSearchOnEnter(event)"); } <asp:Panel ID="pnlSearch" runat="server" DefaultButton="lnkSearch"> <asp:TextBox ID="txtHeaderSearch" runat="server" CssClass="searchBox"></asp:TextBox> <asp:LinkButton ID="lnkSearch" OnClientClick="RedirectToSearchPage(); return false;" CausesValidation="false" runat="server" CssClass="searchButton"> SEARCH </asp:LinkButton> </asp:Panel> I've tried return false; which doesn't allow me to enter any characters in the search box. I've spent ages online trying to find a solution. Maybe it has something to do with setTimeout or setTimeInterval but it didn't work unless i did it wrong.

    Read the article

  • How can I format the text in a databound TextBox?

    - by Abe Miessler
    I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=""> <td> <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update" Text="Update" /> <asp:LinkButton ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" /> </td> <td> <asp:TextBox ID="FundingSource1TextBox" runat="server" Text='<%# Bind("FundingSource1") %>' /> </td> <td> <asp:TextBox ID="CashTextBox" runat="server" Text='<%# Bind("Cash") %>' /> </td> <td> <asp:TextBox ID="InKindTextBox" runat="server" Text='<%# Bind("InKind") %>' /> </td> <td> <asp:TextBox ID="StatusTextBox" runat="server" Text='<%# Bind("Status") %>' /> </td> <td> <asp:TextBox ID="ExpectedAwardDateTextBox" runat="server" Text='<%# Bind("ExpectedAwardDate","{0:MM/dd/yyyy}) %>' onclientclick="datepicker()" /> </td> </tr> </EditItemTemplate> I would like to format the "ExpectedAwardDateTextBox" so it shows a short date time but haven't found a way to do this without going into the code behind. In the Item template I have the following line to format the date that appears in the lable: <asp:Label ID="ExpectedAwardDateLabel" runat="server" Text='<%# String.Format("{0:M/d/yyyy}",Eval("ExpectedAwardDate")) %>' /> And I would like to find a similar method to do with the insertItemTemplate.

    Read the article

  • How can I force a jQuery faded-in user control to remain after click events?

    - by David
    I have a basic page to which I'm adding an uploader control based on Bulk Uploader at c-sharpcorner.com and the control is in a jQuery-faded div based on yesdegisn The Bulk Uploader has two server side event handlers for two buttons--Add and Remove. After clicking these buttons, the fade disappears and you're back to the basic page--if the user needs to add more files, this is not desirable. The ArrayList of files added to a ListBox is maintained, but I have to click the "fade-in" link (LinkButton id="lnkDocumentUpload") to display this window again. I also need the control to POST to UploadPost.aspx, and it doesn't work either. Clicking the upload button(<asp:Button ID="btnUpload" runat="server" />) has the same behavior described above--fade disappears, data is retained, and no POST. I've surrounded the control with <form id="frmUpload" action="~/UploadPost.aspx"> ... <asp:Button ID="btnUpload" runat="server" Text="Upload"/> </form> A LinkButton activates the fade in jQuery via $("#lnkDocumentUpload").click(function() { centerPopup(); loadPopup(); });

    Read the article

  • Will this class cause memory leaks, and does it need a dispose method? (asp.net vb)

    - by Phil
    Here is the class to export a gridview to an excel sheet: Imports System Imports System.Data Imports System.Configuration Imports System.IO Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Namespace ExcelExport Public NotInheritable Class GVExportUtil Private Sub New() End Sub Public Shared Sub Export(ByVal fileName As String, ByVal gv As GridView) HttpContext.Current.Response.Clear() HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileName)) HttpContext.Current.Response.ContentType = "application/ms-excel" Dim sw As StringWriter = New StringWriter Dim htw As HtmlTextWriter = New HtmlTextWriter(sw) Dim table As Table = New Table table.GridLines = GridLines.Vertical If (Not (gv.HeaderRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.HeaderRow) table.Rows.Add(gv.HeaderRow) End If For Each row As GridViewRow In gv.Rows GVExportUtil.PrepareControlForExport(row) table.Rows.Add(row) Next If (Not (gv.FooterRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.FooterRow) table.Rows.Add(gv.FooterRow) End If table.RenderControl(htw) HttpContext.Current.Response.Write(sw.ToString) HttpContext.Current.Response.End() End Sub Private Shared Sub PrepareControlForExport(ByVal control As Control) Dim i As Integer = 0 Do While (i < control.Controls.Count) Dim current As Control = control.Controls(i) If (TypeOf current Is LinkButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, LinkButton).Text)) ElseIf (TypeOf current Is ImageButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, ImageButton).AlternateText)) ElseIf (TypeOf current Is HyperLink) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, HyperLink).Text)) ElseIf (TypeOf current Is DropDownList) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, DropDownList).SelectedItem.Text)) ElseIf (TypeOf current Is CheckBox) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, CheckBox).Checked)) End If If current.HasControls Then GVExportUtil.PrepareControlForExport(current) End If i = (i + 1) Loop End Sub End Class End Namespace Will this class cause memory leaks? And does anything here need to be disposed of? The code is working but I am getting frequent crashes of the app pool when it is in use. Thanks.

    Read the article

  • Will this class cause memory leaks, and does anything need disposing of? (asp.net vb)

    - by Phil
    Here is the class to export a gridview to an excel sheet: Imports System Imports System.Data Imports System.Configuration Imports System.IO Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Namespace ExcelExport Public NotInheritable Class GVExportUtil Private Sub New() End Sub Public Shared Sub Export(ByVal fileName As String, ByVal gv As GridView) HttpContext.Current.Response.Clear() HttpContext.Current.Response.AddHeader("content-disposition", String.Format("attachment; filename={0}", fileName)) HttpContext.Current.Response.ContentType = "application/ms-excel" Dim sw As StringWriter = New StringWriter Dim htw As HtmlTextWriter = New HtmlTextWriter(sw) Dim table As Table = New Table table.GridLines = GridLines.Vertical If (Not (gv.HeaderRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.HeaderRow) table.Rows.Add(gv.HeaderRow) End If For Each row As GridViewRow In gv.Rows GVExportUtil.PrepareControlForExport(row) table.Rows.Add(row) Next If (Not (gv.FooterRow) Is Nothing) Then GVExportUtil.PrepareControlForExport(gv.FooterRow) table.Rows.Add(gv.FooterRow) End If table.RenderControl(htw) HttpContext.Current.Response.Write(sw.ToString) HttpContext.Current.Response.End() End Sub Private Shared Sub PrepareControlForExport(ByVal control As Control) Dim i As Integer = 0 Do While (i < control.Controls.Count) Dim current As Control = control.Controls(i) If (TypeOf current Is LinkButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, LinkButton).Text)) ElseIf (TypeOf current Is ImageButton) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, ImageButton).AlternateText)) ElseIf (TypeOf current Is HyperLink) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, HyperLink).Text)) ElseIf (TypeOf current Is DropDownList) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, DropDownList).SelectedItem.Text)) ElseIf (TypeOf current Is CheckBox) Then control.Controls.Remove(current) control.Controls.AddAt(i, New LiteralControl(CType(current, CheckBox).Checked)) End If If current.HasControls Then GVExportUtil.PrepareControlForExport(current) End If i = (i + 1) Loop End Sub End Class End Namespace Will this class cause memory leaks? And does anything here need to be disposed of? The code is working but I am getting the app pool falling over frequently when it is in use. Thanks.

    Read the article

  • Concerned with footerrow in gridview

    - by ramyatk06
    hi guys, I have following gridview. <asp:GridView ID="gvMarks" runat="server" AutoGenerateColumns="false" DataKeyNames="MarkId" Width="80%" onrowdatabound="gvMarks_RowDataBound" ShowFooter="True" onrowcommand="gvMarks_RowCommand"> <Columns> <asp:TemplateField> <HeaderTemplate> SubjectCode </HeaderTemplate> <FooterTemplate> <asp:DropDownList ID="dlSubjectCode" runat="server" width="100px" AutoPostBack="false"></asp:DropDownList> </FooterTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Mark </HeaderTemplate> <FooterTemplate> <asp:TextBox ID="txtInternalMark" runat="server" ></asp:TextBox> </FooterTemplate> </asp:TemplateField> <asp:TemplateField> <HeaderTemplate> Insert </HeaderTemplate> <FooterTemplate> <asp:LinkButton ID="lnkInsert" runat="server" Text="Insert" CommandName="Insert" ></asp:LinkButton> </FooterTemplate> </asp:TemplateField> </Columns> <FooterStyle BackColor="White" ForeColor="#000066" /> <RowStyle ForeColor="#000066" /> <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" /> <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" /> <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" /> </asp:GridView> If i enter some value in txtInternalMark,iam not geting its value in code behind.Iam geting the value as "".Iam using following code if (e.CommandName.Equals("Insert")) { TextBox txtInternalMark = (TextBox)gvMarks.FooterRow.FindControl("txtInternalMark"); lblMessage.Text = txtInternalMark .Text; } Can anybody help to get the value of textbox in codebehind.

    Read the article

  • ASP.NET GridView "Client-Side Confirmation when Deleting" stopped working on ie - how come?

    - by tarnold
    A few months ago, I have programmed an ASP.NET GridView with a custom "Delete" LinkButton and Client-Side JavaScript Confirmation according to this msdn article: http://msdn.microsoft.com/en-us/library/bb428868.aspx (published in April 2007) or e.g. http://stackoverflow.com/questions/218733/javascript-before-aspbuttonfield-click The code looks like this: <ItemTemplate> <asp:LinkButton ID="deleteLinkButton" runat="server" Text="Delete" OnCommand="deleteLinkButtonButton_Command" CommandName='<%# Eval("id") %>' OnClientClick='<%# Eval("id", "return confirm(\"Delete Id {0}?\")") %>' /> </ItemTemplate> Surprisingly, "Cancel" doesn't work no more with my ie (Version: 6.0.2900.2180.xpsp_sp2_qfe.080814-1242) - it always deletes the row. With Opera (Version 9.62) it still works as expeced and described in the msdn article. More surprisingly, on a fellow worker's machine with the same ie version, it still works ("Cancel" will not delete the row). The generated code looks like <a onclick="return confirm(...);" href="javascript:__doPostBack('...')"> As confirm(...) returns false on "Cancel", I expect the __doPostBack event in the href not to be fired. Are there any strange ie settings I accidentally might have changed? What else could be the cause of this weird behaviour? Or is this a "please reinstall WinXP" issue?

    Read the article

  • page variable in a repeater

    - by carrot_programmer_3
    Hi I'm having a bit of an issue with a asp.net repeater I'm building a categories carousel with the dynamic categories being output by a repeater. Each item is a LinkButton control that passes an argument of the category id to the onItemClick handler. a page variable is set by this handler to track what the selected category id is.... public String SelectedID { get { object o = this.ViewState["_SelectedID"]; if (o == null) return "-1"; else return (String)o; } set { this.ViewState["_SelectedID"] = value; } } problem is that i cant seem to read this value while iterating through the repeater as follows... <asp:Repeater ID="categoriesCarouselRepeater" runat="server" onitemcommand="categoriesCarouselRepeater_ItemCommand"> <ItemTemplate> <%#Convert.ToInt32(Eval("CategoryID")) == Convert.ToInt32(SelectedID) ? "<div class=\"selectedcategory\">":"<div>"%> <asp:LinkButton ID="LinkButton1" CommandName="select_category" CommandArgument='<%#Eval("CategoryID")%>' runat="server"><img src="<%#Eval("imageSource")%>" alt="category" /><br /> </div> </ItemTemplate> </asp:Repeater> calling <%=SelectedID%> in the item template works but when i try the following expression the value of SelectedID returns empty.. <%#Convert.ToInt32(Eval("CategoryID")) == Convert.ToInt32(SelectedID) ? "match" : "not a match"%> the value is being set as follows... protected void categoriesCarouselRepeater_ItemCommand(object source, RepeaterCommandEventArgs e) { SelectedID = e.CommandArgument); } Any ideas whats wrong here?

    Read the article

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