Search Results

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

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

  • AjaxControlToolkit DropDownExtender inside a table always displays associated panel

    - by Amanda Myer
    I have a textarea that has the ajaxcontroltoolkit dropdownextender associated with it, and a panel that contains a gridview with the options for the user to select from. Here is the code for these items: <asp:UpdatePanel ID="updPnlView" UpdateMode="Conditional" runat="server"> <ContentTemplate> <asp:TextBox ID="txtSiteName" runat="server" TextMode="MultiLine" Rows="4" Columns="33" ReadOnly="true" /></td> <ajaxToolkit:DropDownExtender runat="server" ID="popupdropdown" DropDownControlID="pnlGrid" TargetControlID="txtSiteName" /> <asp:Panel runat="server" ID="pnlGrid" Style="display: none; visibility: hidden" Height="300" ScrollBars="Vertical"> <asp:GridView ID="gvSite" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="ID,FullAddress" DataSourceID="odsSite" OnRowDataBound="gvSite_RowDataBound" ShowFooter="false" ShowHeader="false" OnSelectedIndexChanged="gvSite_SelectedIndexChanged" > <Columns> <asp:CommandField ButtonType="Link" SelectText="Select" ShowSelectButton="true" ItemStyle-CssClass="HiddenColumn" /> <asp:TemplateField > <ItemTemplate> <asp:Label ID="FullAddress" runat="server" Text='<%# Eval("FullAddress").ToString().Replace("\n", "<br/>") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:CheckBoxField DataField="DisabledFLG" ItemStyle-CssClass="HiddenColumn" /> </Columns> </asp:GridView> </asp:Panel> <asp:ObjectDataSource ID="odsSite" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetList" TypeName="SOM.DCO.MOGWAI.Bll.SiteManager" onselecting="odsSite_Selecting" SortParameterName="SortExpression" onselected="odsSite_Selected" > <SelectParameters> <asp:Parameter Name="myCriteria" Type="Object" /> <asp:Parameter Name="myIDs" Type="Object" /> <asp:Parameter Name="sortExpression" Type="String" /> <asp:Parameter Name="bypassCache" Type="Boolean" /> </SelectParameters> </asp:ObjectDataSource> </ContentTemplate> </asp:UpdatePanel> When I place this item inside a table (i.e. <table><tr><td>THE CODE ABOVE</td></tr></table>) the panel always shows completely open never hidden. It also completely fills out the available space within the TD and pushes all other text on the page down the screen. If I take the associated controls out of the table, it works as expected. I have duplicated this issue in both Firefox and IE8. What gives?

    Read the article

  • ASP.net Ajax tab container not appearing

    - by Eyla
    I created new web project using VS 2008 with enabled Ajax template with C# and Framework 3.5. I added Ajax reference to the project and I can see all Ajax toolkit in my tool box. The problem that when I add tab container with Tab Panels then run the projects nothing appear on the browser and I tried few browsers. I'm including my code and I wish that someone would help me. Regards, My Code: ................................................................ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Contacts._Default" %> <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <asp:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0"> <asp:TabPanel runat="server" HeaderText="TabPanel1" ID="TabPanel1"> <ContentTemplate> tab 1 </ContentTemplate> </asp:TabPanel> <asp:TabPanel runat="server" HeaderText="TabPanel2" ID="TabPanel2"> <ContentTemplate> tab 2 </ContentTemplate> </asp:TabPanel> <asp:TabPanel runat="server" HeaderText="TabPanel3" ID="TabPanel3"> <ContentTemplate> tab 3 </ContentTemplate> </asp:TabPanel> </asp:TabContainer> </div> </form> </body> </html>

    Read the article

  • how to display image in repeater after AJAX AsyncFileUpload ?

    - by Gordon Shamway
    Hello i am using the AsyncFileUpload from the ajaxtoolkit, upter the upload is complete , i want to display all the images that were uploaded (and their URL is inserted into the DB) with my repeater and binding method. but its not working! the images are uploaded, the DB insert works file, but i cant see the images after the repeater is dinded. (i have to mention that if i go step by step, i do see that the ITEMBOUND is being binded and executed) <ajax:TabContainer runat="server" ID="testTab"> <ajax:TabPanel runat="server" ID="testTabContainer"> <ContentTemplate> <ajax:AsyncFileUpload ID="uploadAsyncImage" runat="server" OnUploadedComplete="InsertToTemp" ThrobberID="Throbber"/> <asp:Label ID="Throbber" runat="server" Style="display: none"> <img src="Images/indicator.gif" align="absmiddle" alt="loading" /> </asp:Label> <br /> <asp:UpdatePanel runat="server" ID="pnlImages" UpdateMode="Conditional" ChildrenAsTriggers="true"> <ContentTemplate> <asp:Repeater runat="server" ID="rptImages" > <ItemTemplate> <a href="<%# DataBinder.Eval(Container.DataItem, "PicURL")%>" rel="lightbox"> <asp:Image ImageUrl='<%# DataBinder.Eval(Container.DataItem, "PicURL")%>' Width="50" Height="50" runat="server" ID="testPic" /> </a> </ItemTemplate> </asp:Repeater> </ContentTemplate> </asp:UpdatePanel> </ContentTemplate> </ajax:TabPanel> </ajax:TabContainer> </form> also adding my Code Behind, since it might be important or will help you get an idea of what i am trying to do.private void BindRepater() { ProjDataContext db = DbContext.DbContextProvider(); var pic = from p in db.TempProdCats where p.SessionID == Session.SessionID.ToString() select new { PicURL = p.PicURL }; rptImages.DataSource = pic; rptImages.DataBind(); pnlImages.Update(); } protected void rptImages_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Image lblCat = (Image)e.Item.FindControl("testPic"); lblCat.ImageUrl = (string)DataBinder.Eval(e.Item.DataItem, "PicURL"); pnlImages.Update(); } } your help will be highly appreciated , if any of you got any idea how to make it work...

    Read the article

  • My ASP.NET Accordion will not animate panel changes when triggered by check boxes.

    - by CowKingDeluxe
    My accordion panel in markup: <ajaxToolkit:Accordion ID="MyAccordion" runat="server" SelectedIndex="0" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected" ContentCssClass="accordionContent" AutoSize="None" FadeTransitions="true" TransitionDuration="250" FramesPerSecond="40" RequireOpenedPane="false" SuppressHeaderPostbacks="true"> <Panes> <ajaxToolkit:AccordionPane ID="AccordionPane10" runat="server"> <Header>BBBBBBBBBB</Header> <Content> FFFFFFFF:<br /><br /> <table cellpadding="0" cellspacing="0" width="750"><tr><td width="450" class="verificationtdleft"> <asp:Image ID="step4_originalimage" runat="server" AlternateText="" /> </td><td width="300"> <asp:CheckBox ID="CB_Verification0" runat="server" AutoPostBack="true" /> Verify </td></tr> </table> </Content> </ajaxToolkit:AccordionPane> <ajaxToolkit:AccordionPane ID="AccordionPane11" runat="server"> <Header>GGGGGGGGG</Header> <Content> HHHHHHHHHH:<br /><br /> <table cellpadding="0" cellspacing="0" width="750"><tr><td width="450" class="verificationtdleft"> <asp:Image ID="step4_image_thumbnail" runat="server" AlternateText="" /> </td><td width="300"> <asp:CheckBox ID="CB_Verification1" runat="server" AutoPostBack="true" /> Verify </td></tr> </table> </Content> </ajaxToolkit:AccordionPane> </Panes> Here's how I handle the checkbox check: Private Sub CB_Verification0_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CB_Verification0.CheckedChanged MyAccordion.SelectedIndex = 1 End Sub I'm causing the panels to change correctly, it's just that they don't animate like they do when I click the headers. When I click the checkbox to change the panel, the panel just disappears instantly and the new one appears instantly, but I want it to be animated as if I clicked the headers. Is there a way to cause the animation to happen when force changing the visible panel?

    Read the article

  • ContentPlaceHolders: Repeated Content

    - by brad
    Scenario I have an application using asp.net Master Pages in which I would like to repeat some content at the top and bottom of a page. Currently i use something like this: Master Page <html> <body> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> <!-- page content --> <asp:ContentPlaceHolder ID="Bar" runat="server"> </asp:ContentPlaceHolder> </body> </html> Content Page <asp:Content ID="Top" ContentPlaceHolderID="Foo" runat="server"> <!-- content --> </asp:Content> <asp:Content ID="Bottom" ContentPlaceHolderID="Bar" runat="server"> <!-- content repeated --> </asp:Content> Maintenance As you know, repeating things in code is usually not good. It creates maintenance problems. The following is what I would like to do but will obviously not work because of the repeated id attribute: Master Page <html> <body> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> <!-- page content --> <asp:ContentPlaceHolder ID="Foo" runat="server"> </asp:ContentPlaceHolder> </body> </html> Content Page <asp:Content ID="Top" ContentPlaceHolderID="Foo" runat="server"> <!-- content (no repetition) --> </asp:Content> Possible? Is there a way to do this using asp.net webforms? The solution does not necessarily have to resemble the above content, it just needs to work the same way. Notes I am using asp.net 3.0 in Visual Studio 2008

    Read the article

  • Enable PostBack for a ASP.NET User Control

    - by Steven
    When I click my "Query" the values for my user controls are reset. How do I enable PostBack for my user control? myDatePicker.ascx <%@ Control Language="vb" CodeBehind="myDatePicker.ascx.vb" Inherits="Website.myDate" AutoEventWireup="false" %> <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %> <asp:TextBox ID="DateTxt" runat="server" ReadOnly="True" /> <asp:Image ID="DateImg" runat="server" ImageUrl="~/Calendar_scheduleHS.png" EnableViewState="True" EnableTheming="True" /> <asp:CalendarExtender ID="DateTxt_CalendarExtender" runat="server" Enabled="True" TargetControlID="DateTxt" PopupButtonID="DateImg" DefaultView="Days" Format="ddd MMM dd, yyyy" EnableViewState="True"/> myDatePicker.ascx Partial Public Class myDate Inherits System.Web.UI.UserControl Public Property SelectedDate() As Date? Get Dim o As Object = ViewState("SelectedDate") If o = Nothing Then Return Nothing End If Return Date.Parse(o) End Get Set(ByVal value As Date?) ViewState("SelectedDate") = value End Set End Property End Class Default.aspx <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="Website._Default" EnableEventValidation="false" EnableViewState="true" %> <%@ Register TagPrefix="my" TagName="DatePicker" Src="~/myDatePicker.ascx" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> <%@ Register Assembly="..." Namespace="System.Web.UI.WebControls" TagPrefix="asp" %> <!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"> ... <body> <form id="form1" runat="server"> <div class="mainbox"> <div class="query"> Start Date<br /> <my:DatePicker ID="StartDate" runat="server" EnableViewState="True" /> End Date <br /> <my:DatePicker ID="EndDate" runat="server" EnableViewState="True" /> ... <div class="query_buttons"> <asp:Button ID="Button1" runat="server" Text="Query" /> </div> </div> <asp:GridView ID="GridView1" ... > </form> </body> </html> Default.aspx.vb Imports System.Web.Services Imports System.Web.Script.Services Imports AjaxControlToolkit Protected Sub Page_Load(ByVal sender As Object, _ ByVal e As EventArgs) Handles Me.Load End Sub Partial Public Class _Default Inherits System.Web.UI.Page Protected Sub Button1_Click(ByVal sender As Object, _ ByVal e As EventArgs) Handles Button1.Click GridView1.DataBind() End Sub End Class

    Read the article

  • ASP.NET-C#: Inserting const into TextBox in Gridview

    - by dash
    I have some problems inserting a const "1" into a textbox which is gridviw. the gridview code: <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" EnableViewState="False"> <Columns> <asp:BoundField DataField="Price" HeaderText="Price" ItemStyle-CssClass="price" > <ItemStyle CssClass="price"></ItemStyle> </asp:BoundField> <asp:TemplateField HeaderText="ProductID"> <ItemTemplate> <asp:Label ID="lblID" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="ProductName"> <ItemTemplate> <asp:Label ID="lblName" runat="server" Text='<%# Eval("ProductName") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Summary"> <ItemTemplate> <asp:Label ID="lblSum" runat="server" Text='<%# Eval("Summary") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="picPath"> <ItemTemplate> <asp:Label ID="lblPic" runat="server" Text='<%# Eval("picPath") %>' ></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText = "quantity"> <ItemTemplate> <asp:TextBox ID="lblquantity" runat="server" ></asp:TextBox> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText = "Total"> <ItemTemplate> <asp:Label ID="lblTotal" runat="server" ></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> All the information is populated from the session of the privious page, beside this textbox which doesnt comes from anywhere, its a quantity textbox which the user should enter. and i want it to have a defalt value of "1". I dont actually know how to insert into a textbox which is in the gridview. please help me. thanx

    Read the article

  • How can call a jQuery function when it is inside the formview (asp.net control)?

    - by ricky roy
    Hi, All I have a Span in side the Form view. I wanted to Call a Jquery Fucntion when the from load how can i do this? Thanks Waiting for your reply here is my code <asp:FormView ID="FormView1" runat="server" OnItemCommand="FormView1_ItemCommand"> <ItemTemplate> <asp:HiddenField ID="hidProductID" Value='<%#Eval("ProductID") %>' runat="server" /> <asp:HiddenField ID="hidCustomerID" Value='<%#Eval("CustomerID") %>' runat="server" /> <a href='<%=WinToSave.SettingsConstants.SiteURL%>WintoSave/AuctionProduct.aspx?id=<%#Eval("ProductID") %>'> <%#Eval("ProductName")%> </a> <br /> <img src='<%#Eval("ImagePath")%>' alt="Image No available" /> <br /> <asp:Label ID="lblTime" runat="server" Text='<%#Convert.ToDateTime(Eval("ModifiedOn")).ToString("hh:mm:ss") %>'></asp:Label> <span id='Countdown_<%#Eval("ProductID") %>' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%>','Countdown_<%#Eval("ProductID") %>');"></span> <br /> <asp:Label ID="lblFinalPrice" runat="server" Text='<%#Convert.ToDouble(Eval("FinalPrice")).ToString("#.00")%>'></asp:Label> <br /> <asp:Label ID="lblFullName" runat="server" Text='<%#Eval("FullName") %>'></asp:Label> <br /> <asp:Button ID="btnAddbid" Text="Bid" CommandName="AddBid" CommandArgument='<%#Eval("ID")%>' runat="server" /> </ItemTemplate> </asp:FormView> and following is my jquery code function GetTimeOnLoad(shortly,DivID) { var dt = new Date(shortly); alert(dt); alert(shortly); alert(DivID); var ProductDivID = "#" +DivID; alert(ProductDivID); $(ProductDivID).countdown({ until: dt, onExpiry: liftOff, onTick: watchCountdown, format: 'HMS', layout: '{hnn}{sep}{mnn}{sep}{snn}' }); } function liftOff(){}; function watchCountdown(){}; In above code I Used ' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%','Countdown_<%#Eval("ProductID") %');" but is not working

    Read the article

  • people picker control inside gridview template field with ajax update panel applied SharePoint 2010

    - by user1434450
    In my page I have drop down control, grid view. Inside the grid view in template field I have people picker control. When ever I change the drop down value from 'Select' to another I am displaying my grid view with people picker. Everything is working fine. But after applying 'update panel', whenever I change the drop down value, people picker control is not working inside the grid view. <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"> <ContentTemplate> <asp:GridView ID="gvDirectory" runat="server" AutoGenerateColumns="false" ShowHeader="false" onrowcommand="gvDirectory_RowCommand" onrowdeleting="gvDirectory_RowDeleting" onrowdatabound="gvDirectory_RowDataBound" BorderWidth="0"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="chkselect" runat="server" Width="20px" AutoPostBack="true" oncheckedchanged="chkselect_CheckedChanged"/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:HyperLink ID="lnkcategory" runat="server" Text='<%# Eval("Title") %>' Target="_blank" NavigateUrl='<%# Eval("URL") %>' Width="200px" onclick="ShowAwesomeHelloPageInDialog(this);return false;"></asp:HyperLink> <asp:Label ID="lblvalue" runat="server" Text='<%# Eval("value") %>' Visible="false"></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <SharePoint:PeopleEditor ID="Assignedusers" runat="server" AllowEmpty="false" MultiSelect="true" Width="250px" BorderColor="#559CD7" Height="20px" SelectionSet="User,SPGroup" Rows="2" PlaceButtonsUnderEntityEditor="false" EnableViewState="true" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Delete"> <ItemTemplate> <asp:ImageButton ID="btnDelete" runat="server" CommandArgument='<%# Container.DataItemIndex%>' ImageUrl="~/_layouts/images/EditTaskPage/Delete.png" CommandName="Delete" Text="Delete" Height="26px" Width="26px"/> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </ContentTemplate> <%--<Triggers> <asp:PostBackTrigger ControlID="ddlCategory" /> </Triggers>--%> </asp:UpdatePanel> <script type="text/javascript"> _spOriginalFormAction = document.forms[0].action; _spSuppressFormOnSubmitWrapper = true; </script> how can I solve this problem.. thanks in advance....

    Read the article

  • How to find the one Label in DataList that is set to True

    - by Doug
    In my .aspx page I have my DataList: <asp:DataList ID="DataList1" runat="server" DataKeyField="ProductSID" DataSourceID="SqlDataSource1" onitemcreated="DataList1_ItemCreated" RepeatColumns="3" RepeatDirection="Horizontal" Width="1112px"> <ItemTemplate> ProductSID: <asp:Label ID="ProductSIDLabel" runat="server" Text='<%# Eval("ProductSID") %>' /> <br /> ProductSKU: <asp:Label ID="ProductSKULabel" runat="server" Text='<%# Eval("ProductSKU") %>' /> <br /> ProductImage1: <asp:Label ID="ProductImage1Label" runat="server" Text='<%# Eval("ProductImage1") %>' /> <br /> ShowLive: <asp:Label ID="ShowLiveLabel" runat="server" Text='<%# Eval("ShowLive") %>' /> <br /> CollectionTypeID: <asp:Label ID="CollectionTypeIDLabel" runat="server" Text='<%# Eval("CollectionTypeID") %>' /> <br /> CollectionHomePage: <asp:Label ID="CollectionHomePageLabel" runat="server" Text='<%# Eval("CollectionHomePage") %>' /> <br /> <br /> </ItemTemplate> </asp:DataList> And in my code behind using the ItemCreated event to find and set the label.backcolor property. (Note:I'm using a recursive findControl class) protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e) { foreach (DataListItem item in DataList1.Items) { if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { Label itemLabel = form1.FindControlR("CollectionHomePageLabel") as Label; if (itemLabel !=null || itemLabel.Text == "True") { itemLabel.BackColor = System.Drawing.Color.Yellow; } } When I run the page, the itemLabel is found, and the color shows. But it sets the itemLabel color to the first instance of the itemLabel found in the DataList. Of all the itemLabels in the DataList, only one will have it's text = True - and that should be the label picking up the backcolor. Also: The itemLabel is picking up a column in the DB called "CollectionHomePage" which is True/False bit data type. I must be missing something simple... Thanks for your ideas.

    Read the article

  • How can call a JQuery function when it in side the from view (asp.net control)?

    - by ricky roy
    Hi, All I have a Span in side the Form view. I wanted to Call a Jquery Fucntion when the from load how can i do this? Thanks Waiting for your reply here is my code <asp:FormView ID="FormView1" runat="server" OnItemCommand="FormView1_ItemCommand"> <ItemTemplate> <asp:HiddenField ID="hidProductID" Value='<%#Eval("ProductID") %>' runat="server" /> <asp:HiddenField ID="hidCustomerID" Value='<%#Eval("CustomerID") %>' runat="server" /> <a href='<%=WinToSave.SettingsConstants.SiteURL%>WintoSave/AuctionProduct.aspx?id=<%#Eval("ProductID") %>'> <%#Eval("ProductName")%> </a> <br /> <img src='<%#Eval("ImagePath")%>' alt="Image No available" /> <br /> <asp:Label ID="lblTime" runat="server" Text='<%#Convert.ToDateTime(Eval("ModifiedOn")).ToString("hh:mm:ss") %>'></asp:Label> <span id='Countdown_<%#Eval("ProductID") %>' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%>','Countdown_<%#Eval("ProductID") %>');"></span> <br /> <asp:Label ID="lblFinalPrice" runat="server" Text='<%#Convert.ToDouble(Eval("FinalPrice")).ToString("#.00")%>'></asp:Label> <br /> <asp:Label ID="lblFullName" runat="server" Text='<%#Eval("FullName") %>'></asp:Label> <br /> <asp:Button ID="btnAddbid" Text="Bid" CommandName="AddBid" CommandArgument='<%#Eval("ID")%>' runat="server" /> </ItemTemplate> </asp:FormView> and following is my jquery code function GetTimeOnLoad(shortly,DivID) { var dt = new Date(shortly); alert(dt); alert(shortly); alert(DivID); var ProductDivID = "#" +DivID; alert(ProductDivID); $(ProductDivID).countdown({ until: dt, onExpiry: liftOff, onTick: watchCountdown, format: 'HMS', layout: '{hnn}{sep}{mnn}{sep}{snn}' }); } function liftOff(){}; function watchCountdown(){}; In above code I Used ' onload="GetTimeOnLoad('<%#Eval("ModifiedOn")%','Countdown_<%#Eval("ProductID") %');" but is not working

    Read the article

  • UpdatePanel Full Postback

    - by Korivo
    Greetings, here is the scenario. I have and .aspx page with and updatepanel like this <asp:UpdatePanel id="uPanelMain" runat="server"> <ContentTemplate> <uc:Calendar id="ucCalendar" runat="server" Visible="true" /> <uc:Scoring id="ucScoring" runat="server" Visible="false" /> </ContentTemplate> The control ucCalendar is loaded first and it contains a grid like this <asp:DataGrid CssClass="grid" ID="gridGames" runat="server" AutoGenerateColumns="False" HeaderStyle-CssClass="gridHeader" ItemStyle-CssClass="gridScoringRow" GridLines="None" ItemStyle-BackColor="#EEEEEE" AlternatingItemStyle-BackColor="#F5F5F5" OnEditCommand="doScoreGame" OnDeleteCommand="doEditGame" OnCancelCommand="printLineup" OnItemDataBound="gridDataBound"> <Columns> <asp:TemplateColumn > <ItemTemplate> <asp:CheckBox ID="chkDelete" runat="server" /> </ItemTemplate> </asp:TemplateColumn> <asp:BoundColumn DataField="idGame" Visible="false" /> <asp:BoundColumn DataField="isClose" Visible="false" /> <asp:TemplateColumn HeaderText="Status"> <ItemTemplate> <asp:Image ID="imgStatus" runat="server" ImageUrl="~/img/icoX.png" alt="icoStatus" /> </ItemTemplate> </asp:TemplateColumn> <asp:TemplateColumn> <ItemTemplate> <asp:LinkButton ID="linkScore" runat="server" CommandName="Edit" Text="Score" /> </ItemTemplate> </asp:TemplateColumn> </Columns> </asp:DataGrid> So when i click the "linkButton", the codebehind of the userControl calls a public method in the .aspx as this: From the userControl protected void doScoreGame(object sender, DataGridCommandEventArgs e) { ((GM)this.Page).showScoring(null, null); } From the .aspx page public void showScoring(object sender, EventArgs e) { removeLastLoadedControl(); ucScoring.Visible = true; } So, here comes the problem: There are two postbacks taking place when I change the visible attribute of the ucScoring control. The first postback is fine, it's handled by the updatePanel. The second postback is a full postback, and i really don't understand why it is happening. I'm really lost here, please help! Thanks Mat

    Read the article

  • C#: Label contains no text

    - by Vinzcent
    Hey I would like to get the text out of a label. But the label text is set with Javascript. On the page I can see that there is text in the label, but when I debug it shows this: "". So how do I get the text out of a label that is set with Javascript, at least that is what I think is the problem. My code: <asp:TextBox ID="txtCount" runat="server" Width="50px" Font-Names="Georgia, Arial, sans-Serif" ForeColor="#444444"></asp:TextBox> <ajaxToolkit:NumericUpDownExtender ID="NumericUpDownExtender1" runat="server" Minimum="1" TargetButtonDownID="btnDown" TargetButtonUpID="btnUp" TargetControlID="txtCount" Width="20" /> <asp:ImageButton ID="btnUp" runat="server" AlternateText="up" ImageUrl="Images/arrowUp.png" OnClientClick="setAmountUp()" ImageAlign="Top" CausesValidation="False" /> <asp:ImageButton ID="btnDown" runat="server" AlternateText="down" ImageUrl="Images/arrowDown.png" OnClientClick="setAmountDown()" ImageAlign="Bottom" CausesValidation="False" /> <asp:Label ID="lblKorting" runat="server" /> <asp:Label ID="lblAmount" runat="server" /> <asp:Button ID="btnBestel" runat="server" CssClass="btn" Text="Bestel" OnClick="btnBestel_Click1" /> JS function setAmountUp() { var aantal = document.getElementById('<%=txtCount.ClientID%>').value-0; aantal+=1; calculateAmount(aantal); } function setAmountDown() { var aantal = document.getElementById('<%=txtCount.ClientID%>').value-0; if(aantal > 1) aantal -=1; calculateAmount(aantal); } function calculateAmount(aantal) { var prijs = document.getElementById('<%=lblPriceBestel.ClientID%>').innerHTML -0; var totaal = 0; if(aantal < 2) { totaal = prijs * aantal; document.getElementById('<%=lblKorting.ClientID%>').innerHTML = ""; } else if(aantal >= 2 && aantal < 5) { totaal = (prijs * aantal)*0.95; document.getElementById('<%=lblKorting.ClientID%>').innerHTML = "-5%"; } else if(aantal >= 5) { totaal = (prijs * aantal)*0.90; document.getElementById('<%=lblKorting.ClientID%>').innerHTML = "-10%"; } document.getElementById('<%=lblAmount.ClientID%>').innerHTML = totaal; } C# private OrderBO bestelling; protected void btnBestel_Click1(object sender, EventArgs e) { bestelling = new OrderBO(); bestelling.Amount = Convert.ToInt32(lblAmount.Text); //<--- THIS IS "" in the debugger, but on the page 10 }

    Read the article

  • Strange behaviour on postback in ASP.NET

    - by C-King
    I'm working on a website with a login form. To log in, a postback is used to an OnClick handler in the codebehind. Somehow, the value returned from the Text-property of the username and password textboxes is ten times the value I entered, separated by commas. I checked my entire code for double ID's (which seems to be the most common problem causing this behaviour), but I found each ID defined only once. In the ASPX file I have this: <asp:Label ID="lblFeedback" ForeColor="Red" Font-Bold="true" runat="server" Visible="false" /><br /> <asp:Panel ID="pnlLogin" runat="server"> <table style="border-style: none;"> <tr> <td> <asp:Label ID="lblUsername" AssociatedControlID="txtUsername" runat="server" /> </td> <td> <asp:TextBox ID="txtUsername" runat="server" /><br /> </td> </tr> <tr> <td> <asp:Label ID="lblPassword" AssociatedControlID="txtPassword" runat="server" /> </td> <td> <asp:TextBox ID="txtPassword" runat="server" TextMode="password" /><br /> </td> </tr> <tr> <td> </td> <td> <asp:Button ID="btnLogin" OnClick="btnLogin_Click" runat="server" /> </td> </tr> </table> </asp:Panel> The OnClick handler in the Codebehind: protected void btnLogin_Click(object sender, EventArgs e) { string username = Util.Escape(txtUsername.Text); string password = Util.Escape(txtPassword.Text); WebsiteUser user = WebsiteUser.Create(username, password); if (user != null) { //Set some session variables and redirect to user profile } else { lblFeedback.Text = Localizer.Translate("INVALID_LOGIN"); lblFeedback.ForeColor = Color.Red; lblFeedback.Visible = true; pnlLogin.Visible = true; } } The website is running on ASP.NET 2.0 on ISS 5.1 (Win XP Pro)

    Read the article

  • How to bind a label inside a gridview to another table?

    - by Kolten
    I have a very standard Gridview, with Edit and Delete buttons auto-generated. It is bound to a tableadapter which is linked to my "RelationshipTypes" table. dbo.RelationshipTypes: ID, Name, OriginConfigTypeID, DestinationConfigTypeID I wish to use a label that will pull the name from the ConfigTypes table, using the "OriginConfigTypeID" and "DestinationTypeID" as the link. dbo.ConfigTypes: ID, Name My problem is, I can't automatically generate Edit and Delete buttons using an Inner Join in my dataset. Or can I? FOllowing is my code: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AutoGenerateDeleteButton="True" AutoGenerateEditButton="True" CssClass="TableList" DataKeyNames="ID" DataSourceID="dsRelationShipTypes1"> <Columns> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" Visible=False/> <asp:TemplateField HeaderText="Origin" SortExpression="OriginCIType_ID"> <EditItemTemplate> &nbsp;<asp:DropDownList Enabled=true ID="DropDownList2" runat="server" DataSourceID="dsCIType1" DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("OriginCIType_ID") %>'> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> &nbsp; <asp:Label ID="Label2" runat="server" Text='<%# Bind("OriginCIType_ID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Name" SortExpression="Name"> <EditItemTemplate> <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label3" runat="server" Text='<%# Bind("Name") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Destination" SortExpression="DestinationCIType_ID"> <EditItemTemplate> <asp:DropDownList ID="DropDownList3" runat="server" DataSourceID="dsCIType1" DataTextField="Name" DataValueField="ID" SelectedValue='<%# Bind("DestinationCIType_ID") %>'> </asp:DropDownList> </EditItemTemplate> <ItemTemplate> <asp:Label ID="Label1" runat="server" Text='<%# Bind("DestinationCIType_ID") %>'></asp:Label> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> So I did try to create my own edit and delete buttons, but kept receiving the error "cannot find update method" or something similar. Do I have to manually code the delete and update methods in my code-behind?

    Read the article

  • Using C# FindControl to find a user-control in the master page

    - by Jisaak
    So all I want to do is simply find a user control I load based on a drop down selection. I have the user control added but now I'm trying to find the control so I can access a couple properties off of it and I can't find the control for the life of me. I'm actually doing all of this in the master page and there is no code in the default.aspx page itself. Any help would be appreciated. MasterPage.aspx <body> <form id="form1" runat="server"> <div> <asp:ScriptManager runat="server"> </asp:ScriptManager> </div> <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" OnLoad="UpdatePanel2_Load"> <ContentTemplate> <div class="toolbar"> <div class="section"> <asp:DropDownList ID="ddlDesiredPage" runat="server" AutoPostBack="True" EnableViewState="True" OnSelectedIndexChanged="goToSelectedPage"> </asp:DropDownList> &nbsp; <asp:DropDownList ID="ddlDesiredPageSP" runat="server" AutoPostBack="True" EnableViewState="True" OnSelectedIndexChanged="goToSelectedPage"> </asp:DropDownList> <br /> <span class="toolbarText">Select a Page to Edit</span> </div> <div class="options"> <div class="toolbarButton"> <asp:LinkButton ID="lnkSave" CssClass="modal" runat="server" OnClick="lnkSave_Click"><span class="icon" id="saveIcon" title="Save"></span>Save</asp:LinkButton> </div> </div> </div> </ContentTemplate> <Triggers> </Triggers> </asp:UpdatePanel> <div id="contentContainer"> <asp:UpdatePanel ID="UpdatePanel1" runat="server" OnLoad="UpdatePanel1_Load" UpdateMode="Conditional" ChildrenAsTriggers="False"> <ContentTemplate> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="lnkHome" EventName="Click" /> <asp:AsyncPostBackTrigger ControlID="rdoTemplate" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> </div> MasterPage.cs protected void goToSelectedPage(object sender, System.EventArgs e) { temp1 ct = this.Page.Master.LoadControl("temp1.ascx") as temp1; ct.ID = "TestMe"; this.UpdatePanel1.ContentTemplateContainer.Controls.Add(ct); } //This is where I CANNOT SEEM TO FIND THE CONTROL //////////////////////////////////////// protected void lnkSave_Click(object sender, System.EventArgs e) { UpdatePanel teest = this.FindControl("UpdatePanel1") as UpdatePanel; Control test2 = teest.ContentTemplateContainer.FindControl("ctl09") as Control; temp1 test3 = test2.FindControl("TestMe") as temp1; string maybe = test3.Col1TopTitle; } Here I don't understand what it's telling me. for "par" I get "ctl09" and I have no idea how I am supposed to find this control. temp1.ascx.cs protected void Page_Load(object sender, EventArgs e) { string ppp = this.ID; string par = this.Parent.ID; }

    Read the article

  • Why is AutoCompleteExtender not firing?

    - by Antoine
    Hi, I have some issue with the ASP AutoCompleteExtender control. I got one in my page that is working fine, but I have put another one in the same page, and I can't get it to work. Using HTTP Analyzer, no query is fired when I type into the textbox associated with it. Has anyone an idea? Both call the same webservice, with a different ContextKey parameter. The webservice cannot be the cause as it works in the first case (DevMgrTxtBox), and is not even called in the second (DevTxtBox). Properties of both controls are similar, I just changed the ID and targetControlID of the second. The code below is in a ContentPlaceHolder. I'm using VS2005 with .NET 2.0. AjaxControlToolkit.dll is in version 1.0.20229.0. EDIT: solution found. The ID is not the only thing that needs to be unique, the BehaviorID property must be unique too. Which wasn't documented. <tr> <td> <asp:Label ID="DevtMgrLbl" runat="server" Text="Development Manager"></asp:Label> </td> <td> <asp:UpdatePanel runat="server" id="devMgrPanel"> <contenttemplate> <asp:TextBox id="DevMgrTxtBox" runat="server"></asp:TextBox> <ajaxToolkit:AutoCompleteExtender id="AutoCompleteRole1" runat="server" CompletionSetCount="5" EnableCaching="true" BehaviorID="autoCompleteExtender" CompletionInterval="100" MinimumPrefixLength="2" ServiceMethod="GetRoleList" ServicePath="AutoCompleteRoles.asmx" TargetControlID="DevMgrTxtBox" ContextKey="DM"> </ajaxToolkit:AutoCompleteExtender> </contenttemplate> <triggers> <asp:AsyncPostBackTrigger ControlID="DevMgrTxtBox" EventName="TextChanged"></asp:AsyncPostBackTrigger> </triggers> </asp:UpdatePanel> </td> </tr> <tr> <td> <asp:Label ID="DevLbl" runat="server" Text="Developer"></asp:Label> </td> <td> <asp:UpdatePanel runat="server" id="devPanel"> <contenttemplate> <asp:TextBox ID="DevTxtBox" runat="server"></asp:TextBox> <ajaxToolkit:AutoCompleteExtender id="AutoCompleteRole2" runat="server" CompletionSetCount="5" EnableCaching="true" BehaviorID="autoCompleteExtender" CompletionInterval="100" MinimumPrefixLength="2" ServiceMethod="GetRoleList" ServicePath="AutoCompleteRoles.asmx" TargetControlID="DevTxtBox" ContextKey="DEV"> </ajaxToolkit:AutoCompleteExtender> </contenttemplate> <triggers> <asp:AsyncPostBackTrigger ControlID="DevTxtBox" EventName="TextChanged"></asp:AsyncPostBackTrigger> </triggers> </asp:UpdatePanel> </td> </tr>

    Read the article

  • "The Controls collection cannot be modified because the control contains code blocks"

    - by Daniel P
    I am trying to create a simple user control that is a slider. When I add a AjaxToolkit SliderExtender to the user control I get this (*&$#()@# error: Server Error in '/' Application. The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %). 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.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %). 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: [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %).] System.Web.UI.ControlCollection.Add(Control child) +8677431 AjaxControlToolkit.ScriptObjectBuilder.RegisterCssReferences(Control control) in d:\E\AjaxTk-AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ScriptObjectBuilder.cs:293 AjaxControlToolkit.ExtenderControlBase.OnLoad(EventArgs e) in d:\E\AjaxTk-AjaxControlToolkit\Release\AjaxControlToolkit\ExtenderBase\ExtenderControlBase.cs:306 System.Web.UI.Control.LoadRecursive() +50 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Control.LoadRecursive() +141 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627 Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074 I have tried putting a placeholder in the user control and adding the textbox and slider extender to the placeholder programmatically and I still get the error. Here is the simple code: <table cellpadding="0" cellspacing="0" style="width:100%"> <tbody> <tr> <td></td> <td> <asp:Label ID="lblMaxValue" runat="server" Text="Maximum" CssClass="float_right" /> <asp:Label ID="lblMinValue" runat="server" Text="Minimum" /> </td> </tr> <tr> <td style="width:60%;"> <asp:CheckBox ID="chkOn" runat="server" /><asp:Label ID="lblPrefix" runat="server" />:&nbsp;<asp:Label ID="lblSliderValue" runat="server" />&nbsp;<asp:Label ID="lblSuffix" runat="server" /> </td> <td style="text-align:right;width:40%;"> <asp:TextBox ID="txtSlider" runat="server" Text="50" style="display:none;" /> <ajaxToolkit:SliderExtender ID="seSlider" runat="server" BehaviorID="seSlider" TargetControlID="txtSlider" BoundControlID="lblSliderValue" Orientation="Horizontal" EnableHandleAnimation="true" Length="200" Minimum="0" Maximum="100" Steps="1" /> </td> </tr> </tbody> What is the problem? Thanks in advance. Dan

    Read the article

  • Why will my AdRotator not display images? (Image paths are correct)

    - by KSwift87
    Hi. I'm writing a simple web application in C# and I've gotten to the part where I must add an AdRotator object and link four images to it. I have done this, but no matter what I do the images will not show up; only the alternate text. It makes no sense because the paths are correct. Supposedly AdRotator controls are really simple to use... But anyway below is my code. Search.aspx: <%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="Module6.WebForm2" Title="Search" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <form id="Search" runat="server"> This is the Search page! <div class="StartCalendar"> <asp:Calendar ID="Calendar1" runat="server" Caption="Start Date" TodayDayStyle-Font-Bold="true" TodayDayStyle-ForeColor="Crimson" SelectedDayStyle-BackColor="DarkCyan" /> </div> <div class="EndCalendar"> <asp:Calendar ID="Calendar2" runat="server" Caption="End Date" TodayDayStyle-Font-Bold="true" TodayDayStyle-ForeColor="Crimson" SelectedDayStyle-BackColor="DarkCyan" /> </div> <br /><br /> <div class="Search"> <asp:Button ID="btnSearch" runat="server" Text="Search" UseSubmitBehavior="true" /> </div><br /><br /> <div class="CenterAd"> <asp:AdRotator ID="AdRotator1" runat="server" Target="_blank" AdvertisementFile="~/Advertisements.xml" /> </div> <br /><br /> <div class="Results"> <asp:GridView ID="gvResults" runat="server" /> </div> </form> </asp:Content> Advertisements.xml: <?xml version="1.0" encoding="utf-8" ?> <Advertisements> <Ad> <ImageURL>~/images/colts.jpg</ImageURL> <AlternateText>Colts Image</AlternateText> </Ad> <Ad> <ImageURL>~/images/conseco.gif</ImageURL> <AlternateText>Conseco Image</AlternateText> </Ad> <Ad> <ImageURL>~/images/IndianapolisIndians.png</ImageURL> <AlternateText>Indianapolis Indians Image</AlternateText> </Ad> <Ad> <ImageURL>~/images/pacers.gif</ImageURL> <AlternateText>Pacers Image</AlternateText> </Ad> </Advertisements> Any and all help is GREATLY appreciated.

    Read the article

  • My pay pal button will not link to pay pal. It only refreshes page, why?

    - by JPJedi
    I have the following code in my registration page to go to a paypal button. But when I click on the button it just refreshes the page. Is their something I am missing? I should be able to include a paypal button on an aspx page right? <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <asp:Panel runat="server" ID="pnlRegisterPage" CssClass="registerPage"> <table> <tr> <td><p>Plain text</p></td> <td> <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="Z8TACKRHQR722"> <table> <tr><td><input type="hidden" name="on0" value="Registration Type">Registration Type</td></tr><tr><td><select name="os0"> <option value="Team">Team $80.00</option> <option value="Individual">Individual $40.00</option> </select> </td></tr> </table> <input type="hidden" name="currency_code" value="USD"> <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> </td> </tr> </table> </asp:Panel> </asp:Content> Master Page <body> <form id="form1" runat="server"> <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server"> </asp:ToolkitScriptManager> <div class="masterbody"> <center> <asp:Image runat="server" ID="imgLogo" ImageUrl="" /></center> <div class="menubar"> <div class="loginview"> <asp:LoginView ID="MenuBar" runat="server"> <AnonymousTemplate> </AnonymousTemplate> <LoggedInTemplate> </LoggedInTemplate> </asp:LoginView> </div> </div> <div> <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"> </asp:ContentPlaceHolder> </div> </div> <div class="footer"></div> </form> </body>

    Read the article

  • which control in vs08 aspx c# will be able to take html tags as input and display it formatted accor

    - by user287745
    i asked a few questions regarding this and got answers that indicate i will have to make an costum build editor using ,markdown, .... to achieve something like stackoverflow.com/questions/ask page. there is time limitation and the requirements are that much, i have to achieve 1) allow users to using html tags when giving input 2) save that complete input to sql db 3) display the data in db withing a contol which renders the formatting as the tags specify. i am aware label and literal controls support html tags, the problem is how to allow the user to input the textbox does not seem the support html tags? thank you Need help in implementing the affect of the WRITE A NEW POST On stackoverflow.com <%--The editor--% <asp:UpdatePanel ID="UpdatePanel7" runat="server"> <ContentTemplate> <asp:Label ID="Label4" runat="server" Text="Label"></asp:Label> <div id="textchanging" onkeyup="textoftextbox('TextBox3'); return false;"> <asp:TextBox ID="TextBox3" runat="server" CausesValidation="True" ></asp:TextBox> </div> <%-- OnTextChanged="textoftextbox('TextBox3'); return false;" gives too man literals error. --%> <asp:Button ID="Button6" runat="server" Text="Post The Comment, The New, Write on Wall" onclick="Button6_Click" /> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> <asp:TextBox ID="TextBox4" runat="server" CausesValidation="True"></asp:TextBox> <asp:Literal ID="Literal2" runat="server" Text="this must change" here comes the div <div id="displayingarea" runat="server">This area will change</div> </ContentTemplate> </asp:UpdatePanel> <%--The editor ends--%> protected void Button6_Click(object sender, EventArgs e) { Label3.Text = displayingarea.InnerHtml; } As you see, I have implemented the effect of typing text in textbox which appears as a reflection in the div WITH FULLY FORMATTED TEXT ACCORDIG TO THE HTML TAGS USED The textbox does not allow html! Well the text box doesnot have too, script just extracts what is typed, within letting the server know. The html of the div tag also changes as typed in textbox. Now, There is a “post” button within an update plane a avoid full post back of page What I needis when the button is clicked on the value withing the div tag “innerhtml” is passed on to the label. Yes I know the chnages are only made on the client side, So when the button click event occurs the server is not aware of the new data within the div tag, Therefore the server assign the original html withing the div to the lab. Need help to overcome this, How is it that what we enter text in the textbox press the button with coding like label1.text=textbox1.text; and it works even in update panel, but the aabove code for extracting innerhtml typed at users end similar to yping in textbox does not work?

    Read the article

  • ASP.NET gridview control in side update panel has a problem

    - by Eyla
    Greetings, I have gridview with SelectedIndexChanged event. when I click on a record in gridview it should call the SelectedIndexChanged event and do some operations. SelectedIndexChanged event is working OK, but when I put the gridview inside ajax updatepanle SelectedIndexChanged event will not response even if I add AsyncPostBackTrigger trigger for SelectedIndexChanged event. Please look at my code and advice me what I should do!! Thank you <%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="IMAM_APPLICATION.WebForm1" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <div id="mydiv"> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <br /> <br /> <br /> <asp:GridView ID="GridView1" runat="server" style="position:absolute; top: 280px; left: 30px; height: 240px; width: 915px;" PageSize="5" onselectedindexchanged="GridView1_SelectedIndexChanged" AutoGenerateColumns="False" DataKeyNames="idcontact_info"> <Columns> <asp:CommandField ShowSelectButton="True" /> <asp:BoundField AccessibleHeaderText="Midle Name" DataField="Midle_Name" /> <asp:BoundField DataField="Last_Name" HeaderText="Last Name" /> <asp:BoundField DataField="Phone_home" HeaderText="Phone Home" /> <asp:BoundField DataField="cell_home" HeaderText="Mobile Home" /> <asp:BoundField DataField="phone_work" HeaderText="Phone Work" /> <asp:BoundField DataField="cell_Work" HeaderText="Mobile Work" /> <asp:BoundField DataField="Email_Home" HeaderText="Personal Home" /> <asp:BoundField DataField="Email_work" HeaderText="Work Email" /> </Columns> </asp:GridView> <br /> <br /> <br /></ContentTemplate> <Triggers> <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="SelectedIndexChanged" /> </Triggers> </asp:UpdatePanel> <asp:RadioButton ID="rdoSearchFlat" runat="server" style="position:absolute; top: 565px; left: 70px;" Text="Flat Search" GroupName="Search"/> <asp:TextBox ID="txtSearch" runat="server" style="position:absolute; top: 560px; left: 170px;" ></asp:TextBox> <asp:Button ID="btnSearch" runat="server" Text="Search" style="position:absolute; top: 555px; left: 375px;" CausesValidation="False" onclick="btnSearch_Click"/> <asp:Label ID="Label7" runat="server" Style="position: absolute; top: 630px; left: 85px;" Text="First Name"></asp:Label> <asp:TextBox ID="txtFirstName" runat="server" Style="top: 630px; left: 185px; position: absolute; height: 22px; width: 128px"> </asp:TextBox> </div> </asp:Content>

    Read the article

  • Selected Index Changed event not firing both Autopostback property

    - by TechGuy
    In my Dropdownlist Selected index change event not firing.Here i use auto post back true & View state also true.But Selected Index Changed Event not firing My Code <%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminEagleViewLogin.aspx.cs" Inherits="AdminEagleViewLogin" %> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <style> body{padding-top:20px;} </style> <title></title> </head> <body> <form id="form1" runat="server"> <div class="container"> <div class="row"> User : <asp:DropDownList ID="drpusr" runat="server" Visible="true" OnSelectedIndexChanged="drpusr_SelectedIndexChanged" AutoPostBack="true" EnableViewState="true" ></asp:DropDownList> Password: <asp:Label ID="lbluserpw" runat="server"></asp:Label> <div class="col-md-4 col-md-offset-4"> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Please sign in</h3> </div> <div class="panel-body"> <form accept-charset="UTF-8" role="form"> <fieldset> <div class="form-group"> <asp:TextBox ID="txtusr" runat="server"></asp:TextBox> </div> <div class="form-group"> <asp:TextBox ID="txtpw" runat="server" TextMode="Password"></asp:TextBox> </div> <div class="checkbox"> <label> <input name="remember" type="checkbox" value="Remember Me"> Remember Me </label> </div> <asp:CheckBox ID="chkremember" runat="server" Visible="false" class="remchkbox" /> <asp:Button ID="submit" runat="server" class="btn btn-lg btn-success btn-block" Text="Submit" OnClick="submit_Click" /> </fieldset> </form> </div> </div> </div> </div> </div> </form> </body> </html> ServerSide User bind to Dropdown is working. public partial class AdminEagleViewLogin : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { BindUsers(); //lbluserpw.Text = Membership.Provider.GetPassword(drpusr.SelectedValue, String.Empty); } protected void submit_Click(object sender, EventArgs e) { if (Membership.ValidateUser(txtusr.Text, txtpw.Text)) { FormsAuthentication.SetAuthCookie(txtusr.Text, chkremember.Checked); string[] CurrentUserRole = Roles.GetRolesForUser(txtusr.Text); var admin = "Administrator"; var manager = "Manager"; var user = "User"; if (CurrentUserRole.Contains(admin)) { Response.Redirect("Administrator.aspx"); } else if (CurrentUserRole.Contains(manager)) { Response.Redirect("Manager.aspx"); } else { Response.Redirect("UserPage.aspx"); } } else { Response.Redirect("AdminEagleViewLogin.aspx"); } } protected void BindUsers() { DataAccess da = new DataAccess(); drpusr.DataSource = da.GetUsers(); drpusr.DataTextField = "UserName"; drpusr.DataValueField = "UserId"; drpusr.DataBind(); drpusr.Items.Insert(0, new ListItem("-- Select User --", "0")); drpusr.Items.RemoveAt(1); } protected void drpusr_SelectedIndexChanged(object sender, EventArgs e) { lbluserpw.Text = Membership.Provider.GetPassword(drpusr.SelectedValue, String.Empty); } }

    Read the article

  • Ajax Calendar Date Range with JavaScript

    - by hungrycoder
    I have the following code to compare two dates with the following conditions Scenario: On load there are two text boxes (FromDate, ToDate) with Ajax calendar extenders. On load From Date shows today's date. when date less than today was selected in both text boxes(FromDate, ToDate), it alerts user saying "You cannot select a day earlier than today!" When ToDate's Selected date < FromDate's Selected Date, alerts user saying "To Date must be Greater than From date." and at the same time it clears the selected Date in ToDate Text box. Codeblock: ASP.NET , AJAX <asp:TextBox ID="txtFrom" runat="server" ReadOnly="true"></asp:TextBox> <asp:ImageButton ID="imgBtnFrom" runat="server" ImageUrl="~/images/Cal20x20.png" Width="20" Height="20" ImageAlign="TextTop" /> <asp:CalendarExtender ID="txtFrom_CalendarExtender" PopupButtonID="imgBtnFrom" runat="server" Enabled="True" OnClientDateSelectionChanged="checkDate" TargetControlID="txtFrom" Format="MMM d, yyyy"> </asp:CalendarExtender> <asp:TextBox ID="txtTo" runat="server" ReadOnly="true"></asp:TextBox> <asp:ImageButton ID="imgBtnTo" runat="server" ImageUrl="~/images/Cal20x20.png" Width="20" Height="20" ImageAlign="TextTop" /> <asp:CalendarExtender ID="txtTo_CalendarExtender" OnClientDateSelectionChanged="compareDateRange" PopupButtonID="imgBtnTo" runat="server" Enabled="True" TargetControlID="txtTo" Format="MMM d, yyyy"> </asp:CalendarExtender> <asp:HiddenField ID="hdnFrom" runat="server" /> <asp:HiddenField ID="hdnTo" runat="server" /> C# Code protected void Page_Load(object sender, EventArgs e) { txtFrom.Text = string.Format("{0: MMM d, yyyy}", DateTime.Today); if (Page.IsPostBack) { if (!String.IsNullOrEmpty(hdnFrom.Value as string)) { txtFrom.Text = hdnFrom.Value; } if (!String.IsNullOrEmpty(hdnTo.Value as string)) { txtTo.Text = hdnTo.Value; } } } JavaScript Code <script type="text/javascript"> function checkDate(sender, args) { document.getElementById('<%=txtTo.ClientID %>').value = ""; if (sender._selectedDate < new Date()) { alert("You cannot select a day earlier than today!"); sender._selectedDate = new Date(); // set the date back to the current date sender._textbox.set_Value(sender._selectedDate.format(sender._format)); //assign the value to the hidden field. document.getElementById('<%=hdnFrom.ClientID %>').value = sender._selectedDate.format(sender._format); //reset the to date to blank. document.getElementById('<%=txtTo.ClientID %>').value = ""; } else { document.getElementById('<%=hdnFrom.ClientID %>').value = sender._selectedDate.format(sender._format); } } function compareDateRange(sender, args) { var fromDateString = document.getElementById('<%=txtFrom.ClientID %>').value; var fromDate = new Date(fromDateString); if (sender._selectedDate < new Date()) { alert("You cannot select a Date earlier than today!"); sender._selectedDate = ""; sender._textbox.set_Value(sender._selectedDate) } if (sender._selectedDate <= fromDate) { alert("To Date must be Greater than From date."); sender._selectedDate = ""; sender._textbox.set_Value(sender._selectedDate) } else { document.getElementById('<%=hdnTo.ClientID %>').value = sender._selectedDate.format(sender._format); } } </script> Error Screen(Hmmm :X) Now in ToDate, when you select Date Earlier than today or Date less than FromDate, ToDate Calendar shows NaN for Every Date and ,0NaN for Year

    Read the article

  • How to prevent DIVs from sliding over each other

    - by Haghpanah
    I’m going to use DIV-based layout instead of table-based to reduce amount of markups and speed up page loading, however I’ve found it too much tricky as I’m not CSS guru. I use following CSS class to simulate rows of a table containing one column for label and one for textbox. .FormItem { margin-left: auto; margin-right: auto; width: 604px; min-height: 36px; } .ItemLabel { float: left; width: 120px; padding: 3px 1px 1px 1px; text-align: right; } .ItemTextBox { float: right; width: 480px; padding: 1px 1px 1px 1px; text-align: left; } , <div class="FormItem"> <div class="ItemLabel"> <asp:Label ID="lblName" runat="server" Text="Name :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <p><span>User Name</span></p> </div> </div> <div class="FormItem"> <div class="ItemLabel"> <asp:Label ID="lblComments" runat="server" Text="Comments :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtComments" runat="server"></asp:TextBox> <p><span>(optional)Comments</span></p> </div> </div> These styles work fine if the height of ItemData DIVs are less than or equal to FormItem DIVs min-height. If ItemData DIVs height gets more than FormItem height then ItemText DIVs start sliding over FormItem DIVs to and ItemText and ItemData are no longer aligned. For example the following markups… <div class="FormItem"> <div class="ItemLabel"> <asp:Label ID="lblName" runat="server" Text="Name :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtName" runat="server"></asp:TextBox> <p><span>User Name</span></p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> </div> </div> <div class="FormLabel"> <div class="ItemText"> <asp:Label ID="lblComments" runat="server" Text="Comments :"></asp:Label> </div> <div class="ItemTextBox"> <asp:TextBox ID="txtComments" runat="server"></asp:TextBox> <p><span>(optional)Comments</span></p> </div> </div> I've tried several CSS attributes such as; position, float, clear… but I can not correct the problem. I’ll be appreciated for any help.

    Read the article

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